Re: Page titles that read well

2008-06-10 Thread Smelly_Eddie
Duh.. I should have thought about that a little longer... Thanks for the tip Andrew! On Jun 10, 11:19 am, Andrew Assarattanakul <[EMAIL PROTECTED]> wrote: > Try using Inflector::humanize(Inflector::underscore($this->name)) > > On Jun 10, 10:10 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote: > > >

Re: Page titles that read well

2008-06-10 Thread Andrew Assarattanakul
Try using Inflector::humanize(Inflector::underscore($this->name)) On Jun 10, 10:10 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote: > Ok I am trying thr humanize method, and have some troubles.. > > My new model > > class CustomerProductReview extends AppModel > { >     var $name = 'CustomerProductRev

Re: Page titles that read well

2008-06-10 Thread Smelly_Eddie
Ok I am trying thr humanize method, and have some troubles.. My new model class CustomerProductReview extends AppModel { var $name = 'CustomerProductReview'; } My new controller class CustomerProductReviewsController extends AppController { var $name = 'CustomerProductReviews';

Re: Page titles that read well

2008-06-10 Thread Smelly_Eddie
Thank you! Silly typos always get me down. Adding the actions is a great idea. I think I may update my models to fix the inflections issue. Thanks again! On Jun 10, 9:37 am, grigri <[EMAIL PROTECTED]> wrote: > It works fine; looks like your variables are mixed-up. > > You've got `var $friendl

Re: Page titles that read well

2008-06-10 Thread grigri
It works fine; looks like your variables are mixed-up. You've got `var $friendlyName=...` in the model and `$model- >friendlyDisplay` in the controller. If this *still* doesn't work, try using `$this->{$this->modelClass}- >name` first: [1] $friendlyName does not work, $name does : variable name

Re: Page titles that read well

2008-06-10 Thread the_woodsman
Erm, friendlyDisplay versus friendlyName? Of course, if your models were mixed / camel case, you could just use the inflector and php functions to achieve this... :) Personally, I think it's okay to let the controller attempt this bit of view logic, seeing as the views can override it if they ha

Re: Page titles that read well

2008-06-10 Thread Smelly_Eddie
Doesnt seem to work My controller class CustomerproductreviewsController extends AppController { var $name = 'Customerproductreviews'; var $uses = array('Customerproductreview', 'Product', 'Rating','User'); var $helpers = array('Html', 'Form','Pagination','Ajax','Fl

Re: Page titles that read well

2008-06-10 Thread grigri
class Pie extends AppModel { var $friendlyName = 'A tasty treat!'; var $actsAs = array('Tasty'); // Optional } class AppController extends Controller { function beforeFilter() { if (!empty($this->modelClass)) { $this->set('title', $this->{$this->modelClass}->friendlyName . ' - fo

Page titles that read well

2008-06-10 Thread Smelly_Eddie
I have always used the function below in my controllers to set the page's title. function beforeFilter(){ $this->pageTitle= $this->name.' - .:: The GreenLife List ::. '; } The problem is that some model names are concatenated due to their HABTM nature, like "customerproductreview