本文整理汇总了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;
}
}