This code will render a straightforward html link on your page, so if it is 
part of a div or other element, then the appropriate <a> CSS style will apply 
to it. If you want to specify the id, name or class of the link, then put it in 
the $htmlAttributes array:

Syntax: link(
        string $title,
        mixed $url = null,
        array $htmlAttributes = array(),
        string $confirmMessage = false
)

So your example would look something like this:

echo $html->link(
        'Search',
        array(
                'controller' => $this->params['controller'],
                'action'=>'search'
        ),
        array(
                'class' => 'my-class',
                'id' => 'myId',
                'name' => 'myName'
        )
);

http://book.cakephp.org/view/1442/link

As an aside, you don't need to use $this->params['controller']. By default, 
Cake will use the current controller when building the link.

Jeremy Burns
[email protected]


On 12 May 2010, at 12:11, Dilip Godhani wrote:

> how i appply css on link  tag
> in cakephp
> 
> <?php echo 
> $html->link('Search',array('controller'=>$this->params['controller'],'action'=>'search'));
>  ?>
> Help me
> 
> Thanks
> 
> -- 
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: [email protected]
>           [email protected]
> Web.: www.entouragesolutions.com
> m. 9913822582
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>  
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected]
> 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

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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

Reply via email to