Re: Add class to active links

2012-02-29 Thread jeremyharris
Or ternary!

$class = $active ? 'active' : null;

On Wednesday, February 29, 2012 1:07:08 AM UTC-8, euromark wrote:
>
> just use conditions then 
>
> if ($condition) {} else {} 
>
> basic PHP one-o-one 
>
>
> On 29 Feb., 09:56, Kiran Ambati  wrote: 
> > Hi stephen, 
> > 
> > I want add class to only when URl is active. If we add class in options 
> > array it will be for every time. I want it for only atcive pages 
> > 
> > Thanks, 
> > kiran 
> > 
> > On Wed, Feb 29, 2012 at 1:35 PM, Stephen Speakman < 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > step...@ninjacodermonkey.co.uk> wrote: 
> > > In the options array add 'class' => 'myclass' 
> > 
> > > Echo $this->Html->link('my link', array('controller' => 'users', 
> 'action' 
> > > => 'index'), array('class' => 'mylink')); 
> > 
> > > If my memory serves me correctly that is 
> > 
> > > Sent from my iPhone 
> > 
> > > On 29 Feb 2012, at 07:48, Kiran Ambati  wrote: 
> > 
> > > Hi 
> > 
> > > I am using cakphp 'link' to generate anchor tags. Now i awnt to add a 
> > > class to active links to apply some styling to those links. Is there a 
> way 
> > > to that. 
> > 
> > > -- 
> > > *Thank you,* 
> > > *Kiran.* 
> > 
> > >  -- 
> > > Our newest site for the community: CakePHP Video Tutorials 
> > > http://tv.cakephp.org 
> > > Check out the new CakePHP Questions site  
> > >http://ask.cakephp.organd help others with their CakePHP related 
> > > questions. 
> > 
> > > To unsubscribe from this group, send email to 
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> group 
> > > at  
> > >http://groups.google.com/group/cake-php 
> > 
> > >  -- 
> > > Our newest site for the community: CakePHP Video Tutorials 
> > >http://tv.cakephp.org 
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > > others with their CakePHP related questions. 
> > 
> > > To unsubscribe from this group, send email to 
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> group 
> > > athttp://groups.google.com/group/cake-php 
> > 
> > -- 
> > *Thank you,* 
> > *Kiran.*


On Wednesday, February 29, 2012 1:07:08 AM UTC-8, euromark wrote:
>
> just use conditions then 
>
> if ($condition) {} else {} 
>
> basic PHP one-o-one 
>
>
> On 29 Feb., 09:56, Kiran Ambati  wrote: 
> > Hi stephen, 
> > 
> > I want add class to only when URl is active. If we add class in options 
> > array it will be for every time. I want it for only atcive pages 
> > 
> > Thanks, 
> > kiran 
> > 
> > On Wed, Feb 29, 2012 at 1:35 PM, Stephen Speakman < 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > step...@ninjacodermonkey.co.uk> wrote: 
> > > In the options array add 'class' => 'myclass' 
> > 
> > > Echo $this->Html->link('my link', array('controller' => 'users', 
> 'action' 
> > > => 'index'), array('class' => 'mylink')); 
> > 
> > > If my memory serves me correctly that is 
> > 
> > > Sent from my iPhone 
> > 
> > > On 29 Feb 2012, at 07:48, Kiran Ambati  wrote: 
> > 
> > > Hi 
> > 
> > > I am using cakphp 'link' to generate anchor tags. Now i awnt to add a 
> > > class to active links to apply some styling to those links. Is there a 
> way 
> > > to that. 
> > 
> > > -- 
> > > *Thank you,* 
> > > *Kiran.* 
> > 
> > >  -- 
> > > Our newest site for the community: CakePHP Video Tutorials 
> > > http://tv.cakephp.org 
> > > Check out the new CakePHP Questions site  
> > >http://ask.cakephp.organd help others with their CakePHP related 
> > > questions. 
> > 
> > > To unsubscribe from this group, send email to 
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> group 
> > > at  
> > >http://groups.google.com/group/cake-php 
> > 
> > >  -- 
> > > Our newest site for the community: CakePHP Video Tutorials 
> > >http://tv.cakephp.org 
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > > others with their CakePHP related questions. 
> > 
> > > To unsubscribe from this group, send email to 
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> group 
> > > athttp://groups.google.com/group/cake-php 
> > 
> > -- 
> > *Thank you,* 
> > *Kiran.*


On Wednesday, February 29, 2012 1:07:08 AM UTC-8, euromark wrote:
>
> just use conditions then 
>
> if ($condition) {} else {} 
>
> basic PHP one-o-one 
>
>
> On 29 Feb., 09:56, Kiran Ambati  wrote: 
> > Hi stephen, 
> > 
> > I want add class to only when URl is active. If we add class in options 
> > array it will be for every time. I want it for only atcive pages 
> > 
> > Thanks, 
> > kiran 
> > 
> > On Wed, Feb 29, 2012 at 1:35 PM, Stephen Speakman < 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > step...@ninjacodermonkey.co.uk> wrote: 
> > > In the options array add 'class' => 'myclass' 
> > 
> > > Echo $this->Html->link('my link', array('control

Re: Add class to active links

2012-02-29 Thread euromark
just use conditions then

if ($condition) {} else {}

basic PHP one-o-one


On 29 Feb., 09:56, Kiran Ambati  wrote:
> Hi stephen,
>
> I want add class to only when URl is active. If we add class in options
> array it will be for every time. I want it for only atcive pages
>
> Thanks,
> kiran
>
> On Wed, Feb 29, 2012 at 1:35 PM, Stephen Speakman <
>
>
>
>
>
>
>
>
>
> step...@ninjacodermonkey.co.uk> wrote:
> > In the options array add 'class' => 'myclass'
>
> > Echo $this->Html->link('my link', array('controller' => 'users', 'action'
> > => 'index'), array('class' => 'mylink'));
>
> > If my memory serves me correctly that is
>
> > Sent from my iPhone
>
> > On 29 Feb 2012, at 07:48, Kiran Ambati  wrote:
>
> > Hi
>
> > I am using cakphp 'link' to generate anchor tags. Now i awnt to add a
> > class to active links to apply some styling to those links. Is there a way
> > to that.
>
> > --
> > *Thank you,*
> > *Kiran.*
>
> >  --
> > Our newest site for the community: CakePHP Video Tutorials
> > http://tv.cakephp.org
> > Check out the new CakePHP Questions site 
> >http://ask.cakephp.organd help others with their CakePHP related
> > questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > at 
> >http://groups.google.com/group/cake-php
>
> >  --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php
>
> --
> *Thank you,*
> *Kiran.*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Add class to active links

2012-02-29 Thread Kiran Ambati
Hi stephen,

I want add class to only when URl is active. If we add class in options
array it will be for every time. I want it for only atcive pages

Thanks,
kiran

On Wed, Feb 29, 2012 at 1:35 PM, Stephen Speakman <
step...@ninjacodermonkey.co.uk> wrote:

> In the options array add 'class' => 'myclass'
>
> Echo $this->Html->link('my link', array('controller' => 'users', 'action'
> => 'index'), array('class' => 'mylink'));
>
> If my memory serves me correctly that is
>
> Sent from my iPhone
>
> On 29 Feb 2012, at 07:48, Kiran Ambati  wrote:
>
> Hi
>
> I am using cakphp 'link' to generate anchor tags. Now i awnt to add a
> class to active links to apply some styling to those links. Is there a way
> to that.
>
> --
> *Thank you,*
> *Kiran.*
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site 
> http://ask.cakephp.org and help others with their CakePHP related
> questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at 
> http://groups.google.com/group/cake-php
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>



-- 
*Thank you,*
*Kiran.*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Add class to active links

2012-02-29 Thread euromark
didnt you find the cookbook?
http://book.cakephp.org/2.0/en/


On 29 Feb., 09:05, Stephen Speakman 
wrote:
> In the options array add 'class' => 'myclass'
>
> Echo $this->Html->link('my link', array('controller' => 'users',
> 'action' => 'index'), array('class' => 'mylink'));
>
> If my memory serves me correctly that is
>
> Sent from my iPhone
>
> On 29 Feb 2012, at 07:48, Kiran Ambati  wrote:
>
>
>
>
>
>
>
> > Hi
>
> > I am using cakphp 'link' to generate anchor tags. Now i awnt to add
> > a class to active links to apply some styling to those links. Is
> > there a way to that.
>
> > --
> > Thank you,
> > Kiran.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd
> > help others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this
> > group athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Add class to active links

2012-02-29 Thread Stephen Speakman

In the options array add 'class' => 'myclass'

Echo $this->Html->link('my link', array('controller' => 'users',  
'action' => 'index'), array('class' => 'mylink'));


If my memory serves me correctly that is

Sent from my iPhone

On 29 Feb 2012, at 07:48, Kiran Ambati  wrote:


Hi

I am using cakphp 'link' to generate anchor tags. Now i awnt to add  
a class to active links to apply some styling to those links. Is  
there a way to that.


--
Thank you,
Kiran.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and  
help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this  
group at http://groups.google.com/group/cake-php


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Add class to active links

2012-02-28 Thread Kiran Ambati
Hi

I am using cakphp 'link' to generate anchor tags. Now i awnt to add a class
to active links to apply some styling to those links. Is there a way to
that.

-- 
*Thank you,*
*Kiran.*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php