Welcome Guest, Not a member yet? Register   Sign In
anchor, and other helper, formatting issue
#1

[eluser]searain[/eluser]
For example, anchor will create a standard HTML anchor link based on your local site URL:

How do I format the "HTML anchor link" anchor() created?

Use CSS, and use the anchor(uri segments, text, attributes)'s attributes?

Pass the attributes to create certain "HTML anchor link", and define the CSS for the certain anchor attributes passed?
#2

[eluser]Thorpe Obazee[/eluser]
[quote author="blackhorse66" date="1245111158"]For example, anchor will create a standard HTML anchor link based on your local site URL:

How do I format the "HTML anchor link" anchor() created?

Use CSS, and use the anchor(uri segments, text, attributes)'s attributes?

Pass the attributes to create certain "HTML anchor link", and define the CSS for the certain anchor attributes passed?[/quote]

what do you mean by 'format'?
#3

[eluser]gtech[/eluser]
I assume you want to apply css attribute to an anchor link

you can do so as follows

view:
Code:
<?=anchor('news/local/123', 'My News',array('class'=>'css_class'));?>

this will produce
Code:
<a href="http://localhost/dial/index.php/news/local/123" class="css_class">My News</a>

this means you can use the css_class attribute in your css definition, to modify the anchor style.
#4

[eluser]Thorpe Obazee[/eluser]
I assumed it would be something that's not already in the user_guide :down:
#5

[eluser]metaltapimenye[/eluser]
yes its there already. discussing 'attributes' 3rd param at anchor function.

the 3rd param in this function will associate any key in array to its value

in short hand:
Code:
&lt;?=anchor('news/local/123', 'My News',array('sinatra'=>'oldies_song'));?&gt;
will produce:
Code:
<a href="http://localhost/dial/index.php/news/local/123" sinatra="oldies_song">My News</a>
#6

[eluser]Juan Velandia[/eluser]
Thanks guys, exactly what i was looking for
#7

[eluser]InsiteFX[/eluser]
I would stop using short php tags they are depreciated!

Enjoy
InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB