當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Component::run方法代碼示例

本文整理匯總了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();
 }
開發者ID:energine-cmf,項目名稱:energine,代碼行數:9,代碼來源:CommentsForm.php

示例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;
		}
	}
開發者ID:eddythemeddy,項目名稱:Equinox-CMS,代碼行數:81,代碼來源:page.php


注:本文中的Component::run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。