Скач от
Скач от

Reputation: 212

Override HtmlHelper :: link() function

If there's a better way to achieve what I want to do, please point that out.

I have a multilingual application in CakePHP, and I want to keep the language parameter in each page. What I want to do, is to override the default link function to put a language parameter on each link, unless the language parameter is specified in the input array. I know how to do this, I just need the instructions on how to override the class so I don't have to change my code in lower levels.

Upvotes: 2

Views: 247

Answers (1)

mark
mark

Reputation: 21743

Extend your HtmlHelper as MyHtmlHelper and use aliasing to map it back to Html namespace: http://book.cakephp.org/2.0/en/views/helpers.html#using-and-configuring-helpers

Upvotes: 3

Related Questions