Re: Global functions

2012-04-09 Thread luca capra
My fault, but you can find in the manual too: $this->Form->value('Patient.bloodgroup'); Please reply to the list not directly to me to have more responses than mine (I'm not a cakephp guru nor your assistance help desk :) ) Bye, Luca Il 10/04/2012 07:23, alexkd ha scritto: While debug( $thi

Re: Global functions

2012-04-04 Thread luca capra
Sorry I've not understand what the problem is. The select doesn't prepopulate well? Try checking what the value of debug( $this->request->data('Patient.bloodgroup') ); If it is a text value you need to give the right key to the select $_bloodgroup = array_flip( $bloodgroup ); echo $this->For

Re: Global functions

2012-04-04 Thread JunLe Li
why not use array? $output = array('Rh A+', 'Rh A-','Rh B+', 'Rh B-', 'Rh AB+', 'Rh AB-'); > if (isset($output[ $patient['Patient']['bloodgroup'] ])) { > echo $output[ $patient['Patient']['bloodgroup'] ]; > } > -- liju...@gmail.com | Public Key

Re: Global functions

2012-04-04 Thread euromark
you can also use some kind of enum like I do: http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/ echo Patient::bloodgroups($patient['Patient']['bloodgroup']); anywhere in your application (in this case the view template) Am Mittwoch, 4. April 2012 12:14:21 UTC+2 s

Re: Global functions

2012-04-04 Thread luca capra
Il 04/04/2012 11:27, alexkd ha scritto: In my patient form one blood group select box. ... Can I place a function globally to return bloodgroup when id is passed? If so what can I do for it? Thanks. You can move the code in a Helper book.cakephp.org/2.0/en/views/helpers.html#creating-helpers O

Global functions

2012-04-04 Thread alexkd
In my patient form one blood group select box. My view.ctp is as follows, Can I place a function globally to return bloodgroup when id is passed? If so what can I do for it? Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Qu

Re: How to create a Utility Lib and/or Global Functions for my app?

2011-07-05 Thread Jeferson Rodrigues
app/Lib folder and make filename > the same ass className > > global functions you can include in your app/Config/bootstrap.php file or > make them there... > > -- > Lep pozdrav, Tilen Majerle > http://majerle.eu > > > > 2011/7/4 Celso > >> Hi ! >&

Re: How to create a Utility Lib and/or Global Functions for my app?

2011-07-04 Thread Tilen Majerle
you can just create "Lib", put file into app/Lib folder and make filename the same ass className global functions you can include in your app/Config/bootstrap.php file or make them there... -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/7/4 Celso > Hi ! > > How to c

How to create a Utility Lib and/or Global Functions for my app?

2011-07-04 Thread Celso
Hi ! How to create a Utility Lib and/or Global Functions for my app? Thanks, Celso -- 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

Re: global functions

2009-12-10 Thread Miles J
No thats incorrect. If its a global function that is used everywhere, it goes in the bootstrap. On Dec 10, 6:05 am, Giedrius Rekasius wrote: > On Thu, 2009-12-10 at 05:32 -0800, Ernesto wrote: > > Hello. > > > i have some simple functions such as > > > array_depth > > array_width > > array_integr

Re: global functions

2009-12-10 Thread Giedrius Rekasius
On Thu, 2009-12-10 at 05:32 -0800, Ernesto wrote: > Hello. > > i have some simple functions such as > > array_depth > array_width > array_integrate > > and so on > > that are used in both Controllers and Views. > > it's very uncomfortable to copy them in a helper and in a component @ > every l

Re: global functions

2009-12-10 Thread Ernesto
i created a php file with all the functions needed and then i loaded it in my bootstrap.php using php's include() it's working ok now On 10 Dic, 15:38, Fran Iglesias wrote: > Hi, > > El 10/12/2009, a las 14:32, Ernesto escribió: > > > it's very uncomfortable to copy them in a helper and in a com

Re: global functions

2009-12-10 Thread Fran Iglesias
Hi, El 10/12/2009, a las 14:32, Ernesto escribió: > it's very uncomfortable to copy them in a helper and in a component @ > every little mod. > is there any clever way to manage these funcs? You could load them in the APP/config/bootstrap.php Another solution is to create a class with several

global functions

2009-12-10 Thread Ernesto
Hello. i have some simple functions such as array_depth array_width array_integrate and so on that are used in both Controllers and Views. it's very uncomfortable to copy them in a helper and in a component @ every little mod. is there any clever way to manage these funcs? Check out the new