protected function make($name, $arguments = array()) { if ($this->has($name)) { return $this->widget[$name]; } if (strpos($name, '::') != false) { $expression = explode('::', $name); } //we will check is modules is available in given string // if not we will look for view widget into the normal views directory if (strpos($name, 'modules') !== false) { $views = $expression[0]; $moduleViews = DS . 'Views' . DS; $ds = ""; } else { $views = 'views' . DS . $expression[0]; $moduleViews = ''; $ds = DS; } $path = getcwd() . DS . APPPATH . DS . $views . DS . $expression[1] . $moduleViews . $ds; $view = $path . str_replace('.', DS, $expression[2]) . '.view' . EXT; Output::load($view, $arguments); $output = Output::endBuffer(); return $this[$name] = $output; }
/** * @return string * @throws \Exception */ private function loadView() { try { $output = Output::load($this->view_path); //include $this->view_path; } catch (\Exception $ex) { throw new \Exception('The Path ' . $this->view_path . ' is invalid.' . $ex->getMessage()); } return $this->bufferOutput(); }