58 private $_loaded_models = array();
114 $this->module_name = $module;
115 $this->controller_name = $controller;
117 $this->action_name = $action;
122 foreach ($this->libs as $lib) {
129 call_user_func_array(array($this,
'models'), $this->
models);
140 $args = func_get_args();
141 foreach ($args as $model) {
142 $file =
APP_PATH .
"models/$model.php";
143 if (is_file($file)) {
146 $this->$Model =
new $Model();
147 $this->_loaded_models[] = $Model;
148 } elseif (is_dir(
APP_PATH .
"models/$model")) {
149 foreach (
new DirectoryIterator(
APP_PATH .
"models/$model") as $file) {
150 if ($file->isDot() || $file->isDir()) {
153 if ($file->isFile()) {
154 include_once $file->getPathname();
156 $this->$Model =
new $Model();
157 $this->_loaded_models[] = $Model;
174 protected function cache($time, $type =
'view', $group = FALSE)
204 if (func_num_args() > 1) {
205 return call_user_func_array(array(
'Request',
'filter'), func_get_args());
216 protected function get($variable = NULL)
232 $param_name = explode(
'.', $param_name);
233 if (count($param_name) > 1) {
234 $value = isset($_REQUEST[$param_name[0]][$param_name[1]]) ? $_REQUEST[$param_name[0]][$param_name[1]] : NULL;
236 $value = isset($_REQUEST[$param_name[0]]) ? $_REQUEST[$param_name[0]] : NULL;
242 if (func_num_args() > 1) {
243 $args = func_get_args();
246 if (is_string($value)) {
247 return call_user_func_array(array(
'Filter',
'get'), $args);
249 return call_user_func_array(array(
'Filter',
'get_array'), $args);
303 protected function redirect($controller, $seconds=NULL)
316 return (isset($_SERVER[
'HTTP_X_REQUESTED_WITH']) && $_SERVER[
'HTTP_X_REQUESTED_WITH'] ==
'XMLHttpRequest');
383 foreach ($this->_loaded_models as $model) {
384 unset($this->$model);
388 $this->_loaded_models = array();
390 if (isset($this->
template)) {
411 $_SESSION[
'KUMBIA_CONTROLLER'][
"$this->module_name/$this->controller_name"][$var] = $value;
427 return $_SESSION[
'KUMBIA_CONTROLLER'][
"$this->module_name/$this->controller_name"][$var];
437 $args = func_get_args();
438 foreach ($args as $var) {
439 if (isset($_SESSION[
'KUMBIA_CONTROLLER'][
"$this->module_name/$this->controller_name"][$var])) {
440 unset($_SESSION[
'KUMBIA_CONTROLLER'][
"$this->module_name/$this->controller_name"][$var]);