OK, so I'm trying to teach myself the CakePHP framework, and I'm trying to get a simple demo application for myself for myself.
I have controllers, views, and models, all configured and working, but I want to do something a little more than the basic online help shows.
I have a guitars_controller.php file as follows:
<?php class GuitarsController extends AppController { var $name = 'Guitars'; function index() { $this->set('Guitars', $this->Guitar->findAll()); $this->pageTitle = "All Guitars"; } function view($id = null) { $this->Guitar->id = $id; $this->set('guitar', $this->Guitar->read());
The Guitar object contains the Name attribute, and I would like to be able to set it as pageTitle for individual page views.
Can someone please indicate how I will do this?
NB . I know that there is a general disagreement with where in the application to set such data, but for me it is connected with the data.
source share