CakePHP将列添加到表中

vet*_*982 3 php sql frameworks cakephp

我的蛋糕应用程序中有一个Profile模型/控制器,以及/ views/profiles中的index.ctp视图.现在,当我向我的表中添加一个已填充数据的列,然后将相应的代码添加到视图中以获取此列的数据时,它只是给我一个空结果.

我的模特:

<?php
        class Profile extends AppModel
        {
                var $name = 'Profile';
        }

?>
Run Code Online (Sandbox Code Playgroud)

我的控制器:

<?php
        class ProfilesController extends AppController
        {
                var $name = 'Profiles';
                function index()
                {
                        $this->set('profiles', $this->Profile->find('all'));
                }
        }
?>
Run Code Online (Sandbox Code Playgroud)

我的观点打印(剥离):

<?php foreach ($profiles as $profile): ?>

<?php echo $profile['Profile']['id']; ?>
<?php echo $profile['Profile']['username']; ?>
<?php echo $profile['Profile']['created']; ?>
<?php echo $profile['Profile']['thumbnail'];?>
<?php echo $profile['Profile']['account'];?>

<?php endforeach; ?>
Run Code Online (Sandbox Code Playgroud)

基本上,columns id, username, column, thumbnail总是打印得很好,但是当我添加一个名为account它的列时,它不返回任何信息(没有打印,但没有错误).有什么建议?

dho*_*tet 9

我会删除文件app/tmp/cache(但保留目录).