Re: Why is this better?
Yip, it's all about using wrapper functions so when you want to suddenly treat those tags differently you change one function and that function instantly starts doing as you want. It's all about tradeofffs - if you believe that tag and your routes are never going to change then hard coding a tags may be a good solution, for now I stick with Html::link() [mostly] HTH, Paul @phpMagpie On Sep 12, 11:23 am, Zaky Katalan-Ezra procsh...@gmail.com wrote: Theoretically if the a tag spec will change you will be able to change it in one place. For example if you used embed or object tag and you want to change this to audio tag to be more html5 On Sun, Sep 11, 2011 at 10:42 PM, Miles J mileswjohn...@gmail.com wrote: I actually posted a blog post about this: http://milesj.me/blog/read/end-html-helper On Sep 11, 1:28 am, elija elijatheg...@gmail.com wrote: Thank you. That makes sense and now I don't have to learn it the hard way. On Sep 11, 8:30 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Sep 11, 2011, at 02:29, elija wrote: Yes it is readable and concise but a simple a href=. is even easier to read and doesn't use PHP to generate a link. What I was actually wondering was is there any advantage in CakePHP to using the HTML Helper rather than just writing HTML in a view? The advantage of using PHP to generate the links is that if you change how your routes are arranged, you don't then also have to update all your links in your views. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Regards, Zaky Katalan-Ezra QA Administratorwww.IGeneriX.com Sites.IGeneriX.com 054-7762312 -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Why is this better?
Theoretically if the a tag spec will change you will be able to change it in one place. For example if you used embed or object tag and you want to change this to audio tag to be more html5 On Sun, Sep 11, 2011 at 10:42 PM, Miles J mileswjohn...@gmail.com wrote: I actually posted a blog post about this: http://milesj.me/blog/read/end-html-helper On Sep 11, 1:28 am, elija elijatheg...@gmail.com wrote: Thank you. That makes sense and now I don't have to learn it the hard way. On Sep 11, 8:30 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Sep 11, 2011, at 02:29, elija wrote: Yes it is readable and concise but a simple a href=. is even easier to read and doesn't use PHP to generate a link. What I was actually wondering was is there any advantage in CakePHP to using the HTML Helper rather than just writing HTML in a view? The advantage of using PHP to generate the links is that if you change how your routes are arranged, you don't then also have to update all your links in your views. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Regards, Zaky Katalan-Ezra QA Administrator www.IGeneriX.com Sites.IGeneriX.com 054-7762312 -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Why is this better?
But using php to generate link is slower to render a page, because php has to process the code unlike a html element. Of course it's not noticeable unless under very high load. Thank you, -Alex Goretoy On Sat, Sep 10, 2011 at 9:22 PM, Sam Sherlock sam.sherl...@gmail.comwrote: its a balance; the code you posted is readable and concise making links elements generally will add complexity to the simple and common (and varied task) of adding links when your link element has the ability to handle the various options it will be quite complex and the code will be less readable and also harder to adjust (the code to putput the link is going to be about the same). Plus it add no real advantage when you have a generic nature to a block of markup and vary parts within eg a piece of gallery content that contains a few divs and a h3 and a link with and image - S On 10 September 2011 13:12, elija elijatheg...@gmail.com wrote: I'm going through the blog tutorial and have found myself wondering why ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post'] ['id'])); ? is better than writing an a element? -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Why is this better?
Yes it is readable and concise but a simple a href=. is even easier to read and doesn't use PHP to generate a link. What I was actually wondering was is there any advantage in CakePHP to using the HTML Helper rather than just writing HTML in a view? Having re-read my question, I realise that I was incredibly unclear. On Sep 11, 3:22 am, Sam Sherlock sam.sherl...@gmail.com wrote: its a balance; the code you posted is readable and concise making links elements generally will add complexity to the simple and common (and varied task) of adding links when your link element has the ability to handle the various options it will be quite complex and the code will be less readable and also harder to adjust (the code to putput the link is going to be about the same). Plus it add no real advantage when you have a generic nature to a block of markup and vary parts within eg a piece of gallery content that contains a few divs and a h3 and a link with and image - S On 10 September 2011 13:12, elija elijatheg...@gmail.com wrote: I'm going through the blog tutorial and have found myself wondering why ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post'] ['id'])); ? is better than writing an a element? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Why is this better?
On Sep 11, 2011, at 02:29, elija wrote: Yes it is readable and concise but a simple a href=. is even easier to read and doesn't use PHP to generate a link. What I was actually wondering was is there any advantage in CakePHP to using the HTML Helper rather than just writing HTML in a view? The advantage of using PHP to generate the links is that if you change how your routes are arranged, you don't then also have to update all your links in your views. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Why is this better?
But using php to generate link is slower to render a page actually its not notically at all - even under heavy load. the important fact is how MANY links there are on a single page. this will decide the page load. so as long as you dont need to output 1000 links you will be fine. On 11 Sep., 09:30, Ryan Schmidt google-2...@ryandesign.com wrote: On Sep 11, 2011, at 02:29, elija wrote: Yes it is readable and concise but a simple a href=. is even easier to read and doesn't use PHP to generate a link. What I was actually wondering was is there any advantage in CakePHP to using the HTML Helper rather than just writing HTML in a view? The advantage of using PHP to generate the links is that if you change how your routes are arranged, you don't then also have to update all your links in your views. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Why is this better?
Thank you. That makes sense and now I don't have to learn it the hard way. On Sep 11, 8:30 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Sep 11, 2011, at 02:29, elija wrote: Yes it is readable and concise but a simple a href=. is even easier to read and doesn't use PHP to generate a link. What I was actually wondering was is there any advantage in CakePHP to using the HTML Helper rather than just writing HTML in a view? The advantage of using PHP to generate the links is that if you change how your routes are arranged, you don't then also have to update all your links in your views. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Why is this better?
I actually posted a blog post about this: http://milesj.me/blog/read/end-html-helper On Sep 11, 1:28 am, elija elijatheg...@gmail.com wrote: Thank you. That makes sense and now I don't have to learn it the hard way. On Sep 11, 8:30 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Sep 11, 2011, at 02:29, elija wrote: Yes it is readable and concise but a simple a href=. is even easier to read and doesn't use PHP to generate a link. What I was actually wondering was is there any advantage in CakePHP to using the HTML Helper rather than just writing HTML in a view? The advantage of using PHP to generate the links is that if you change how your routes are arranged, you don't then also have to update all your links in your views. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Why is this better?
I'm going through the blog tutorial and have found myself wondering why ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post'] ['id'])); ? is better than writing an a element? -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Why is this better?
its a balance; the code you posted is readable and concise making links elements generally will add complexity to the simple and common (and varied task) of adding links when your link element has the ability to handle the various options it will be quite complex and the code will be less readable and also harder to adjust (the code to putput the link is going to be about the same). Plus it add no real advantage when you have a generic nature to a block of markup and vary parts within eg a piece of gallery content that contains a few divs and a h3 and a link with and image - S On 10 September 2011 13:12, elija elijatheg...@gmail.com wrote: I'm going through the blog tutorial and have found myself wondering why ?php echo $this-Html-link($post['Post']['title'], array('controller' = 'posts', 'action' = 'view', $post['Post'] ['id'])); ? is better than writing an a element? -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php