Yii Framework Forum: Show Boolean True - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Show Boolean True Rate Topic: -----

#1 User is offline   Foghist 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 31-January 13

Posted 31 January 2013 - 04:30 PM

Hi guys, i'm new to yii and frameworks as a general. I've made an application in which one of my tables holds a number of boolean attributes.
I want my application to echo the attribute name if the boolean value is true, and not echoing it if it isn't. The problem is i have no idea on how to do that.
Can you guys please help me?

Ohh btw, I can't believe i haven't switched to a framework before. This is great :)
0

#2 User is offline   PeRoChAk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 579
  • Joined: 26-November 10
  • Location:Lahore, Pakistan

Posted 31 January 2013 - 04:38 PM

you can do this as, in case of form

if($model->attr){
// code for attribute to echo
}

Cheers
Perochak
Web Design - Logo Design - Application Development

My Blog | Forums Comparison
0

#3 User is offline   Foghist 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 31-January 13

Posted 31 January 2013 - 05:12 PM

Thank you, it worked :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users