本文整理匯總了PHP中Component::run方法的典型用法代碼示例。如果您正苦於以下問題:PHP Component::run方法的具體用法?PHP Component::run怎麽用?PHP Component::run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Component
的用法示例。
在下文中一共展示了Component::run方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ban
/**
* Ban.
*/
protected function ban()
{
$this->request->setPathOffset($this->request->getPathOffset() + 1);
$this->userEditor = $this->document->componentManager->createComponent('ue', 'Energine\\user\\components\\UserEditor');
$this->userEditor->run();
}
示例2: loadPage
public function loadPage($url = false) {
global $compS,
$pageSett,
$headScript,
$footScript,
$lastScript,
$equrl;
$view = new View();
$component = new Component();
$page = $this;
if(empty($equrl[0])) {
$pageSett_q = 'SELECT * FROM cms_pages
WHERE
id = "1"
AND pagestatus = "live"'; //its home page then
} else {
$pageSett_q = 'SELECT * FROM cms_pages
WHERE
page_url = "'.$url.'"
AND pagestatus = "live"'; //its either home again or another page
}
$pageSett_r = mysql_query($pageSett_q) or die(mysql_error());
$pageSett = mysql_fetch_array($pageSett_r); //existing page
if(!empty($pageSett['redirect'])){
header('location: ' . $pageSett['redirect']);
}
if (mysql_num_rows($pageSett_r)==0) { //check if page exists
$view->loadHeader();
echo $view->loadBody();
$view->load404();
$view->loadFooter();
ob_clean();
$pageSett['title'] = "404"; //404 page
$pageSett['id'] = "0"; //404 page
$pageSett['meta_title'] = ""; //404 page
$pageSett['meta_keywords'] = ""; //404 page
$pageSett['meta_description'] = ""; //404 page
$headscript = $page->head();
$footscript = $page->foot();
$view->loadHeader();
echo $headscript;
echo $view->loadBody();
$view->load404();
$view->loadFooter();
echo $footscript;
} else {
$view->loadHeader();
echo $view->loadBody();
$component->run($pageSett['id']);
$view->loadFooter();
ob_clean();
$headscript = $page->head();
$footscript = $page->foot();
$lastscript = $page->last();
$view->loadHeader();
echo $headscript;
echo $view->loadBody();
$component->run($pageSett['id']);
$view->loadFooter();
echo $footscript;
echo $lastscript;
}
}