Adding CSS class to HTML link helper

2008-06-15 Thread BeroFX

So, I baked some views and looking at the code you get:

?php echo $html-link(__('Edit', true), array('action'='edit',
$bookmark['Bookmark']['id'])); ?

Which prints out an Edit link. How do I add a CSS class to this so I
can have a little icon next to the text?

note: I have the css code.

Also, can anyone explain __('Edit', true)? I know it prints out
Edit, and true is to make it a link.
But __() part I don't get.

I did Google it, but there isn't any good explanation :(

Thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Adding CSS class to HTML link helper

2008-06-15 Thread David C. Zentgraf

The __() function is a translation helper function which looks up the  
word/phrase in localization files. Look at the i18n section of the  
cookbook... Usually that function echos the result directly into your  
page, passing it the second argument TRUE makes it return the value  
instead (so you can use it in other functions).

h1?php __('My Headline'); ?/h1
?php echo formatOutput(__('Some string', true)); ?

http://book.cakephp.org/view/120/global-constants-and-functions

Extra stuff for the link helper goes into the third argument:

?php echo $html-link(__('Edit', true), array('action'='edit',  
$bookmark['Bookmark']['id']), array('class' = 'myClass')); ?

As always, the API Docs are your friend.
http://api.cakephp.org/1.2/class_html_helper.html#71ff7f331b08318bc867a4d9057b7d9f

On 15 Jun 2008, at 22:00, BeroFX wrote:


 So, I baked some views and looking at the code you get:

 ?php echo $html-link(__('Edit', true), array('action'='edit',
 $bookmark['Bookmark']['id'])); ?

 Which prints out an Edit link. How do I add a CSS class to this so I
 can have a little icon next to the text?

 note: I have the css code.

 Also, can anyone explain __('Edit', true)? I know it prints out
 Edit, and true is to make it a link.
 But __() part I don't get.

 I did Google it, but there isn't any good explanation :(

 Thanks!


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---