public function view($sAction, $aParams = array(), $sController = false) { if ($sController) { $oController = new $sController(); } else { $oController = $this; } $bLayout = $this->sLayout === false ? false : true; if (is_scalar($this->sLayout)) { $data = Core::app()->theme()->layout()->export(); Core::app()->theme()->init(Core::app()->theme()->getName(), $this->sLayout); Core::app()->theme()->layout()->import($data); } $sActionViewClass = Toolkit::getInstance()->theme->getActionViewClass(); $oResponse = new ActionResponse($bLayout); $oView = new $sActionViewClass($oController, $sAction, $aParams); $oResponse->setHtml($oView->fetch()); return $oResponse; }
public function component($sModuleAlias, $sComponentAlias, $aParams = array()) { Core::import('Components.' . $sModuleAlias . '.' . $sComponentAlias); $sFullClassName = 'ruxon\\modules\\' . $sModuleAlias . '\\components\\' . $sComponentAlias . '\\classes\\' . $sComponentAlias . 'Component'; $sClassName = $sModuleAlias . $sComponentAlias . 'Component'; $oComponent = class_exists($sFullClassName) ? new $sFullClassName() : new $sClassName(); $oComponent->init($aParams); $oComponent->run(); $bLayout = $this->sLayout === false ? false : true; $oResponse = new ActionResponse($bLayout); $oResponse->setHtml($oComponent->fetch()); return $oResponse; }