No, if that’s in 15 places then that’s of no use to me changing it in 15 places
New USERS, POSTS, EVENTS various models / controller All have created dates, now I want a standard set of “time” definitions to define if each of these is new, brand_new, recently_new…so if I say 2 months from now NEW is now less than 12 hours I don’t have to go everywhere looking for if this $created less than 24 hours and make it 12, I just want to change it in 1 spot. $created less than NEW / BRAND_NEW / RECENTLY_NEW...so on so on..... From: [email protected] [mailto:[email protected]] On Behalf Of Angel Robert Marquez Sent: Wednesday, February 09, 2011 9:51 PM To: [email protected] Subject: Re: Global Variable interface when{ public function new(); } class shtuff implements when { function new($type); if ($type="helluv"){...blah1} ifelse($type="retro"){..blah2} } $now = new shtuff; $now->new('recent'); On Wed, Feb 9, 2011 at 5:13 PM, Krissy Masters <[email protected]> wrote: Quick question. I have 3 types / classifications of "NEW" Brand new = less than 24 hours New more than 24 but less than 48 hours And recently new more than 48 but less than 96 hours Now how can I define these globally so if I have in the code anywhere > NEW or < RECENT rather than tracing back all the spots where -24 hours so I can simply change the NEW, BRAND_NEW and RECENTLY_NEW if I want to increase or decrease their values later on So I can use something like this in the code: if ( $created < BRAND_NEW ){ //fun stuff here } So I can change them in 1 spot and reflect on the site throughout. Configure::write('BRAND_NEW', date( 'Y-m-d H:i:s', strtotime( "-24 hours" ) ) ); Thanks -- 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 [email protected] 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 [email protected] 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 [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
