Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cakephp 蛋糕视图在更改时不会更新_Cakephp_Code Generation - Fatal编程技术网

Cakephp 蛋糕视图在更改时不会更新

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"> <

我通过控制台烘焙了一个模型、控制器和视图。 然后,我更改了View/xxx/index.ctp的内容,但这些更改不会显示在网页上

你知道会出什么问题吗

编辑:未使用缓存


查看/日志/索引.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>
<?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());
}