Welcome Guest, Not a member yet? Register   Sign In
Do you mainly use anchor() or <a> html tag?
#1

[eluser]keld[/eluser]
I find it rather annoying using the anchor() rather than the html <a> tag, how about you?
anchor makes the view much harder to read, specially when you have complicated urls with lots of variable and you want to add titles, classes ect to it.
Also you can't embed images in a anchor tag, which is a main problem, unless you use a custom helper but so far I haven't found any that suit my needs.
I'll be interested to have other opinions.
Thank you.
#2

[eluser]ShiverCube[/eluser]
I always try and use the helper functions whenever possible. It allows further extensibility down the track. Phil Sturgeon has also written about why they are so useful. As an example, I've previously extended the anchor function so that it will automatically add a 'rel="external nofollow"' tag to any external links automatically.

Where the anchor function does currently fail, as you noted, is with embedding images. Personally I would try and extend the function to implement the required capability so that my view files are remain consistent and can be more easily maintained.
#3

[eluser]markup2go[/eluser]
Could you not do something like this?

Code:
&lt;?php echo anchor('some/where', img('assets/images/products/5382.jpg'), array('class'=>'someclass', 'title'=>'sometitle')); ?&gt;




Theme © iAndrew 2016 - Forum software by © MyBB