Skip to content

Commit

Permalink
Fix Undefined variable: object error
Browse files Browse the repository at this point in the history
Change the undefined variable $object to $vars when calling get_object_vars().
This fixes an error when passing an object to a view.
  • Loading branch information
cfaulkner committed Jan 10, 2017
1 parent 7657600 commit b9ac1a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/core/Loader.php
Expand Up @@ -1368,7 +1368,7 @@ protected function _ci_autoloader()
* Prepare variables for _ci_vars, to be later extract()-ed inside views
*
* Converts objects to associative arrays and filters-out internal
* variable names (i.e. keys prexied with '_ci_').
* variable names (i.e. keys prefixed with '_ci_').
*
* @param mixed $vars
* @return array
Expand All @@ -1378,7 +1378,7 @@ protected function _ci_prepare_view_vars($vars)
if ( ! is_array($vars))
{
$vars = is_object($vars)
? get_object_vars($object)
? get_object_vars($vars)
: array();
}

Expand Down

0 comments on commit b9ac1a1

Please sign in to comment.