Yii Framework Forum: Carray And Cstring - Yii Framework Forum

Jump to content

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

Carray And Cstring aux classes Rate Topic: -----

#1 User is offline   Boaz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 360
  • Joined: 23-January 11

Posted 01 October 2012 - 07:44 AM

Hi,

Are they any plans to add generic aux classes like CString and CArray that will contain misc useful methods?
This kind of classes is something I stumble upon in many places/projects that I work with.

For example, in CString we could have the following convenient methods:
  • bool static isStartingWith($str, $target);
  • bool static isEndingWith($str, $target);

In CArray, something that I just needed:
  • array static trimToSize($array, $size) - returns part of a multidimensional array, according to given $size.

Obviously, there could be more useful convenience methods that are good to have at your disposal and that I think that are good to have in a framework.
I can contribute the code for the ones mentioned above.
Therapeutic PHP sessions My LinkedIn Profile
0

#2 User is offline   waterloomatt 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 545
  • Joined: 09-April 10

Posted 01 October 2012 - 08:56 AM

I agree these are useful methods, but I don't think they belong in the framework as they are not specific to Yii.
0

#3 User is offline   jacmoe 

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

Posted 01 October 2012 - 09:05 AM

No - don't do it. :)

They removed most - if not all - such utility functions from CakePHP in 1.3 (IIRC) as it's not specific to the framework.
And because it could conflict with whatever utility functions you might be using.

There must exist a ton of utility libraries for PHP ?

If you guys are using such libs, what's your favorite?
"Less noise - more signal"
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