html->link() and html tags

View: New views
4 Messages — Rating Filter:   Alert me  

html->link() and html tags

by kicaj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I must build link like this:
<a href="#"><span>text</span></a>
How?

I using: $html->link('<span>'. __('text', true) .'</span>'), '#'); but
this is not works!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: html->link() and html tags

by John Andersen-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Add array('escape'=>false) to your link, so that your html code
<span></span> is not turned into html entities

If it doesn't help, please show the html of your created link!

Enjoy,
   John

On Nov 4, 12:23 pm, kicaj <ki...@...> wrote:
> I must build link like this:
> <a href="#"><span>text</span></a>
> How?
>
> I using: $html->link('<span>'. __('text', true) .'</span>'), '#'); but
> this is not works!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: html->link() and html tags

by Alexandru Ciobanu-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 11/4/2009 12:23 PM, kicaj wrote:
> $html->link('<span>'. __('text', true) .'</span>'), '#');
- you're not echoing this;
- you have a syntax error there;
- you're escaping the link title;

For CakePHP 1.2 use:
echo $html->link('<span>'. __('text', true) .'</span>', '#', array(),
false, false);

For CakePHP 1.3 use:
echo $html->link('<span>'. __('text', true) .'</span>', '#',
array('escape' => false), false);

http://api.cakephp.org/class/html-helper#method-HtmlHelperlink

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


Re: html->link() and html tags

by kicaj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks guys!

On Nov 4, 11:41 am, Alexandru Ciobanu <ics.cake...@...> wrote:

> On 11/4/2009 12:23 PM, kicaj wrote:> $html->link('<span>'. __('text', true) .'</span>'), '#');
>
> - you're not echoing this;
> - you have a syntax error there;
> - you're escaping the link title;
>
> For CakePHP 1.2 use:
> echo $html->link('<span>'. __('text', true) .'</span>', '#', array(),
> false, false);
>
> For CakePHP 1.3 use:
> echo $html->link('<span>'. __('text', true) .'</span>', '#',
> array('escape' => false), false);
>
> http://api.cakephp.org/class/html-helper#method-HtmlHelperlink
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---