Thursday, August 28, 2014

Re: Get controller name on layout file - CakePHP3

you have to look in `$this->request` instead


On 28 Aug 2014, at 14:35, Jipson Thomas <jipson@strategic-ic.co.uk> wrote:

Hi,
In my Cakephp 3 project on the layout file, I want to set menu classes based on the current controller name. After a search I tried to get it through the following command on my layout.ctp file
<?php echo $this->params['controller']; ?>

But it throughs me an error as following
Error: paramsHelper could not be found.
Error: Create the class paramsHelper below in file: src/View/Helper/paramsHelper.php

Does anyone know any fix for this?

Regards,
Jipson


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: