本文整理汇总了PHP中ActionResponse::setHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionResponse::setHtml方法的具体用法?PHP ActionResponse::setHtml怎么用?PHP ActionResponse::setHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionResponse
的用法示例。
在下文中一共展示了ActionResponse::setHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
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;
}
示例2: component
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;
}