Re: Change __() default behavior
Hmmm.. Take a look at this: http://www.php.net/manual/en/function.override-function.php Maybe you could use that in your boostrap.php ;) Nick On Mar 23, 3:48 am, djogo wrote: > Hello > > I asked the same thing some time ago, in this thread (couldn't find > googlegroups link, sorry) > > http://www.mail-archive.com/cake-php@googlegroups.com/msg79031.html > > Somebody said it was in the developer's plans, but still... > > I thought about creating ___(), but it's a lot of keystrokes. Also, > I'm not sure whether the string extraction script would work that way, > and that's one of the good things about _() or __(). > > Is it possible to undefine __() [ or maybe _() ] and redefine it in > boostrap.php (pun intended) ? I think it would be better. > > On Mar 23, 12:52 am, xtraorange wrote: > > > > > Thanks! :) > > > (I liked boostrap.php better, but I followed what you were > > saying. :P) > > > On Mar 22, 10:23 pm, nurvzy wrote: > > > > Whops... boostrap.php = bootstrap.php > > > > Just incase you were confused. lol > > > > Nick > > > > On Mar 22, 9:21 pm, nurvzy wrote: > > > > > Put it in app/config/boostrap.php > > > > > You'll have access to it throughout your app. > > > > Nick > > > > > On Mar 22, 8:06 pm, xtraorange wrote: > > > > > > That's actually exactly what I was just thinking of doing, lol. > > > > > Thanks! > > > > > > The only thing I can't find... where am I supposed to place a function > > > > > that I want available both on the control and view levels? > > > > > > On Mar 22, 8:59 pm, Gonzalo Servat wrote: > > > > > > > On Tue, Mar 23, 2010 at 12:44 PM, xtraorange > > > > > > wrote: > > > > > > > Howdy all, > > > > > > > > This should be a quick one: > > > > > > > Is there any way, without editing the cake core (so that upgrades > > > > > > > are > > > > > > > easy), to switch the default behavior of __() from by default > > > > > > > echoing, > > > > > > > to by default returning? I find that 99% of the time, I don't > > > > > > > want it > > > > > > > to echo, and it's annoying to add the true parameter in there > > > > > > > every > > > > > > > single time. > > > > > > > What about creating a new function like ___() that calls __() with > > > > > > the true > > > > > > parameter? > > > > > > > Regards > > > > > > Gonzalo Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: Change __() default behavior
Hello I asked the same thing some time ago, in this thread (couldn't find googlegroups link, sorry) http://www.mail-archive.com/cake-php@googlegroups.com/msg79031.html Somebody said it was in the developer's plans, but still... I thought about creating ___(), but it's a lot of keystrokes. Also, I'm not sure whether the string extraction script would work that way, and that's one of the good things about _() or __(). Is it possible to undefine __() [ or maybe _() ] and redefine it in boostrap.php (pun intended) ? I think it would be better. On Mar 23, 12:52 am, xtraorange wrote: > Thanks! :) > > (I liked boostrap.php better, but I followed what you were > saying. :P) > > On Mar 22, 10:23 pm, nurvzy wrote: > > > Whops... boostrap.php = bootstrap.php > > > Just incase you were confused. lol > > > Nick > > > On Mar 22, 9:21 pm, nurvzy wrote: > > > > Put it in app/config/boostrap.php > > > > You'll have access to it throughout your app. > > > Nick > > > > On Mar 22, 8:06 pm, xtraorange wrote: > > > > > That's actually exactly what I was just thinking of doing, lol. > > > > Thanks! > > > > > The only thing I can't find... where am I supposed to place a function > > > > that I want available both on the control and view levels? > > > > > On Mar 22, 8:59 pm, Gonzalo Servat wrote: > > > > > > On Tue, Mar 23, 2010 at 12:44 PM, xtraorange > > > > > wrote: > > > > > > Howdy all, > > > > > > > This should be a quick one: > > > > > > Is there any way, without editing the cake core (so that upgrades > > > > > > are > > > > > > easy), to switch the default behavior of __() from by default > > > > > > echoing, > > > > > > to by default returning? I find that 99% of the time, I don't want > > > > > > it > > > > > > to echo, and it's annoying to add the true parameter in there every > > > > > > single time. > > > > > > What about creating a new function like ___() that calls __() with > > > > > the true > > > > > parameter? > > > > > > Regards > > > > > Gonzalo Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: Change __() default behavior
Thanks! :) (I liked boostrap.php better, but I followed what you were saying. :P) On Mar 22, 10:23 pm, nurvzy wrote: > Whops... boostrap.php = bootstrap.php > > Just incase you were confused. lol > > Nick > > On Mar 22, 9:21 pm, nurvzy wrote: > > > Put it in app/config/boostrap.php > > > You'll have access to it throughout your app. > > Nick > > > On Mar 22, 8:06 pm, xtraorange wrote: > > > > That's actually exactly what I was just thinking of doing, lol. > > > Thanks! > > > > The only thing I can't find... where am I supposed to place a function > > > that I want available both on the control and view levels? > > > > On Mar 22, 8:59 pm, Gonzalo Servat wrote: > > > > > On Tue, Mar 23, 2010 at 12:44 PM, xtraorange > > > > wrote: > > > > > Howdy all, > > > > > > This should be a quick one: > > > > > Is there any way, without editing the cake core (so that upgrades are > > > > > easy), to switch the default behavior of __() from by default echoing, > > > > > to by default returning? I find that 99% of the time, I don't want it > > > > > to echo, and it's annoying to add the true parameter in there every > > > > > single time. > > > > > What about creating a new function like ___() that calls __() with the > > > > true > > > > parameter? > > > > > Regards > > > > Gonzalo Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: Change __() default behavior
Whops... boostrap.php = bootstrap.php Just incase you were confused. lol Nick On Mar 22, 9:21 pm, nurvzy wrote: > Put it in app/config/boostrap.php > > You'll have access to it throughout your app. > Nick > > On Mar 22, 8:06 pm, xtraorange wrote: > > > > > That's actually exactly what I was just thinking of doing, lol. > > Thanks! > > > The only thing I can't find... where am I supposed to place a function > > that I want available both on the control and view levels? > > > On Mar 22, 8:59 pm, Gonzalo Servat wrote: > > > > On Tue, Mar 23, 2010 at 12:44 PM, xtraorange wrote: > > > > Howdy all, > > > > > This should be a quick one: > > > > Is there any way, without editing the cake core (so that upgrades are > > > > easy), to switch the default behavior of __() from by default echoing, > > > > to by default returning? I find that 99% of the time, I don't want it > > > > to echo, and it's annoying to add the true parameter in there every > > > > single time. > > > > What about creating a new function like ___() that calls __() with the > > > true > > > parameter? > > > > Regards > > > Gonzalo Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: Change __() default behavior
Put it in app/config/boostrap.php You'll have access to it throughout your app. Nick On Mar 22, 8:06 pm, xtraorange wrote: > That's actually exactly what I was just thinking of doing, lol. > Thanks! > > The only thing I can't find... where am I supposed to place a function > that I want available both on the control and view levels? > > On Mar 22, 8:59 pm, Gonzalo Servat wrote: > > > > > On Tue, Mar 23, 2010 at 12:44 PM, xtraorange wrote: > > > Howdy all, > > > > This should be a quick one: > > > Is there any way, without editing the cake core (so that upgrades are > > > easy), to switch the default behavior of __() from by default echoing, > > > to by default returning? I find that 99% of the time, I don't want it > > > to echo, and it's annoying to add the true parameter in there every > > > single time. > > > What about creating a new function like ___() that calls __() with the true > > parameter? > > > Regards > > Gonzalo Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: Change __() default behavior
That's actually exactly what I was just thinking of doing, lol. Thanks! The only thing I can't find... where am I supposed to place a function that I want available both on the control and view levels? On Mar 22, 8:59 pm, Gonzalo Servat wrote: > On Tue, Mar 23, 2010 at 12:44 PM, xtraorange wrote: > > Howdy all, > > > This should be a quick one: > > Is there any way, without editing the cake core (so that upgrades are > > easy), to switch the default behavior of __() from by default echoing, > > to by default returning? I find that 99% of the time, I don't want it > > to echo, and it's annoying to add the true parameter in there every > > single time. > > What about creating a new function like ___() that calls __() with the true > parameter? > > Regards > Gonzalo Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: Change __() default behavior
On Tue, Mar 23, 2010 at 12:44 PM, xtraorange wrote: > Howdy all, > > This should be a quick one: > Is there any way, without editing the cake core (so that upgrades are > easy), to switch the default behavior of __() from by default echoing, > to by default returning? I find that 99% of the time, I don't want it > to echo, and it's annoying to add the true parameter in there every > single time. > What about creating a new function like ___() that calls __() with the true parameter? Regards Gonzalo Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: Change __() default behavior
Well just edit the core, as thats the only way. :P Just make sure that each time you upgrade the version you revert it back. On Mar 22, 6:44 pm, xtraorange wrote: > Howdy all, > > This should be a quick one: > Is there any way, without editing the cake core (so that upgrades are > easy), to switch the default behavior of __() from by default echoing, > to by default returning? I find that 99% of the time, I don't want it > to echo, and it's annoying to add the true parameter in there every > single time. > > Thanks, > James Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Change __() default behavior
Howdy all, This should be a quick one: Is there any way, without editing the cake core (so that upgrades are easy), to switch the default behavior of __() from by default echoing, to by default returning? I find that 99% of the time, I don't want it to echo, and it's annoying to add the true parameter in there every single time. Thanks, James Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.