Skip to content

Commit 5b7f4c5

Browse files
committed
🔧 improve Base_Action class
Signed-off-by: otengkwame <developerkwame@gmail.com>
1 parent c700420 commit 5b7f4c5

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

Core/core/Base_Action.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,28 @@ public function __construct()
1515
log_message('debug', "Action Class Initialized");
1616
}
1717

18-
function __get($key)
18+
/**
19+
* __get magic
20+
*
21+
* Allows models to access CI's loaded classes using the same
22+
* syntax as controllers.
23+
*
24+
* This is the same as what CI's model uses, but we keep it
25+
* here since that's the ONLY thing that CI's model does.
26+
*
27+
* @param string $key
28+
*/
29+
public function __get($key)
1930
{
31+
// Give access to protected class vars
32+
if (isset($this->$key))
33+
{
34+
return $this->$key;
35+
}
36+
2037
$CI = &get_instance();
2138
return $CI->$key;
2239
}
40+
2341
}
2442
/* end of file Base_Action.php */

0 commit comments

Comments
 (0)