2012-05-02 3 views
0

Phil Sturgeonのテンプレートライブラリを使用しています。 私はモジュールも使用しています。私はCodeIgniter Phil Sturgeonのテンプレートライブラリエラー

$this->template->set_theme('nvc'); 
$this->template->set_layout('theme'); 

を追加するとき

モジュールのブログにのみ有効です。しかし、私はコアファイルでそれを設定する、ことを望んでいません。私はこれをどのように修正すべきですか?

モジュールの歓迎は完全に

class Welcome extends NVC_Controller { 

function index() 
{ 
    $this->template->build('theme'); 
} 
} 

動作しますが、モジュールのブログは(テンプレート)エラーを与える:

要求されたファイルをロードすることができません:default.php

class Blog extends NVC_Controller { 

var $num = 10; 

function __construct() 
{ 
    $this->load->model('blog_model', 'blog'); 
} 

function index() 
{ 
    $data["result"] = $this->blog->get_all_posts($this->num); 
    $this->template->build('blog', $data); 
} 

} 

をコア/ NVC_Controller.php

class NVC_Controller extends MX_Controller { 
function __construct(){ 
    if(nvc_site_open()){     
     $this->template->set_theme('nvc'); 
     $this->template->set_layout('theme'); 
    } else { 
     show_error("De site is momenteel gesloten."); 
    } 
} 
} 

どうなりますか?設定レイアウトを「テーマ」に設定しても動作しません。 テンプレートはapplication/themes/nvc/views/layouts/theme.phpに格納されています。

答えて

0

CIインストールのファイルが、指定された場所に存在しないdefault.phpを呼び出そうとしています。あなたはそれがどんなファイルであるか調査して、そのコードをここに投稿できますか?

関連する問題