小编Dou*_*ura的帖子

CakePHP $ this-> set()在Pages Controller中不起作用

我正在使用CakePHP进行开发,这是我的页面控制器:

<?php
class PagesController extends AppController
{
    var $name = 'Pages';
    var $helpers = array('Html', 'Session');
    var $uses = array();

    function display()
    {
        $path = func_get_args();

        $count = count($path);
        if (!$count) {
            $this->redirect('/');
        }
        $page = $subpage = $title_for_layout = null;

        if (!empty($path[0])) {
            $page = $path[0];
        }
        if (!empty($path[1])) {
            $subpage = $path[1];
        }
        if (!empty($path[$count - 1])) {
            $title_for_layout = Inflector::humanize($path[$count - 1]);
        }
        $this->set(compact('page', 'subpage', 'title_for_layout'));
        $this->render(implode('/', $path));

        $this->loadModel('Curso', 2);

        $select = $this->Curso->query("SELECT * FROM cursos ORDER …
Run Code Online (Sandbox Code Playgroud)

php cakephp

1
推荐指数
1
解决办法
2855
查看次数

标签 统计

cakephp ×1

php ×1