Yii Framework Forum: The "Enabled" property of behavior - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

The "Enabled" property of behavior

Poll: The "Enabled" property of behavior (12 member(s) have cast votes)

Should we keep "Enabled" property

  1. Yes (0 votes [0.00%])

    Percentage of vote: 0.00%

  2. No (5 votes [41.67%])

    Percentage of vote: 41.67%

  3. I don't care (7 votes [58.33%])

    Percentage of vote: 58.33%

Vote

#1 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 29 July 2011 - 12:33 PM

CBehavior has a property named "Enabled" which can be used to temporarily enable/disable an attached behavior.
Do you think this property is useful? Have you ever used it?
Please help us decide whether we should keep it in Yii 2.0 or not. Thanks.
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,385
  • Joined: 17-January 09
  • Location:Russia

Posted 29 July 2011 - 12:39 PM

Never used it. Why it's better than attaching-detaching behavior?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 29 July 2011 - 01:32 PM

Seems to be superfluous.
You'd want to attach/detach, wouldn't you?
"Less noise - more signal"
0

#4 User is offline   phtamas 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 527
  • Joined: 26-February 11
  • Location:Mezőtúr, Hungary

Posted 29 July 2011 - 02:37 PM

Enabling/disabling attached behaviors dynamically from code is the best way to guarantee long debugging sessions.
Doing it from configuration makes a bit more sense but I've never done it.

Answer: no.
0

#5 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,341
  • Joined: 12-October 09
  • Location:Croatia

Posted 29 July 2011 - 02:56 PM

Never used it...
Find more about me.... btw. Do you know your WAN IP?
0

#6 User is offline   mindplay 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 397
  • Joined: 03-September 09
  • Location:New York

Posted 31 July 2011 - 06:28 PM

Voted "I don't care" - I've never used this feature, but it's never bothered me either.
0

#7 User is offline   junxiong 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 541
  • Joined: 21-June 10

Posted 02 August 2011 - 02:24 AM

View Postmindplay, on 31 July 2011 - 06:28 PM, said:

Voted "I don't care" - I've never used this feature, but it's never bothered me either.


maybe attach and detach the behavior causing more overhead than enabling disabling?
I never used it too, but I vote "don't care"
“The most likely way for the world to be destroyed, most experts argue, is by accident. That’s where we come in; we’re computer professionals. We cause accidents.” - Nathaniel Borenstein

Yii Playground : Collaborative demo apps. You can join to improve it too!
My Team's Blog: In Indonesian.
0

#8 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 02 August 2011 - 05:58 AM

I voted "don't care" since I myself haven't encountered a relevant use case.

This thread seems to describe a case where it at least needs to be fixed (in case it will be kept).

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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