public function __toString() { $file = implode("/", $this->_path); $this->_path = array(); $block = new Joy_View_Block(array("file" => $file)); $context = Joy_Context::getInstance(); return $context->response->getRender()->execute($block); }
public function __toString() { if (!$this->_view instanceof Joy_View_Layout) { return "Action importer only work Joy_View_Layout"; } $context = Joy_Context::getInstance(); $render = $context->response->getRender(); return $render->execute($this->_view->getPlaceHolder()); }
public function execute($view) { parent::execute($view); return $view->render(); $context = Joy_Context::getInstance(); $resource = $view->getResourceList(); $context->response->addScript($resource["javascripts"]); $context->response->addStyle($resource["stylesheets"]); $application = $context->config->application->get("application"); $application["i18n"] = $view->getLocale(); $tpl = new PHPTAL(); $tpl->setSource($view->getTemplate()); $tpl->import = new Joy_Render_Template_Importer($view); $tpl->application = $application; $tpl->get = (array) $view->assignAll(); return $tpl->execute(); }
public function onRunning() { $item = $this->router->match($_SERVER["REQUEST_URI"]); if ($item instanceof Joy_Router_Match) { // Instance Context $context = Joy_Context::getInstance(); $context->request->setAction($item->getController(), $item->getAction(), $item->getArguments()); $context->request->setParameters($item->getParameters()); $context->request->setMethod($item->getMethod()); // Render Factory $render = $item->getRender(); // Set Theme To Render $theme = $item->getTheme(); $render->setTheme($theme); // Injection Render In The Response Object $context->response->setRender($render); // Page Factory $page = Joy_Page::factory($item->getPage()); // Page is building $page->build(); } else { throw new Joy_Exception_NotFound_Class("Joy_Router_Match class not found"); } }
/** * getLocalePath method is getter {name}.{language}.locale file * * @return string locale file path */ public function getLocalePath() { $context = Joy_Context::getInstance(); return sprintf("%s/%s.locale", $this->getViewFolder(), $this->getName()); }