Cakephp 蛋糕视图在更改时不会更新
我通过控制台烘焙了一个模型、控制器和视图。 然后,我更改了View/xxx/index.ctp的内容,但这些更改不会显示在网页上 你知道会出什么问题吗 编辑:未使用缓存Cakephp 蛋糕视图在更改时不会更新,cakephp,code-generation,Cakephp,Code Generation,我通过控制台烘焙了一个模型、控制器和视图。 然后,我更改了View/xxx/index.ctp的内容,但这些更改不会显示在网页上 你知道会出什么问题吗 编辑:未使用缓存 查看/日志/索引.ctp <div class="logs index"> <h2><?php echo __('SystemLogs');?></h2> <table cellpadding="0" cellspacing="0"> <
查看/日志/索引.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");
}
?> </td>
<td><?php echo h($log['Log']['id']); ?> </td>
<td><?php echo h($log['Log']['timestamp']); ?> </td>
<td><?php echo h($log['Log']['category']); ?> </td>
<td><?php echo h($log['Log']['action']); ?> </td>
<td><?php echo h($log['Log']['detail']); ?> <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>
<?php
App::uses('AppController', 'Controller');
/**
* Logs Controller
*
*/
class LogsController extends AppController {
/**
* Scaffold
*
* @var mixed
*/
var $name = "Logs";
public $scaffold;
}
在logscocontroller
中没有index()
操作
您可以创建一个类似于:
public function index() {
$this->Log->recursive = 0;
$this->set('logs', $this->paginate());
}
拆除public$scaffold代码>行,您的更改将生效。脚手架意味着cake将为您生成代码。如果看不到代码,很难说。。也许可以编辑此文件以包含相关位?否则可能会很快关闭。不会显示index.ctp的内容
public function index() {
$this->Log->recursive = 0;
$this->set('logs', $this->paginate());
}