私はビューを一度ロードして別のページに再利用するだけのベストな方法を見つけようとしています。codeignitorを使った複数のページ?
私はこのコードを持っ例えばホームページの:
function index()
{
/* Load Includes for all pages */
$header = $this->load->view('includes/header','',true);
$scripts = $this->load->view('includes/scripts','',true);
$navigation = $this->load->view('includes/navigation','',true);
$footer = $this->load->view('includes/footer','',true);
/* Load widgets for Home Page*/
$rotator = $this->load->view('widgets/home_feature','',true);
$login = $this->load->view('widgets/login','',true);
$cal = $this->load->view('widgets/calendar_home','',true);
$gallery = $this->load->view('widgets/photos_scroll','',true);
$tags = $this->load->view('widgets/tags_view','',true);
$spotlight = $this->load->view('widgets/spotlight','',true);
$recent = $this->load->view('widgets/activityfeed','',true);
$data=array(
'title'=>'Philly2Night.com',
'MetaDesc'=>'Cities2Night new social network',
'MetaKeywords'=>'Social, Party, Plan, Events',
//Load Includes
'header'=>$header,
'scripts'=>$scripts,
'navigation'=>$navigation,
'footer'=>$footer,
//Load Widgets
'feature'=>$rotator,
'login'=>$login,
'calendar'=>$cal,
'photos'=>$gallery,
'tags'=>$tags,
'spotlight'=>$spotlight,
'recent'=>$recent
);
$this->load->vars($data);
$this->load->view('pages/home_view');
}
はどうやって新しいページを作成しますが、これらのビューを参照していますか?私はvarグローバルを作ろうとしました、理想的には私はスイッチを使いたい、そしてケースを定義したいのですが、それはうまくいきませんでした。
これは、私の家の景色の異なる場所にセグメントを読み込むために行われました。 – matthewb