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:
>
> >
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
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';
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
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
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
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
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
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