2014-06-15 67 views
-1

我遇到了問題。 我嘗試編輯我的內容,但是當我點擊編輯時出現錯誤。 我得到的錯誤消息是:警告:缺少模板::錯誤()的參數1,

Warning:Missing argument 1 for Template :: error(),在C:\ xampp \ htdocs \ PassieCMS \ app \ cms \ edit.php中調用,並在C中定義:\ xampp \ htdocs \ PassieCMS \ app \ core \ models \ m_template.php on line 87

注意:未定義變量:輸入C:\ xampp \ htdocs \ PassieCMS \ app \ core \ models \ m_template.php線89

這裏的2個文件的代碼

編輯頁面:

<?php 

include("../init.php"); 

if(isset($_POST['field'])) 
{ 

} 
else 
{ 
    if(isset($_GET['id']) == FALSE || isset($_GET['type']) == FALSE) 
    { 
     $FP->Template->error(); 
     exit; 
    } 

    $id = $FP->Cms->clean_block_id($_GET['id']); 
    $type = htmlentities($_GET['type'], ENT_QUOTES); 

    $content = 'Conent here'; 

    $FP->Template->setData('block_id', $id); 
    $FP->Template->setData('block_type', $type); 
    $FP->Template->setData('cms_field', $FP->Cms->generate_field($type, $content), false); 

    //load view 
    $FP->Template->load(APP_PATH . 'cms/views/v_edit.php'); 

} 

的m_template頁面

+0

一個$類型參數是強制性的錯誤( )方法在您的模板類;你沒有任何參數調用它:'$ FP-> Template-> error();' –

+0

你有一個例子嗎?所以我可以看到你的意思 – user2619538

+0

'$ FP-> Template-> error('THIS IS A TYPE');'或'$ FP-> Template-> error('unauthorized');' –

回答

0

你需要一個變量來傳遞給你的錯誤()函數中class Template定義:

function error($type){ ... } 
+0

你有沒有一個例子?所以我可以看到你的意思 – user2619538

+0

我認爲馬克貝克的評論應該爲你工作:$ FP-> Template-> error('unauthorized'); –