Skip to content

Commit

Permalink
embed attributes while parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
yllumi committed Jan 2, 2015
1 parent bafb4df commit a98fdc9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions system/application/libraries/Template.php
Expand Up @@ -816,6 +816,14 @@ public function layout_exists($layout)
return file_exists(self::_find_view_folder().$this->_layout_folder . $layout . self::_ext($layout));
}

// get page fields
function get_fields($field = false){
if($field)
return isset($this->fields[$field]) ? $this->fields[$field] : "";

return $this->fields;
}

/**
* load_view
* Load views from theme paths if they exist.
Expand Down Expand Up @@ -1100,7 +1108,7 @@ function _lex_callback($name, $attributes, $content)
if(file_exists(PLUGIN_FOLDER.$plugin_name[0].'.php')){
include_once PLUGIN_FOLDER.$plugin_name[0].'.php';
$plugin = new $plugin_name[0]();
$data = call_user_func_array(array($plugin, $plugin_name[1]), array());
$data = call_user_func_array(array($plugin, $plugin_name[1]), $attributes);

if(is_array($data))
$return .= $this->_lexparser->parse($content, $data, array($this, '_lex_callback'));
Expand All @@ -1124,13 +1132,6 @@ function _lex_callback($name, $attributes, $content)
return ($return)?$return:false;
}

// get page fields
function get_fields($field = false){
if($field)
return isset($this->fields[$field]) ? $this->fields[$field] : "";

return $this->fields;
}
}

// END Template class

0 comments on commit a98fdc9

Please sign in to comment.