Re: Form with two levels of associated models
Ah, I see how it works now. Thank you! On Mar 22, 8:00 pm, cricket zijn.digi...@gmail.com wrote: A form can only post to a single URL. What you want to do is ensure that a Model-read() grabs the associated data. Then specify the fields as Company.whatever Contact.whatever. In the controller, use either saveAll($this-data) or save to each model separately. On Mar 22, 5:09 pm, Gillian gillian@gmail.com wrote: Hi. I've got a form here with two levels of associated models. Basically, it goes like this: Company -Company information tables -Contact table --Contact information tables Getting the form to post to the models that belong directly to the company was simple enough. What I can't figure out how to do is how to get it to post to the models that belong to the contact model (that belongs to the company model). It all needs to be done in a single form, so splitting it up isn't really an option. Can anyone give me any pointers? Thank you! 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: Execute Bake (cakephp) on Windows 7
I assume you can't get it to start baking at all from your post. Try it this way: First, go to Window's command prompt (Directions here, if you need them: http://www.sevenforums.com/tutorials/947-command-prompt.html). Type in cd C:\your\path\to\your\cakephp\installation\goes\here I'm not going to bother figuring out how to set the whole command thing so it'll bake without a long preceding line on Windows 7, so after that just type C:\yourcakeinstallationagain\cake\console\cake bake It should open up the baking process, and I assume you can do the rest for yourself. On Mar 22, 4:35 am, Francisco Serôdio f.sero...@netcabo.pt wrote: Hi everyone … I’m reading this tutorial -http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake2/os-p hp-cake2-pdf.pdf - and now I’m facing some problems in Section 4 – Using the Bake code Generater. I’m not able to run Bake on my PC with windows 7 … HELP Cumprimentos / Regards Francisco Serodio tel +351 919613316 image001.jpg 4KViewDownload 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.
Form with two levels of associated models
Hi. I've got a form here with two levels of associated models. Basically, it goes like this: Company -Company information tables -Contact table --Contact information tables Getting the form to post to the models that belong directly to the company was simple enough. What I can't figure out how to do is how to get it to post to the models that belong to the contact model (that belongs to the company model). It all needs to be done in a single form, so splitting it up isn't really an option. Can anyone give me any pointers? Thank you! 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: Complex form with fields belonging to fields that belong to the top table
I was incredibly dumb and putting it in the wrong part of the function. Thank you for your help! On Mar 19, 1:50 am, WebbedIT p...@webbedit.co.uk wrote: To pass any data to the view from the controller you must use: $this-set('varName', $var); So you should be doing: $types = $this-Company-CompanyType-find('list'); $this-set('types', $types); or $this-set('types', $this-Company-CompanyType-find('list')); HTH Paul 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: Complex form with fields belonging to fields that belong to the top table
All right, I hate to say this but I still can't get it to work. When I call $types in the view, it gives me this error: Notice (8): Undefined variable: types [APP\views\companies\add.ctp, line 24] I followed the instructions, and I've experimented with $types = $this- Company-CompanyType-find('list'); in the CompaniesController and various other things but it just isn't working. I'm sure I'm just missing something obvious again. Help? On Mar 17, 5:05 pm, Gillian gillian@gmail.com wrote: Me going at it from completely the wrong direction from the start makes it make so much more sense. Thank you! On Mar 17, 4:18 pm, cricket zijn.digi...@gmail.com wrote: Grab a list of the types in the CompaniesController: $this-set('types', $this-Company-CompanyType-find('list')); That produces an array with the PK as key and the name as value. If your table column is not 'name' you should specify it in the CompanyType model: var $displayField = 'your_column_name'; echo $form-input( 'CompanyType', array( 'type' = 'select', 'multiple' = 'checkbox', 'label' = 'whatever' ), $types ); On Mar 17, 5:02 pm, Gillian gillian@gmail.com wrote: I'm pretty new to Cakephp, so this could be rather simple and I'm just missing it. I'm attempting to set up a form that deals with a lot of tables and models. At the moment, I've set up the company model so that is hasmany company types, and the company_types table so it belongsto company. And in the view I set it up as: echo $form-input('CompanyType.0.type', array( 'type' = 'select', 'multiple' = 'checkbox', 'options' = array( 'Paving' = 'Paving', 'Rock Crushing And Screening' = 'Rock Crushing And Screening', 'Sweeping' = 'Sweeping', 'Grinding' = 'Grinding', 'Cranes' = 'Cranes' )); Obviously, this alone isn't enough because I'm getting the error: SQL Error: 1054: Unknown column 'Array' in 'field list' [CORE\cake\libs \model\datasources\dbo_source.php, line 527] What I'd prefer to do is explode the array in such a way so as to have each option selected be separately entered into the company_type table linked to the current company_id, rather than imploding it into a single string. Can anyone give me any pointers? 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.
Complex form with fields belonging to fields that belong to the top table
I'm pretty new to Cakephp, so this could be rather simple and I'm just missing it. I'm attempting to set up a form that deals with a lot of tables and models. At the moment, I've set up the company model so that is hasmany company types, and the company_types table so it belongsto company. And in the view I set it up as: echo $form-input('CompanyType.0.type', array( 'type' = 'select', 'multiple' = 'checkbox', 'options' = array( 'Paving' = 'Paving', 'Rock Crushing And Screening' = 'Rock Crushing And Screening', 'Sweeping' = 'Sweeping', 'Grinding' = 'Grinding', 'Cranes' = 'Cranes' )); Obviously, this alone isn't enough because I'm getting the error: SQL Error: 1054: Unknown column 'Array' in 'field list' [CORE\cake\libs \model\datasources\dbo_source.php, line 527] What I'd prefer to do is explode the array in such a way so as to have each option selected be separately entered into the company_type table linked to the current company_id, rather than imploding it into a single string. Can anyone give me any pointers? 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
Re: Complex form with fields belonging to fields that belong to the top table
Me going at it from completely the wrong direction from the start makes it make so much more sense. Thank you! On Mar 17, 4:18 pm, cricket zijn.digi...@gmail.com wrote: Grab a list of the types in the CompaniesController: $this-set('types', $this-Company-CompanyType-find('list')); That produces an array with the PK as key and the name as value. If your table column is not 'name' you should specify it in the CompanyType model: var $displayField = 'your_column_name'; echo $form-input( 'CompanyType', array( 'type' = 'select', 'multiple' = 'checkbox', 'label' = 'whatever' ), $types ); On Mar 17, 5:02 pm, Gillian gillian@gmail.com wrote: I'm pretty new to Cakephp, so this could be rather simple and I'm just missing it. I'm attempting to set up a form that deals with a lot of tables and models. At the moment, I've set up the company model so that is hasmany company types, and the company_types table so it belongsto company. And in the view I set it up as: echo $form-input('CompanyType.0.type', array( 'type' = 'select', 'multiple' = 'checkbox', 'options' = array( 'Paving' = 'Paving', 'Rock Crushing And Screening' = 'Rock Crushing And Screening', 'Sweeping' = 'Sweeping', 'Grinding' = 'Grinding', 'Cranes' = 'Cranes' )); Obviously, this alone isn't enough because I'm getting the error: SQL Error: 1054: Unknown column 'Array' in 'field list' [CORE\cake\libs \model\datasources\dbo_source.php, line 527] What I'd prefer to do is explode the array in such a way so as to have each option selected be separately entered into the company_type table linked to the current company_id, rather than imploding it into a single string. Can anyone give me any pointers? 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
Installing cakephp on a subdomain on my development server
I apologize for asking, but I can't seem to get this working despite some googling. I just installed cakephp on a subdirectory on my xampp development server, and am attempting to go through the IBM tutorial here: http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/index.html to give myself a feel for it. However, when I try to process the form at http://127.0.0.1/cakephp/users/register from the third page of the tutorial, I get a 404 error that apache can't find my page at http://127.0.0.1/users/register. I assume this means that there's a trick to installing on a subdomain that I haven't found, though I suppose it's also possible that something about the tutorial is simply outdated. Any help would be appreciated. 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