I've never seen this before, but just has a quick check of the code base, 
and there it is. Awesome!

When you define your usage of the HtmlHelper, you can set the config file 
to use there.

CakePHP will include the HtmlHelper by default, but since you want to 
override it, you can do so in your AppController.

   public $helpers = array('Html' => array('configFile' => 'html5_tags'));

If you have more default helpers, you can add them there as well, (like 
Form, etc).

This should mean that all usage of the Html helper will use your 
app/Config/html5_tags.php file.

You'd only use $this->Html->loadConfig('html5_tags'); in the view templates 
of particular pages that are to use those tags, when everywhere else would 
use the default that comes with CakePHP.

Regards
Reuben Helms

On Wednesday, 5 December 2012 07:21:31 UTC+10, Novrian YF wrote:
>
> Hi all,
>
> According to the book, In order to override HtmlHelper Tags, we have to 
> create html5_tags.php and put it in app/Config/html5_tags.php. The book 
> also said you can then load the Config with $this->Html->loadConfig();
>
> The question is, where I should put those code in order to make my custom 
> Tags available to all view??
>
> Thanks in advance
>
> Regards,
> Novrian
>

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to