2012-07-02 68 views
0

我烘焙了一個模型,控制器,通過控制檯查看。 然後我改變了View/xxx/index.ctp的內容,但是這些改變沒有被統一到網頁上。蛋糕視圖不會更新時更改

任何想法可能是錯誤的?

編輯:沒有使用


查看/日誌/ index.ctp

<div class="logs index"> 
    <h2><?php echo __('SystemLogs');?></h2> 
    <table cellpadding="0" cellspacing="0"> 
    <tr>  
      <th><?php echo $this->Paginator->sort('isError');?></th> 
      <th><?php echo $this->Paginator->sort('id');?></th> 
      <th><?php echo $this->Paginator->sort('timestamp');?></th> 
      <th><?php echo $this->Paginator->sort('category');?></th> 
      <th><?php echo $this->Paginator->sort('action');?></th> 
      <th><?php echo $this->Paginator->sort('detail');?></th> 

    </tr> 
    <?php 

    foreach ($logs as $log): ?> 
    <tr> 
     <td> 
      <?php 
      if (($log['Log']['isError'] == 1){ 
       echo h("ERR"); 
      }else{ 
       echo h("NFO"); 
      } 

     ?>&nbsp; </td> 

     <td><?php echo h($log['Log']['id']); ?>&nbsp;</td> 
     <td><?php echo h($log['Log']['timestamp']); ?>&nbsp;</td> 
     <td><?php echo h($log['Log']['category']); ?>&nbsp;</td> 
     <td><?php echo h($log['Log']['action']); ?>&nbsp;</td> 
     <td><?php echo h($log['Log']['detail']); ?>&nbsp; <br> 
      (User: <?php echo h($log['Log']['userID']); ?>)<br> 
      (PersID: <?php echo h($log['Log']['PersonalID']); ?>) 
     </td> 

    </tr> 
<?php endforeach; ?> 
    </table> 
    <p> 
    <?php 
    echo $this->Paginator->counter(array(
    'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') 
    )); 
    ?> </p> 

    <div class="paging"> 
    <?php 
     echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); 
     echo $this->Paginator->numbers(array('separator' => '')); 
     echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled')); 
    ?> 
    </div> 
</div> 

型號緩存/ Log.php

<?php 
App::uses('AppModel', 'Model'); 
/** 
* Log Model 
* 
*/ 
class Log extends AppModel { 
/** 
* Display field 
* 
* @var string 
*/ 

    var $order = "Log.timestamp desc"; 
    public $displayField = 'detail'; 
} 

控制器/ LogsController.php

<?php 
App::uses('AppController', 'Controller'); 
/** 
* Logs Controller 
* 
*/ 

class LogsController extends AppController { 

/** 
* Scaffold 
* 
* @var mixed 
*/ 
    var $name = "Logs"; 
    public $scaffold; 


} 
+0

你使用緩存嗎? – 472084

+0

沒有看到代碼,這是很難說..也許編輯這包括相關的位?否則這很可能會很快關閉。 –

+0

index.ctp的內容將不會顯示 –

回答

1

你不必裏面LogsControllerindex()行動。

您可以創建一個這樣的:

public function index() { 
    $this->Log->recursive = 0; 
    $this->set('logs', $this->paginate()); 
} 
1

取出public $scaffold;線的更改將會生效。腳手架意味着蛋糕將爲您生成代碼。