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->Form->input('bloodgroup', array(
  'type' =>  'select',
  'label' =>  'blood group',
  'options' =>  $bloodgroup,
  'default' =>  '1',
  'value' =>  $_bloodgroup[$this->request->data('Patient.bloodgroup')]
));


Il 05/04/2012 08:07, alexkd ha scritto:

As per your suggestion I added in afterFind(). Its working in
add,index and view.
But in edit, the select box is showing wrong because of the adjustment
in afterfind.
//
$bloodgroup = array(
 '0' =>  'RH A+',
 '1' =>  'RH A-',
 '2' =>  'RH B+',
 '3' =>  'RH B-',
 '4' =>  'RH AB+',
 '5' =>  'RH AB-'
 );
echo $this->Form->input('bloodgroup', array('type' =>  'select',
'label' =>  'blood group', 'options' =>  $bloodgroup, 'default' =>
'1'));
//
How can I add an empty field with the find query so I can duplicate
bloodgroup. and use it in edit.ctp



--
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Generating sitemap

2012-04-04 Thread jmail
I have all ready found articles in Bakery about generating sitemap and 
robots in CakePHP. But all of them are connected with Cake 1.x Can someone 
explain me how to generate sitemap and robots in cake 2.x or just give me 
an advice how to find those information
 
regards
 
jmail

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Moduling

2012-04-04 Thread tomas rei
thanks!

On Apr 5, 3:16 am, Vitor Pacheco  wrote:
> Use plugins to do this...
>
> http://book.cakephp.org/2.0/en/plugins.html#creating-your-own-plugins
>
> 2012/4/4 tomas rei 
>
>
>
>
>
>
>
>
>
> > Hello,
>
> > I would like to create a cakePHP application having different modules
> > like - Events, Poll, etc.
> > Each module will have more than one database tables.
> > Each module may have more than one controller.
>
> > So i want to have a separate folder for each module within models
> > folder, like - /app/models/events and similarly for /controllers and /
> > views.
>
> > let me know if it is possible.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php
>
> --
> *Vitor Pacheco*
> *Skype: vitor.pacheco.costa
> Msn: vitor-...@hotmail.com*
> *GTalk: vitorpc...@gmail.com**
> **Cel.: 71 8626-7909
> Tel.: 71 3378-5778 /** 71 3287-3475*

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Moduling

2012-04-04 Thread Allan Douglas
Hey, look for App:uses() on the api. Maybe this method can help you.

2012/4/4 Vitor Pacheco :
> Use plugins to do this...
>
> http://book.cakephp.org/2.0/en/plugins.html#creating-your-own-plugins
>
> 2012/4/4 tomas rei 
>>
>> Hello,
>>
>> I would like to create a cakePHP application having different modules
>> like - Events, Poll, etc.
>> Each module will have more than one database tables.
>> Each module may have more than one controller.
>>
>> So i want to have a separate folder for each module within models
>> folder, like - /app/models/events and similarly for /controllers and /
>> views.
>>
>> let me know if it is possible.
>>
>> --
>> 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
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
>
>
>
> --
> Vitor Pacheco
> Skype: vitor.pacheco.costa
> Msn: vitor-...@hotmail.com
> GTalk: vitorpc...@gmail.com
> Cel.: 71 8626-7909
> Tel.: 71 3378-5778 / 71 3287-3475
>
> --
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php



-- 
Fraternalmente
Allan Douglas de A. Silva
Desenvolvedor de Sistemas
Técnico em Informatica - Escola Técnica Redentorista.

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Moduling

2012-04-04 Thread Vitor Pacheco
Use plugins to do this...

http://book.cakephp.org/2.0/en/plugins.html#creating-your-own-plugins

2012/4/4 tomas rei 

> Hello,
>
> I would like to create a cakePHP application having different modules
> like - Events, Poll, etc.
> Each module will have more than one database tables.
> Each module may have more than one controller.
>
> So i want to have a separate folder for each module within models
> folder, like - /app/models/events and similarly for /controllers and /
> views.
>
> let me know if it is possible.
>
> --
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>



-- 
*Vitor Pacheco*
*Skype: vitor.pacheco.costa
Msn: vitor-...@hotmail.com*
*GTalk: vitorpc...@gmail.com**
**Cel.: 71 8626-7909
Tel.: 71 3378-5778 /** 71 3287-3475*

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Moduling

2012-04-04 Thread Allan Douglas
Man, i think this no is possible. But you can try import this
directory on controller.

2012/4/4 tomas rei :
> Hello,
>
> I would like to create a cakePHP application having different modules
> like - Events, Poll, etc.
> Each module will have more than one database tables.
> Each module may have more than one controller.
>
> So i want to have a separate folder for each module within models
> folder, like - /app/models/events and similarly for /controllers and /
> views.
>
> let me know if it is possible.
>
> --
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php



-- 
Fraternalmente
Allan Douglas de A. Silva
Desenvolvedor de Sistemas
Técnico em Informatica - Escola Técnica Redentorista.

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


$this->Session->read() is returning loding2.gif

2012-04-04 Thread Sdn ngp
Hello Friends,

 Can any one help me to solve the proble?

I have written  a code in app controller. to write the value in
session in beforeFilter()

//$this->params['pass'][0] ->  87445d5sd54dsd554

if(!empty($this->params['pass']) && strlen($this->params['pass'][0]) >
6)
{
$this->Session->write('uniqueId', $this-
>params['pass'][0]);
$uniqueId = $this->Session->read('uniqueId');
}


In app controller it is working fine but when i am loading other
controller via ajax and trying to read the data of session it some
time appeared and some time loading2.gif is displaying.

Because of this issue my session is corrupting the data. I have
broken  my head with this issue
echo $uniqueId = $this->Session->read('uniqueId');

Output:   loading2.gif



-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Moduling

2012-04-04 Thread tomas rei
Hello,

I would like to create a cakePHP application having different modules
like - Events, Poll, etc.
Each module will have more than one database tables.
Each module may have more than one controller.

So i want to have a separate folder for each module within models
folder, like - /app/models/events and similarly for /controllers and /
views.

let me know if it is possible.

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


call a function from a view

2012-04-04 Thread marcogo
hello
i want to call a function, from a view, passing an id and get back an
array with some data reads from a table?

where i can declare this function?

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Saving Nested Models

2012-04-04 Thread GoneShootin
This problem is beating me into a pulp, and if I could solve it I'd
really be making headway on my app.

Currently I have working the following type of relationship

Contact "belongsTo" Location
Location "hasMany" Contact

ie - contacts.location_id = locations.id

This works for all CRUD operations

Similarly

Location "belongsTo" BusinessTypes
BusinessTypes"hasMany" Location

ie - locations.business_types_id = business_types.id

What I need to do now, is to bring the above together to one Form,
which I'd normally do with joins, such that

contacts.location_id = locations.id AND locations.business_types_id =
business_types.id

In my view, the BusinessType model validation rules are being picked
up correctly as being displayed with "required", yet when I try to
save the form, the validation seems to forget itself, allowing the
Business Type to pass as an empty field, and of course, not get saved
to the DB.

How do I get Contacts->Location->BusinessType working!!!

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


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|
Twitter  | SinaWeibo 



On Wed, Apr 4, 2012 at 19:18, euromark  wrote:

> 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 schrieb muka:
>
>> 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
>>
>> Or alter the returned data after find in the model callback, for example
>> book.cakephp.org/2.0/en/**models/callback-methods.html#**afterfind
>>
>>
>>  --
> 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
> cake-php+unsubscr...@googlegroups.com 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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem in edit-view with data from a HABTM-relationship

2012-04-04 Thread Mike Griffin
> Wonderful,
>
> fully working incl. selected option:
>
>
>            echo
> $this->Form->input('Detail'.$counter.'DetailType'.'name', array(
>     'options' => $detail_types,
>     'label' => 'Detail Art ',
>     'selected' =>
> $this->Form->data['Detail'][$counter]['detail_type_id'],
>
>     'div'=>'formfield',
>     'error' => array(
>     'wrap' => 'div',
>     'class' => 'formerror'
>     )
>     ));
>
> Thanks a lot
>

Fantastic, good to hear.

Mike.

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem in edit-view with data from a HABTM-relationship

2012-04-04 Thread Wall-D


Am Mittwoch, 4. April 2012 15:35:26 UTC+2 schrieb Mike Griffin:
>>
>> On Wed, Apr 4, 2012 at 13:50, Wall-D  wrote:
>> > Yes, it should be the list of all detail-types with the correct one
>> > selected.
>> >
>> > in the controller I'm passing them to the view:
>> > '$detail_types = $this->Device->Detail->DetailType->find('list',
>> > array('order' => 'DetailType.name ASC'));
>> >  and the label shows up the correct DetailType
>> >
>> > I tried many combinations, but nothing worked for me ...
>>
>> echo $this->Form->input('Detail'.$counter.'DetailType'.'name', array(
>> 'options' => $detail_types,
>> 'label' => 'Detail Art ',
>> 'selected' =>
>> $this->Form->data['Detail'][$counter].'detail_type_id',
>> 'div'=>'formfield',
>> 'error' => array(
>> 'wrap' => 'div',
>> 'class' => 'formerror'
>> )
>> ));
>>
>> Note the options part of the array. Does that change anything?
>>
>> Mike.
>>
>
Wonderful,

fully working incl. selected option:

   echo 
$this->Form->input('Detail'.$counter.'DetailType'.'name', array(
'options' => $detail_types,
'label' => 'Detail Art ',
'selected' => 
$this->Form->data['Detail'][$counter]['detail_type_id'],
'div'=>'formfield',
'error' => array(
'wrap' => 'div',
'class' => 'formerror'
)
)); 

Thanks a lot

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem in edit-view with data from a HABTM-relationship

2012-04-04 Thread Mike Griffin
On Wed, Apr 4, 2012 at 13:50, Wall-D  wrote:
> Yes, it should be the list of all detail-types with the correct one
> selected.
>
> in the controller I'm passing them to the view:
> '    $detail_types = $this->Device->Detail->DetailType->find('list',
> array('order' => 'DetailType.name ASC'));
>  and the label shows up the correct DetailType
>
> I tried many combinations, but nothing worked for me ...

echo $this->Form->input('Detail'.$counter.'DetailType'.'name', array(
'options' => $detail_types,
'label' => 'Detail Art ',
'selected' =>
$this->Form->data['Detail'][$counter].'detail_type_id',
'div'=>'formfield',
'error' => array(
'wrap' => 'div',
'class' => 'formerror'
)
));

Note the options part of the array. Does that change anything?

Mike.

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem in edit-view with data from a HABTM-relationship

2012-04-04 Thread Wall-D


Am Mittwoch, 4. April 2012 11:40:10 UTC+2 schrieb Mike Griffin:
>
> On Tue, Apr 3, 2012 at 14:59, Wall-D wrote:
> > Here ist the problem:
> >
> > here ist the code from edit.ctp
> >
> >  >  $counter = 0;
> >  foreach ($this->data['Detail'] as $detail):
> >  echo
> > $this->Form->hidden('Detail.'.$counter.'.id',array( 'value' =>
> > $detail['id']));
> > echo
> > $this->Form->input('Detail'.$counter.'DetailType'.'name', array(
> > 'type' => 'select',
> > 'label' => 'Detail Art ',
> > 'selected' =>
> > $this->Form->data['Detail'][$counter].'detail_type_id',
> > 'div'=>'formfield',
> > 'error' => array(
> > 'wrap' => 'div',
> > 'class' => 'formerror'
> > )
> > ));
> > echo 
> $this->Form->input('Detail.'.$counter.'.name',
> > array(
> > 'label' => 'Detail',
> > 'div'=>'formfield',
> > 'error' => array(
> > 'wrap' => 'div',
> > 'class' => 'formerror'
> > )
> > ));
> >   $counter++;
> >  endforeach;
> > ?>
> >
> > The selectBox(Detail Type) is empty, no option available. in the Textbox 
> the
> > correct value is displayed.
>
> You aren't passing any options to the selectBox so it has nothing to
> show. Do you want to pick from the entire list of DetailTypes?
>
> Try finding all DetailType as a list and using that as the options for
> the SelectBox.
>
> Mike.
>
Yes, it should be the list of all detail-types with the correct one 
selected.

in the controller I'm passing them to the view:
'$detail_types = $this->Device->Detail->DetailType->find('list', 
array('order' => 'DetailType.name ASC'));
 and the label shows up the correct DetailType

I tried many combinations, but nothing worked for me ...

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: mysql gone away

2012-04-04 Thread Sandeep Kumar
Miles, it is in cli...


On Wed, Apr 4, 2012 at 4:14 AM, Miles J  wrote:

> Are these PDFs being created in the CLI/cron? If not, they should be.
>
>
> On Tuesday, April 3, 2012 12:54:27 AM UTC-7, Sandy wrote:
>>
>> HI There,
>>
>> I'm facing a big problem with cakephp 1.2
>>
>> first one is that cakephp is creating connection with mysql using
>> mysql_pconnect, but in database.php I've set "persistent" to false.
>> For this I've changed core files and change mysql_pconnect to
>> mysql_connect. I know it is not a good idea. could any body suggest me
>> a better one, as mysql is not changing the connection type from
>> database.php
>>
>> second one, I'm creating pdf and excel reports using html2pdf library,
>> while creating small reports it works fine, But when a report with
>> large data is provided it takes about 40+ minutes to created the
>> report in this case my report get created but after creating the
>> report, I need to send a email alert to users about the report, for
>> which I've to pick some data from database and at this time I get an
>> error
>> "Mysql gone away 2006"
>>
>> I've increase
>>
>> mysql_wait_timeout
>>
>> max_allowed_packet
>>
>> but not succeeded.
>>
>> Could any one suggest me what to do to figure out this problem.
>>
>> Thanks in advance
>
>  --
> 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
> cake-php+unsubscr...@googlegroups.com 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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


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 schrieb muka:
>
> 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
>
> Or alter the returned data after find in the model callback, for example
> book.cakephp.org/2.0/en/models/callback-methods.html#afterfind
>
>
>

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


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

Or alter the returned data after find in the model callback, for example
book.cakephp.org/2.0/en/models/callback-methods.html#afterfind


--
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem in edit-view with data from a HABTM-relationship

2012-04-04 Thread Mike Griffin
On Tue, Apr 3, 2012 at 14:59, Wall-D  wrote:
> Here ist the problem:
>
> here ist the code from edit.ctp
>    
>                               $counter = 0;
>                  foreach ($this->data['Detail'] as $detail):
>                  echo
> $this->Form->hidden('Detail.'.$counter.'.id',array( 'value' =>
> $detail['id']));
>                         echo
> $this->Form->input('Detail'.$counter.'DetailType'.'name', array(
>                 'type' => 'select',
>                         'label' => 'Detail Art ',
>                 'selected' =>
> $this->Form->data['Detail'][$counter].'detail_type_id',
>                         'div'=>'formfield',
>                 'error' => array(
>                 'wrap' => 'div',
>                 'class' => 'formerror'
>                 )
>                 ));
>                         echo $this->Form->input('Detail.'.$counter.'.name',
> array(
>                 'label' => 'Detail',
>                 'div'=>'formfield',
>                 'error' => array(
>                 'wrap' => 'div',
>                 'class' => 'formerror'
>                 )
>                 ));
>                           $counter++;
>                  endforeach;
>             ?>
>
> The selectBox(Detail Type) is empty, no option available. in the Textbox the
> correct value is displayed.

You aren't passing any options to the selectBox so it has nothing to
show. Do you want to pick from the entire list of DetailTypes?

Try finding all DetailType as a list and using that as the options for
the SelectBox.

Mike.

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


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 Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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