本文整理匯總了PHP中Params::push方法的典型用法代碼示例。如果您正苦於以下問題:PHP Params::push方法的具體用法?PHP Params::push怎麽用?PHP Params::push使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Params
的用法示例。
在下文中一共展示了Params::push方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderResult
public function renderResult()
{
$request_part = Request::getRequestPart();
$dot_pos = strpos($request_part, ".");
$page_name = substr($request_part, 1, $dot_pos - 1);
$page = PageFactory::create($page_name, new DataHolder());
Params::push();
Params::importFromPost(false);
Params::importFromGet(true);
ob_start();
$page->render();
$page_result = ob_get_contents();
ob_end_clean();
Params::pop();
PageData::instance()->set(Html::get_default_content_save_path(), $page_result);
render(PageData::instance()->get("/"));
//trova il layout e renderizza il tutto.
}
示例2: execute
function execute()
{
Params::push();
//callback a cui è possibile linkarsi
$this->__before_dispatch_action();
//posso agire su action, format e params ...
$this->__execute_action();
//trasformo i dati ...
if ($this->is_error) {
$final_result = $this->format_helper->formatError($this->action_result);
} else {
$final_result = $this->format_helper->formatOutputData($this->action_result);
}
//callback a cui è possibile linkarsi
$this->__after_dispatch_action();
//da vederne ancora l'utilizzo, eventualmente concatenare altre azioni??
Params::pop();
//tolgo i parametri dalla pila
if ($final_result instanceof IActionCommand) {
$final_result->execute();
return null;
} else {
return $final_result;
}
}