Quantcast

How i Give Css on link

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How i Give Css on link

Dilip Godhani
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: [hidden email]
          [hidden email]
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 [hidden email]
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How i Give Css on link

Jeremy Burns
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'
)
);


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


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: [hidden email]
          [hidden email]
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 [hidden email]
To unsubscribe from this group, send email to
[hidden email] 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 [hidden email]
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How i Give Css on link

Sam Sherlock
In reply to this post by Dilip Godhani
do you mean give a link a class or id attribute?

pass your attribs to the options param of HtmlHelper link

echo $html->link('Search',array('action'=>'search'), array('class' => 'supaSearch', 'id' => 'supaSearch'));

also if your accessing an action of the current controller you dont need to pass $this->params['controller'] 

- S



On 12 May 2010 12:11, Dilip Godhani <[hidden email]> 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: [hidden email]
          [hidden email]
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 [hidden email]
To unsubscribe from this group, send email to
[hidden email] 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 [hidden email]
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How i Give Css on link

Jeremy Burns
Spooky...

Jeremy Burns


On 12 May 2010, at 14:24, Sam Sherlock wrote:

do you mean give a link a class or id attribute?

pass your attribs to the options param of HtmlHelper link

echo $html->link('Search',array('action'=>'search'), array('class' => 'supaSearch', 'id' => 'supaSearch'));

also if your accessing an action of the current controller you dont need to pass $this->params['controller'] 

- S



On 12 May 2010 12:11, Dilip Godhani <[hidden email]> 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: [hidden email]
          [hidden email]
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 [hidden email]
To unsubscribe from this group, send email to
[hidden email] 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 [hidden email]
To unsubscribe from this group, send email to
[hidden email] 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 [hidden email]
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Loading...