「当サイトについて」ページにアクセスした場合。
http://xxxx.com/about/index.php ↓ eccube/html/about/index.php ↓ [OUT] eccube/data/class_extends/page_extends/abouts/LC_Page_Abouts_Ex.php | [extends] eccube/data/class/pages/abouts/LC_Page_Abouts.php | | | init()で使用するテンプレートやtitleをセット | | | process()で | ・レイアウト取得 | ・テンプレ用のデータ取得 | ・テンプレへデータをセット | ・テンプレの表示 | | | destroy() | [extends] eccube/data/class/pages/LC_Page.php
aboutのindex.php。基本となる形。
require_once("../require.php"); require_once(CLASS_EX_PATH . "page_extends/abouts/LC_Page_Abouts_Ex.php"); $objPage = new LC_Page_Abouts_Ex(); register_shutdown_function(array($objPage, "destroy")); $objPage->init(); $objPage->process();
aboutのinit()メソッド
function init() { parent::init(); $this->tpl_mainpage = 'abouts/index.tpl'; $this->tpl_page_category = 'abouts'; $this->tpl_title = '当サイトについて'; }
aboutのprocess()メソッド
function process() { $objView = new SC_SiteView(); // レイアウトデザインを取得 $layout = new SC_Helper_PageLayout_Ex(); $layout->sfGetPageLayout($this, false, DEF_LAYOUT); $objView->assignobj($this); $objView->display(SITE_FRAME); }
assignobj()でテンプレにデータをセットし、display()で表示する。
ちなみにキャンペーンと絡む場合はdisplay()を使わず
$objCampaignSess->pageView($this->objView);
で分岐からdisplay()する。