开发者

CakePHP title_for_layout

开发者 https://www.devze.com 2023-03-04 00:21 出处:网络
I have this function: function view ( $id ) { $this->layout = \'page\'; $this->User->id = $id; $this->set(\'title_for_layout\', $username);

I have this function:

function view ( $id )
{
    $this->layout = 'page';

    $this->User->id = $id;

    $this->set('title_for_layout', $username);

    $this->set('users', $this->User->read());
}

What I want to do is show开发者_运维技巧 the username as the title but the current code I have doesn't do this... how do I do it?


$this->User->id = $id;
$this->set('title_for_layout', $this->User->field('username'));


function view ( $id )
{
$this->layout = 'page';

$this->User->id = $id;

$this->set('title_for_layout',  $this->User->field('username'));

$this->set('users', $this->User->read());
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号