Monday, May 31, 2010

$pageTitle not working

Hello all

I just started with CakePHP 1.3.1. I am trying to set the title of a
page. I have defined the title_for_layout in the default layout as
well, still the view does not get the title I want. Instead it
displays the name of controller. Although setting the title_for_layout
in the view template works fine. Here's what I am doing....

// /app/controllers/nodes_controller.php
class NodesController {
$name = "Nodes";
$uses = array();
$helpers = array( "Html" );
function index() {
$this->pageTitle = "First Page"; // This does not work
}
}

// /app/views/nodes/index.ctp
<php $this->set( "title_for_layout", "First Page" ); // This works ?>

What am I doing wrong here? Can somebody help me out.

Thanks and Regards
ShiVik

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: