Tuesday, July 3, 2012

Re: Why using HTML->link instead of manually writing an anchor text ?

On Sun, Jul 1, 2012 at 5:12 AM, rchavik <rchavik@gmail.com> wrote:
>
>
> On Sunday, July 1, 2012 8:38:36 AM UTC+7, Marcelo Custódio wrote:
>>
>> Isn't it much slower concerning development time ?
>>
>> What are the advantages of of HTML->link ?
>
>
> It understands your routes.

++ on that. If the client suddenly wants "posts" to be "blog" in the
URL one need only change the route file.

As for development time, I personally don't find that it takes me much
longer at all. And it also helps to keep clear what a given link is
all about, both for my own sanity and any future developer who might
come across it. Which controller? Which view? Admin or not? etc.

And the extra hit with having the helper create the link is minimal if
you're using a cache. I had the same reservations when I first began
with Cake but I now embrace Html::link().

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: