CI_Model::__get PHP Method

__get() public method

Allows models to access CI's loaded classes using the same syntax as controllers.
public __get ( string $key )
$key string
    public function __get($key)
    {
        // Debugging note:
        //	If you're here because you're getting an error message
        //	saying 'Undefined Property: system/core/Model.php', it's
        //	most likely a typo in your model code.
        return get_instance()->{$key};
    }

Usage Example

Ejemplo n.º 1
0
 public function __get($name)
 {
     if ($name == 'table') {
         return $this->{$name};
     }
     return parent::__get($name);
 }
All Usage Examples Of CI_Model::__get