Re: $session->flash(); issue
You din't need to do that. Just do $session->flash(); - if there is a message set, it will display, else it won't. Jeremy Burns jeremybu...@me.com On 3 Jun 2010, at 07:40, Zahidur Rahman wrote: > Hi experts > I am facing a problem for showing flash message in my view file. > If any message is not found then in my view file i found array() > I am using the following code in my view file : > > if ($session->check('Message.flash')) { > $session->flash(); > } > > > Output : array() > If no message set for this method > > Would you help pls > Thanks > Zahidur Rahman > > 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 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
$session->flash(); issue
Hi experts I am facing a problem for showing flash message in my view file. If any message is not found then in my view file i found array() I am using the following code in my view file : if ($session->check('Message.flash')) { $session->flash(); } Output : array() If no message set for this method Would you help pls Thanks Zahidur Rahman 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: One to Many question
Ok, got it. I'll go for this containable behaviour right now. Thanks for you replies guys. Regards On 2 jun, 23:03, Roland Pish wrote: > Thanks Graham! > > So, this conditions array is mandatory in find method right? > > Regards > > On 2 jun, 23:01, Roland Pish wrote: > > > Thanks for your reply Jeremy. > > > I was avoiding the conditions array because I thought cake would do > > the "magic" and the automatic filter. > > In this specific case does cake do this "magic"? or is it neccesary to > > pass the conditions array? > > > Regards. > > > On 2 jun, 22:56, Jeremy Burns wrote: > > > > I'd try this: > > > > > $foreignSchools = $this->Student->ForeignSchool->find('all', > > > > array('conditions' => array('ForeignSchool.student_id' => 2))); > > > > (hope the number of brackets is right...) > > > > Jeremy Burns > > > jeremybu...@me.com > > > > On 3 Jun 2010, at 05:51, Roland Pish wrote: > > > > > Hello. I don't know if I'm doing things well, so I'll fire my > > > > question. > > > > I have a model relationship this way: Student hasMany ForeignSchool. > > > > First, I'll show my scenario, files and relevant code, then I'll > > > > explain the problem. > > > > > SCENARIO: > > > > * Model file student.php (hasmany declaration): > > > > var $hasMany = array( > > > > > 'ForeignSchool' => array( > > > > > 'className' => 'ForeignSchool', > > > > > 'foreignKey' => 'student_id', > > > > > 'dependent' => true, > > > > > ), > > > > > ); > > > > > * Model file foreign_school.php (belongsto declaration): > > > > var $belongsTo = array( > > > > > 'Student' => array( > > > > > 'className' => 'Student', > > > > > 'foreignKey' => 'student_id', > > > > > ), > > > > > ); > > > > > * Controller file students_controller.php (find call test): > > > > $this->Student->id = 2; //test hard code > > > > $foreignSchools = $this->Student->ForeignSchool->find('all'); > > > > > $this->set(compact('foreignSchools')); > > > > > * And in the corresponding view file: > > > > print_r($foreignSchools); > > > > > PROBLEM: > > > > The call to print_r($foreignSchools) is showing all the foreign > > > > schools but not the schools of the current Student. Is it something > > > > I'm missing that is avoiding the "filtering" of the foreign schools > > > > shown in the view? > > > > > Thanks a lot! > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers > > > > 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 athttp://groups.google.com/group/cake-php?hl=en 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: One to Many question
Thanks Graham! So, this conditions array is mandatory in find method right? Regards On 2 jun, 23:01, Roland Pish wrote: > Thanks for your reply Jeremy. > > I was avoiding the conditions array because I thought cake would do > the "magic" and the automatic filter. > In this specific case does cake do this "magic"? or is it neccesary to > pass the conditions array? > > Regards. > > On 2 jun, 22:56, Jeremy Burns wrote: > > > I'd try this: > > > > $foreignSchools = $this->Student->ForeignSchool->find('all', > > > array('conditions' => array('ForeignSchool.student_id' => 2))); > > > (hope the number of brackets is right...) > > > Jeremy Burns > > jeremybu...@me.com > > > On 3 Jun 2010, at 05:51, Roland Pish wrote: > > > > Hello. I don't know if I'm doing things well, so I'll fire my > > > question. > > > I have a model relationship this way: Student hasMany ForeignSchool. > > > First, I'll show my scenario, files and relevant code, then I'll > > > explain the problem. > > > > SCENARIO: > > > * Model file student.php (hasmany declaration): > > > var $hasMany = array( > > > > 'ForeignSchool' => array( > > > > 'className' => 'ForeignSchool', > > > > 'foreignKey' => 'student_id', > > > > 'dependent' => true, > > > > ), > > > > ); > > > > * Model file foreign_school.php (belongsto declaration): > > > var $belongsTo = array( > > > > 'Student' => array( > > > > 'className' => 'Student', > > > > 'foreignKey' => 'student_id', > > > > ), > > > > ); > > > > * Controller file students_controller.php (find call test): > > > $this->Student->id = 2; //test hard code > > > $foreignSchools = $this->Student->ForeignSchool->find('all'); > > > > $this->set(compact('foreignSchools')); > > > > * And in the corresponding view file: > > > print_r($foreignSchools); > > > > PROBLEM: > > > The call to print_r($foreignSchools) is showing all the foreign > > > schools but not the schools of the current Student. Is it something > > > I'm missing that is avoiding the "filtering" of the foreign schools > > > shown in the view? > > > > Thanks a lot! > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 > > > athttp://groups.google.com/group/cake-php?hl=en 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: One to Many question
Graham's reply was far more comprehensive than mine and I'd go with it. I use containable as a matter of course. Jeremy Burns jeremybu...@me.com On 3 Jun 2010, at 06:01, Roland Pish wrote: > Thanks for your reply Jeremy. > > I was avoiding the conditions array because I thought cake would do > the "magic" and the automatic filter. > In this specific case does cake do this "magic"? or is it neccesary to > pass the conditions array? > > Regards. > > On 2 jun, 22:56, Jeremy Burns wrote: >> I'd try this: >> >>> $foreignSchools = $this->Student->ForeignSchool->find('all', >>> array('conditions' => array('ForeignSchool.student_id' => 2))); >> >> (hope the number of brackets is right...) >> >> Jeremy Burns >> jeremybu...@me.com >> >> On 3 Jun 2010, at 05:51, Roland Pish wrote: >> >>> Hello. I don't know if I'm doing things well, so I'll fire my >>> question. >>> I have a model relationship this way: Student hasMany ForeignSchool. >>> First, I'll show my scenario, files and relevant code, then I'll >>> explain the problem. >> >>> SCENARIO: >>> * Model file student.php (hasmany declaration): >>> var $hasMany = array( >> >>>'ForeignSchool' => array( >> >>>'className' => 'ForeignSchool', >> >>>'foreignKey' => 'student_id', >> >>>'dependent' => true, >> >>>), >> >>>); >> >>> * Model file foreign_school.php (belongsto declaration): >>> var $belongsTo = array( >> >>>'Student' => array( >> >>>'className' => 'Student', >> >>>'foreignKey' => 'student_id', >> >>>), >> >>>); >> >>> * Controller file students_controller.php (find call test): >>> $this->Student->id = 2; //test hard code >>> $foreignSchools = $this->Student->ForeignSchool->find('all'); >> >>> $this->set(compact('foreignSchools')); >> >>> * And in the corresponding view file: >>> print_r($foreignSchools); >> >>> PROBLEM: >>> The call to print_r($foreignSchools) is showing all the foreign >>> schools but not the schools of the current Student. Is it something >>> I'm missing that is avoiding the "filtering" of the foreign schools >>> shown in the view? >> >>> Thanks a lot! >> >>> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 >>> athttp://groups.google.com/group/cake-php?hl=en > > 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 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: One to Many question
Thanks for your reply Jeremy. I was avoiding the conditions array because I thought cake would do the "magic" and the automatic filter. In this specific case does cake do this "magic"? or is it neccesary to pass the conditions array? Regards. On 2 jun, 22:56, Jeremy Burns wrote: > I'd try this: > > > $foreignSchools = $this->Student->ForeignSchool->find('all', > > array('conditions' => array('ForeignSchool.student_id' => 2))); > > (hope the number of brackets is right...) > > Jeremy Burns > jeremybu...@me.com > > On 3 Jun 2010, at 05:51, Roland Pish wrote: > > > Hello. I don't know if I'm doing things well, so I'll fire my > > question. > > I have a model relationship this way: Student hasMany ForeignSchool. > > First, I'll show my scenario, files and relevant code, then I'll > > explain the problem. > > > SCENARIO: > > * Model file student.php (hasmany declaration): > > var $hasMany = array( > > > 'ForeignSchool' => array( > > > 'className' => 'ForeignSchool', > > > 'foreignKey' => 'student_id', > > > 'dependent' => true, > > > ), > > > ); > > > * Model file foreign_school.php (belongsto declaration): > > var $belongsTo = array( > > > 'Student' => array( > > > 'className' => 'Student', > > > 'foreignKey' => 'student_id', > > > ), > > > ); > > > * Controller file students_controller.php (find call test): > > $this->Student->id = 2; //test hard code > > $foreignSchools = $this->Student->ForeignSchool->find('all'); > > > $this->set(compact('foreignSchools')); > > > * And in the corresponding view file: > > print_r($foreignSchools); > > > PROBLEM: > > The call to print_r($foreignSchools) is showing all the foreign > > schools but not the schools of the current Student. Is it something > > I'm missing that is avoiding the "filtering" of the foreign schools > > shown in the view? > > > Thanks a lot! > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 > > athttp://groups.google.com/group/cake-php?hl=en 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: One to Many question
You need to specify your conditions as part of the find, or get associated records from a Student model find. I'd personally do this with the containable behavior. Add the 'Containable' behavior to your models. I normally add this to my AppModel (/app/app_model.php), as I use it everywhere. Set $recursive to -1. Again, I do this on my app model: public $recursive = -1; In your StudentsController you can do the following: $id = 2; $student = $this->Student->find('all', array( 'conditions' => array('Student.id' => $id), 'contain' => array('ForeignSchool') )); $this->set(compact('student')); Now your data is available in $student in your view. Your foreign schools are at: $student['ForeignSchool] Hope that helps. Cheers, Graham Weldon (AKA: Predominant) On Thu, Jun 3, 2010 at 2:51 PM, Roland Pish wrote: > Hello. I don't know if I'm doing things well, so I'll fire my > question. > I have a model relationship this way: Student hasMany ForeignSchool. > First, I'll show my scenario, files and relevant code, then I'll > explain the problem. > > SCENARIO: > * Model file student.php (hasmany declaration): > var $hasMany = array( > > 'ForeignSchool' => array( > > 'className' => 'ForeignSchool', > > 'foreignKey' => 'student_id', > > 'dependent' => true, > > ), > > ); > > * Model file foreign_school.php (belongsto declaration): > var $belongsTo = array( > > 'Student' => array( > > 'className' => 'Student', > > 'foreignKey' => 'student_id', > > ), > > ); > > * Controller file students_controller.php (find call test): > $this->Student->id = 2; //test hard code > $foreignSchools = $this->Student->ForeignSchool->find('all'); > > $this->set(compact('foreignSchools')); > > > * And in the corresponding view file: > print_r($foreignSchools); > > PROBLEM: > The call to print_r($foreignSchools) is showing all the foreign > schools but not the schools of the current Student. Is it something > I'm missing that is avoiding the "filtering" of the foreign schools > shown in the view? > > Thanks a lot! > > 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 > 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: One to Many question
I'd try this: > $foreignSchools = $this->Student->ForeignSchool->find('all', > array('conditions' => array('ForeignSchool.student_id' => 2))); (hope the number of brackets is right...) Jeremy Burns jeremybu...@me.com On 3 Jun 2010, at 05:51, Roland Pish wrote: > Hello. I don't know if I'm doing things well, so I'll fire my > question. > I have a model relationship this way: Student hasMany ForeignSchool. > First, I'll show my scenario, files and relevant code, then I'll > explain the problem. > > SCENARIO: > * Model file student.php (hasmany declaration): > var $hasMany = array( > >'ForeignSchool' => array( > >'className' => 'ForeignSchool', > >'foreignKey' => 'student_id', > >'dependent' => true, > >), > >); > > * Model file foreign_school.php (belongsto declaration): > var $belongsTo = array( > >'Student' => array( > >'className' => 'Student', > >'foreignKey' => 'student_id', > >), > >); > > * Controller file students_controller.php (find call test): > $this->Student->id = 2; //test hard code > $foreignSchools = $this->Student->ForeignSchool->find('all'); > > $this->set(compact('foreignSchools')); > > > * And in the corresponding view file: > print_r($foreignSchools); > > PROBLEM: > The call to print_r($foreignSchools) is showing all the foreign > schools but not the schools of the current Student. Is it something > I'm missing that is avoiding the "filtering" of the foreign schools > shown in the view? > > Thanks a lot! > > 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 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
One to Many question
Hello. I don't know if I'm doing things well, so I'll fire my question. I have a model relationship this way: Student hasMany ForeignSchool. First, I'll show my scenario, files and relevant code, then I'll explain the problem. SCENARIO: * Model file student.php (hasmany declaration): var $hasMany = array( 'ForeignSchool' => array( 'className' => 'ForeignSchool', 'foreignKey' => 'student_id', 'dependent' => true, ), ); * Model file foreign_school.php (belongsto declaration): var $belongsTo = array( 'Student' => array( 'className' => 'Student', 'foreignKey' => 'student_id', ), ); * Controller file students_controller.php (find call test): $this->Student->id = 2; //test hard code $foreignSchools = $this->Student->ForeignSchool->find('all'); $this->set(compact('foreignSchools')); * And in the corresponding view file: print_r($foreignSchools); PROBLEM: The call to print_r($foreignSchools) is showing all the foreign schools but not the schools of the current Student. Is it something I'm missing that is avoiding the "filtering" of the foreign schools shown in the view? Thanks a lot! 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: Advise on creating a Game with cakephp
Chess sounds cool. Let us know how you go with it. You could implement pieces and boards as models, Board hasMany Pieces. If you need some non-MVC classes to provide some structure and organisation for your app, you can put them into the libs directory, and App::import() them from there. Hope that helps. Cheers, Graham Weldon (AKA: Predominant) On Thu, Jun 3, 2010 at 2:54 AM, gmansilla wrote: > Hello, I plan to develop a table game like chess, from a MVC > architecture... where do I write all the logic and validation? it > would be written in a model, right? > If so, these models wouldn't use any table, What if I need some > classes to build the logic? would be all those classes just models? if > so, then I should call them using App::import()? > > Of course I will use ajax but the logic will be placed on the server > side. > > Am I planning well so far? > > 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 > 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: Cache / file.php / unserialize() error
This should be fixed in #769 http://cakephp.lighthouseapp.com/projects/42648/tickets/769 We're working towards packaging another release for this as soon as possible. Cheers, Graham Weldon (AKA: Predominant) On Wed, Jun 2, 2010 at 5:38 AM, Brent wrote: > Hello, > > I installed CakePHP 1.3.1 and a CMS app named Croogo on my Solaris > server. Loading pages produces errors like this one: > > > Notice (8): unserialize() [function.unserialize]: Error at offset 5 of > 602 bytes [CORE/cake/libs/cache/file.php, line 176] > Code | Context > > $key = "cake_core_file_map" > $time = 1275420867 > $cachetime = 1275420872 > $data = > "a:3:{s:4:\"Core\";a:3:{s:6:\"Router\";s:32:\"/www/croogo/cake/ > libs/router.php\";s:13:\"ClassRegistry\";s:40:\"/www/croogo/cake/libs/ > class_registry.php\";s:12:\"Overloadable\";s:38:\"/www/croogo/cake/ > libs/overloadable.php\";}s:10:\"Controller\";a:2:{s:9:\"Component\";s: > 46:\"/www/croogo/cake/libs/controller/component.php\";s:10:\"Controller > \";s:47:\"/www/croogo/cake/libs/controller/controller.php\";}s:4:\"View > \";a:3:{s:6:\"Helper\";s:37:\"/www/croogo/cake/libs/view/helper.php > \";s:4:\"View\";s:35:\"/www/croogo/cake/libs/view/view.php\";s: > 5:\"Media\";s:36:\"/www/croogo/cake/libs/view/media.php\";}} > " > > unserialize - [internal], line ?? > FileEngine::read() - CORE/cake/libs/cache/file.php, line 176 > Cache::read() - CORE/cake/libs/cache.php, line 347 > App::getInstance() - CORE/cake/libs/configure.php, line 967 > App::build() - CORE/cake/libs/configure.php, line 650 > Configure::__loadBootstrap() - CORE/cake/libs/configure.php, line 431 > Configure::getInstance() - CORE/cake/libs/configure.php, line 52 > include - CORE/cake/bootstrap.php, line 38 > [main] - APP/webroot/index.php, line 76 > > > What can I do to fix it? > > Many thanks, > Brent > > 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 > 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: Next Cakefest?
Hi Jeremy, Dates and location have been announced. Chicago, Illinois. September 2-5. Workshops will be on the 2nd and 3rd of September. Conference will be on the 4th and 5th of September. We hope to see you there! Cheers, Graham Weldon (AKA: Predominant) On Sun, May 2, 2010 at 7:30 PM, drpark wrote: > can we know more now that it is announced on cakefest.org? > Regards, > Jeremy > > On 8 mar, 14:23, drpark wrote: >> Hi all, >> do you have an idea for the nextcakefest'sdates? >> >> Hard to get approved for a business travel if we can't book 3 months >> before the event.( we have to plan current project) >> >> Thanks for answers, >> Regards, >> Jeremy > > 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 > 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: baking 1.3.0 problems?
apply this diff http://cakephp.lighthouseapp.com/projects/42648/tickets/771-wrong-core-path-in-templatephp On May 28, 5:07 am, BJ wrote: > For the more dense... which folder to where :-S > > On May 26, 9:12 am, Ben Mosher wrote: > > > > > Fixed. Move 'templates' folder up into 'libs'. Or copy. Worked for me. > > > On May 25, 3:53 pm, CrotchFrog wrote: > > > > @invisibleman: > > > > Did you ever resolve this problem? I'm having the same issue. > > > > On Apr 27, 6:18 am, invisibleman wrote: > > > > > i can't seem to bake my models, views or controllers in the stable of > > > > cakephp 1.3.0 is anyone else having this problem? > > > > > It just seems to create empty files for me. For example if i have a > > > > table called groups and i bake it it just creates an empty group.php > > > > file for me even though i defined relationships and validation etc. > > > > > Can anyone help? > > > > > Check out the new CakePHP Questions > > > > sitehttp://cakeqs.organdhelpotherswith 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 athttp://groups.google.com/group/cake-php?hl=en 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: timeHelper
http://php.net/strftime Matt On Wed, Jun 2, 2010 at 18:48, bradmaxs wrote: > Does anyone know if there is a way to convert the military time output > of the niceShort method to standard time? > > Example: 13:54:01 to 1:54pm. > > Thank you, > > Brad > > 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 > 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: Miles J Uploader help
Hey Miles, Did you ever test this? Just checking. I am going to try and maybe do a Set::extract?? Going to start tomorrow but thought I would check in. Brad On May 19, 11:37 am, Miles J wrote: > Its probably getting confused trying to load the data since both the > file input and date input are arrays. I dont think I have ever tested > with a date/time input, ill try it out. > > On May 19, 11:23 am,bradmaxs wrote: > > > Hey Miles, > > > That worked for a straight upload action, thank you. > > > The Model Attachment is still not working for me though, still getting > > the errors from the above post. > > > After looking closer it seems that my birthdate field is doing > > something funny?? > > > Warning (2): Invalid argument supplied for foreach() [APP/plugins/ > > uploader/controllers/components/uploader.php, line 1006] > > Code | Context > > > if (is_array($data)) { > > foreach ($data as $model => $fields) { > > foreach ($fields as $field => $value) { > > > $data = array( > > "month" => "05", > > "day" => "19", > > "year" => "2009" > > ) > > $fields = "05" > > $model = "month" > > > I made it a hidden field and filled in the value myself and then just > > got this error - probably from the component? > > > There was an error attaching this file! > > > Any ideas? Thank you again for taking the time on this. > > > Brad > > > On May 18, 5:58 pm, Miles J wrote: > > > > If you are using the latest uploader version, I believe its: > > > > if ($data = $this->Uploader->upload('UserPreference.fileName')) { > > > > On May 18, 11:14 am, Sam Sherlock wrote: > > > > > Hi Brad > > > > > It is not a compatiblity issue with 1.3 - not able to speify the issue > > > > right > > > > now but will try to compare your code with mine later today > > > > > but you may solve it by then :) > > > > - S > > > > > On 18 May 2010 18:41,bradmaxs wrote: > > > > > > I tried to just add it as an action in my controller and can't get a > > > > > photo uploaded at all?? > > > > > > permissions are set to 777 on both my files folder and img_usericon as > > > > > well. > > > > > > Here is the user_preferences_controller.php > > > > > > var $components = array('Uploader.Uploader'); > > > > > > in my beforeFilter > > > > > > $this->Uploader->uploadDir = 'files/img_usericon/'; > > > > > $this->Auth->allow('upload'); > > > > > > the action > > > > > > function upload() { > > > > > if (!empty($this->data)) { > > > > > if ($data = $this->Uploader->upload('fileName')) { > > > > > $this->Session->setFlash(sprintf(__('The %s has been > > > > > saved', > > > > > true), 'user photo')); > > > > > $this->redirect(array('controller' => > > > > > 'users', 'action' => > > > > > 'profile', $this->Auth->user('id'))); > > > > > } else { > > > > > > > > > > $this->Session->setFlash(sprintf(__('The %s > > > > > could not saved', > > > > > true), 'user photo')); > > > > > $this->redirect(array('controller' => > > > > > 'users', 'action' => > > > > > 'profile', $this->Auth->user('id')));} > > > > > } > > > > > } > > > > > > and upload.ctp > > > > > > > > > > echo $this->element('errors', array('errors' => $errors)); > > > > > echo $form->create('UserPreference', array('url' => array('controller' > > > > > => 'user_preferences', 'action' =>'upload'), 'type' => 'file')); > > > > > echo $form->input('fileName', array('type' => 'file')); > > > > > echo $form->end('Upload'); > > > > > ?> > > > > > > Not sure what I am doing wrong. Could it be 1.3? > > > > > > It is sending me back to my else redirect and giving me my not saved > > > > > message? > > > > > > Thanks for any help. > > > > > > Brad > > > > > > On May 17, 11:05 pm, Miles J wrote: > > > > > > Let me do a few local tests. In the mean time, take a look at the > > > > > > example controller in the plugin. > > > > > > > On May 17, 9:52 pm,bradmaxs wrote: > > > > > > > > Hey Miles, > > > > > > > > Thanks for the fast reply. For some reason i am only seeing your > > > > > > > last > > > > > > > post. Google groups is acting funny for me. I saw in the email > > > > > > > summary that you left 2 messages but only see the one here. I > > > > > > > did see > > > > > > > in the email summary that the first post you said I didn't need > > > > > > > this > > > > > > > in my controller if ($data = $this->Uploader->upload('image')) { > > > > > > > so I > > > > > > > took that out and also made the change to the attachment array to > > > > > > > 'image'. Should of caught that one myself but didn't so thank > > > > > > > you. > > > > > > > > Now I am getting a bunch of errors - maybe this will help. > > > > > > > > Warning (2): Invalid argument supplied for foreach() [APP/plugins/ > > > > > > > uploader/controllers/components/uploader.php, line 1006] > > > > > > > Code | Context > > > > > > >
timeHelper
Does anyone know if there is a way to convert the military time output of the niceShort method to standard time? Example: 13:54:01 to 1:54pm. Thank you, Brad 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
CakePHP development firm
Is there a list of CakePHP development firms? We are looking to engage with one for a project and would like to get recommendation from the community here. 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
Read-only topics
Silly question maybe - Is there a set rule when a topic becomes read- only? I've noticed that some topics on here are read-only. I've repeatedly wanted to reply to some of them but can't as they're set to read-only (you can reply to the author but not to the topic). There are topics as recent as February that are read-only which seems odd. Ian 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: find('first') query cakephp1.2 vs 1.3
use $this->User->find('first', array('conditions' => array('User.id' =>4))) everything else is either deprecated or used for something else On 2 Jun., 17:39, bram wrote: > The migration guide actually mentions this change in paragraph 11.1.2: > > > Model::find(first) will no longer use the id property for default > > conditions if > > no conditions are supplied and id is not empty. Instead no conditions will > > be > > used 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: saveAll/Save not saving associations
Thanks for the reply, but when I change it to camelCase I lose my associations in the view. On Jun 2, 6:13 am, Shaz wrote: > Course has many course_tees > CourseTee belongs to course > > I thought all model class names be singular and camel cased; as in: > > Course has many CourseTee > CourseTee belongs to Course > > Might help? > > On 2 June, 01:05, jjunior wrote: > > > > > I'm having a problem trying to save/update some associated data. I've > > read about a million google returns, but nothing seems to be the > > solution. I'm at my wit's end and hope some kind soul here can help. > > > I'm using 1.3.0-RC4, my database is in InnoDB. > > > Course has many course_tees > > CourseTee belongs to course > > > My controller function is pretty simple (I've made it as simple as > > possible): > > > if(!empty($this->data)) > > $this->Course->saveAll($this->data); > > > I've tried a lot of different variations of that $this- > > > >data['Course'], save($this->data), etc without luck. > > > It saves the Course info, but not the CourseTee stuff. I don't get an > > error message. > > > Since I don't know how many tees any given course will have, I > > generate the form inputs dynamically in a loop. > > > $form->input('CourseTee.'.$i.'.teeName', array('error' => false, > > 'label' => false, 'value'=>$data['course_tees'][$i]['teeName'])) > > > The course inputs are simpler: > > > $form->input('Course.hcp'.$j, array('error' => false, 'label' => > > false, 'class' => 'form_small_w', 'value'=>$data['Course']['hcp'.$j])) > > > And this is how my data is formatted: > > > Array > > ( > > [Course] => Array > > ( > > [id] => 1028476 > > ... > > ) > > > [CourseTee] => Array > > ( > > [0] => Array > > ( > > [key] => 636 > > [courseid] => 1028476 > > ... > > ) > > > [1] => Array > > ( > > [key] => 637 > > [courseid] => 1028476 > > ... > > ) > > > ... > > > ) > > ) 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: slider not appearing
http://book.cakephp.org/view/1358/AJAX On Jun 2, 10:05 am, Bryan Lim wrote: > hi all, > > I am trying to get jquery works in my cakephp. > source:http://www.cakephp.bee.pl/ > But i cannot see the slider..What is wrong? I see no error messages. > As instructed in the site, I placed the helpers under /app/views/ > helpers/ > copied all the js into /app/webroot/js/ > added the following into /app/views/layouts/default.ctp > > link('jquery-1.4.2.min');?> > link('jquery-ui-1.7.2.custom.min');?> > > added var $helpers = array('Javascript', 'Ajax'); to my controller. > > below is default.ctp > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > > > > link('jquery-1.4.2.min');?> > link('jquery-ui-1.7.2.custom.min');?> > link('jquery.autocomplete.min');?> > link('jquery.jeditable.mini');?> > > > > > > > > > > > > > > pasted the below in my view > > > Donation amount ($50 increments): > > > > > slider('slider2', array( > 'value' => 100, > 'min' => 0, > 'max' => 500, > 'step' => 50, > 'slide' => '$("#amount").val("$" + ui.value);', > ))?> > > > $(document).ready(function(){ > $("#amount").val('$' + $("#slider2").slider("value"));}) > > 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: tricky list re-ordering problem
On Jun 2, 12:18 am, Jeremy Burns wrote: > You mention tree behaviour but I don't see any parent, left or right fields. I haven't implemented this (yet) with Tree. I mentioned it because this is how I've done it in the past. But, in this case I can't see how to use it because, normally, everything in the DB table would be a single tree. In this case, I've got to have several separate lists (trees), one for each DocumentSection. > Just want to clarify a few things...are these accurate statements? > > - A section has many documents yes > - The order is (i) section then (ii) documents within the section yes > - The document order is not based on the name of the document The client wishes to be able to re-order the documents within a given section. > If so, wouldn't a 'sort_order' column in the documents table fix this? If so, > the order becomes (i) section.name (ii) document.sort_order. Perhaps, but I can't see how that could be implemented, nor how I'd change the order. Here's a concrete example: section_1 document_a document_b document_c document_d section_2 document_e document_f document_g The client wishes to change them to look like: section_1 document_a document_c document_d document_b section_2 document_g document_e document_f I can't figure out how I would do this using Tree Behavior, as I've done in the past. A sort_order column might do the trick but I'm having some trouble wrapping my head around that. How would I handle a new Document being added to section_1, for example? My inclination would be for it to be added to the end of the section, and then, if the client wished to do so, it could be re-ordered once its been uploaded. But, if using a sort_order column, how to set that correctly in the first place? One idea I've been ruminating on is to dispense with a document_sections table and, instead, have a root Document (that is "virtual, and never shown) and then several more "virtual" Documents representing the section names. IOW, the only real documents are those on the 3rd level of the tree (and there are only ever 3 levels). I'm going to give that a shot and see how it goes. 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: another timeline helper question
has anybody used the timeline helper before? On May 31, 4:57 pm, Bryan Lim wrote: > I don understand the example parthttp://bakery.cakephp.org/leafs/view/81 > > where the view is used to render the json. > > $xpaths = array( > 'title' => '/title', > 'start' => '/from', > 'end' => '/to', > 'color' => '/color' > ); > echo $timeline->renderJSON($data['SubActivity'],array(),$xpaths); > ?> > > The path "/app/main_activities/ajax_timeline.ctp" doesn't make sense > too. > > On May 31, 12:07 pm, Bryan Lim wrote: > > > Hi all, > > > how do I get $data fromhttp://bakery.cakephp.org/leafs/view/81 > > > cakephp is complaining undefined variable data. > > > I am new to both php and cakephp. > > > need help! > > > /b 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
[jquery helper] slider not appearing
hi all, I am trying to get jquery works in my cakephp. source: http://www.cakephp.bee.pl/ But i cannot see the slider..What is wrong? I see no error messages. As instructed in the site, I placed the helpers under /app/views/ helpers/ copied all the js into /app/webroot/js/ added the following into /app/views/layouts/default.ctp link('jquery-1.4.2.min');?> link('jquery-ui-1.7.2.custom.min');?> added var $helpers = array('Javascript', 'Ajax'); to my controller. below is default.ctp http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml";> link('jquery-1.4.2.min');?> link('jquery-ui-1.7.2.custom.min');?> link('jquery.autocomplete.min');?> link('jquery.jeditable.mini');?> pasted the below in my view Donation amount ($50 increments): slider('slider2', array( 'value' => 100, 'min' => 0, 'max' => 500, 'step' => 50, 'slide' => '$("#amount").val("$" + ui.value);', ))?> $(document).ready(function(){ $("#amount").val('$' + $("#slider2").slider("value")); }) 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
Advise on creating a Game with cakephp
Hello, I plan to develop a table game like chess, from a MVC architecture... where do I write all the logic and validation? it would be written in a model, right? If so, these models wouldn't use any table, What if I need some classes to build the logic? would be all those classes just models? if so, then I should call them using App::import()? Of course I will use ajax but the logic will be placed on the server side. Am I planning well so far? 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
HTTP headers options for unit tests?
I have a common controller where I like to keep logic and render it in different ways depending on how its called. For instance assume you have a controller called Foo with an action called bar that returns true in JSON or XML or renders a view depending on how it was requested. class FooController extends AppController { function bar() { $this->data = true; if ( $this->isAPICall() ) { $this->renderAPI(); } else { $this->render(); } } class AppController extends Controller { public function isAPICall() { if ( $this->RequestHandler->accepts('html') ) { return false; } if ( $this->RequestHandler->accepts('xml') || $this->RequestHandler- >accepts('json') ) { return true; } return false; } public function renderAPI() { // Turn off debugging so the render time does not get included in the output Configure::write('debug', 0); if ( $this->RequestHandler->accepts('xml') ) { $this->renderXML(); } elseif ( $this->RequestHandler->accepts('json') ) { $this->renderJSON(); } } } This works great and allows me to re-use tons of logic. The problem is how to test it using the Cake 1.3 test cases. If there where some way to modify request headers before the action is called it would be a easy as cake :) Anybody think this is possible if CakeTestCase was modified? 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: Login - Header location Error
It looks like you are echoing or debugging something to the screen, which is then getting in the way of the headers. Jeremy Burns jeremybu...@me.com On 2 Jun 2010, at 16:37, Davor Ilic wrote: > Hi, > > my problem is the header location func when i redirect after login i get this > error: > > > Warning (2): Cannot modify header information - headers already sent by > (output started at > /var/www/virtual/site/dev/htdocs/cake/libs/debugger.php:673) > [CORE/cake/libs/controller/controller.php, line 746] > is there an issue from cakePHP? because i hadn`t change anything. What i only > do is to redirect after login to the site i wanna show to the user. > thanks for coming help > > 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 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
cakephp eclipse debugging
hay guys i am starting a project in cakephp i need help how i will debug it with eclipse 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: find('first') query cakephp1.2 vs 1.3
The migration guide actually mentions this change in paragraph 11.1.2: > Model::find(first) will no longer use the id property for default conditions > if > no conditions are supplied and id is not empty. Instead no conditions will be > used 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
Login - Header location Error
Hi, my problem is the header location func when i redirect after login i get this error: *Warning* (2): Cannot modify header information - headers already sent by (output started at /var/www/virtual/site/dev/htdocs/cake/libs/debugger.php:673) [*CORE/cake/libs/controller/controller.php*, line *746*] is there an issue from cakePHP? because i hadn`t change anything. What i only do is to redirect after login to the site i wanna show to the user. thanks for coming help 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: How to pass array value from one ctp file to another ctp file
Use elements, you can pass values between them: $this->element('whatever', $valuetobepassed); On 2 June, 13:16, Narendra Padala wrote: > Hi flocks, > I am, new to cake php actually i want display one report, in the down i > put the link download link for Excel. > > For that purpose , i have to display same content for report and excel, so > i was set the query results in one variable rows, using that variable i was > displayed the records now same variable i have to use in In the > export_xls.ctp file so, for that purpose i passed variable through query > string. so in that time i din't get data, simple its shows array() in > address bar. > > so how to pass array value form one ctp to ctp in same controller. please > help me out. > > I wrote code like this... > > MyConroller > -- > > class MyviewsController extends AppController { > > var $name = 'Myviews'; > > function display() { > > $this->Myview->recursive = 1; > $data = $this->Myview->find('all'); > $this->set('rows',$data); > } > > function export_xls($data) { > > $this->set('rows',$data); > $this->render('export_xls','export_xls'); > > }} > > ?> > > --- > ctp files > > display.ctp > > > .tableTd { > border-width: 0.5pt; > border: solid; > } > .tableTdContent{ > border-width: 0.5pt; > border: solid; > } > #titles{ > font-weight: bolder; > } > > > > > Export To Excel Sample > > > Date: > > > > Number of Rows: > > > > > > > Column 1 > Column 2 > > echo ''; > echo ''.$row['Myview']['no'].''; > echo ' class="tableTdContent">'.$row['Myview']['name'].''; > echo ''; > endforeach; > ?> > > > > > > image('button_excel_onclick.gif', > array('border' => '0', > 'url' => array('controller'=> 'myviews', > 'action' => 'export_xls', > $rows))); > ?> > > > > - > export_xls.ctp > > > .tableTd { > border-width: 0.5pt; > border: solid; > } > .tableTdContent{ > border-width: 0.5pt; > border: solid; > } > #titles{ > font-weight: bolder; > } > > > > > Export To Excel Sample > > > Date: > > > > Number of Rows: > > > > > > > Column 1 > Column 2 > > echo ''; > echo ''.$row['Myview']['no'].''; > echo ' class="tableTdContent">'.$row['Myview']['name'].''; > echo ''; > endforeach; > ?> > > --- > > please any one can help me out..! > > thanks in advance...! 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: Newbie question: URL linking
Try: link($html->image('linkedin.gif', array ('alt' => 'LinkedIn' , 'align' => 'bottom')), "{$user['social_media'] ['linkedin']}", array(), null, false); ?> Essentially store the value you wish to act as a URL in a variable and call that variable. Also remember PHP treats single quotes as strings, and will not search for variables inside them; whereas it will do so in double quotes. If it's an array you're calling in double quotes, remember to use curly brackets around it. On 1 June, 20:27, bobbiloo wrote: > In this example: > > > > link($html->image('linkedin.gif', array ('alt' => > 'LinkedIn' , 'align' => 'bottom')), ' ', array(), null, false); ?> > > > > I am trying to use a field in my social_media table, entitled > "linkedin," to be the url of my $html->link statement. But if I plug > that php echo line in between the single quotes, I get a parse > error. > > How can I retrieve this table field to be the URL in my $html->link > statement? 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: Containable() not working for $this->Model1->Model2->find('', array('contain') => 'Model3');
Ok, so what you want is: 1) The article; 2) The related comments; 3) The related comment ranks for each comment. [code] $this->Article->Comment->find( 'threaded', array( 'contain' => array('Article', 'CommentRank'), 'conditions' => array('Comment.article_id' => $id) ) ); [/code] That should give you the comments in a threaded format, with the article and comment rank attached. Enjoy, John On Jun 2, 4:01 pm, Shaz wrote: > $this->Article->Comment->find( > 'threaded', > array( > 'contain' => array('CommentRank'), > 'conditions' => array('Article.id' => $id) > ) > ); > > ^^ Sorry it was a typo in the post; the code above is from my > application. It does return an Array but doesn't use the containable > behavior; but it works when I do: > $this->Article->find( > 'threaded', > array( > 'contain' => array('Comment'), > 'conditions' => array('Article.id' => $id) > ) > ); > > Limiting the results to just the Article and its Comments; what I want > is the Article, Comments and the Comment Ranks. > > I've checked the associations again and they all look fine - they > provide results when doing $this->model1->model2->find() but don't > like to use the containable behaviour... > [snip] 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: Router not working as expected
It should be: Router::connect( '/blog_post', array( 'controller' => 'posts', 'action' => 'view', 5 ) ); Notice it's only one array. On 1 June, 23:07, blasto333 wrote: > Router::connect( > '/blog_post', > array('controller' => 'posts'), > array('action' => 'view', 1) 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: saveAll/Save not saving associations
Course has many course_tees CourseTee belongs to course I thought all model class names be singular and camel cased; as in: Course has many CourseTee CourseTee belongs to Course Might help? On 2 June, 01:05, jjunior wrote: > I'm having a problem trying to save/update some associated data. I've > read about a million google returns, but nothing seems to be the > solution. I'm at my wit's end and hope some kind soul here can help. > > I'm using 1.3.0-RC4, my database is in InnoDB. > > Course has many course_tees > CourseTee belongs to course > > My controller function is pretty simple (I've made it as simple as > possible): > > if(!empty($this->data)) > $this->Course->saveAll($this->data); > > I've tried a lot of different variations of that $this- > > >data['Course'], save($this->data), etc without luck. > > It saves the Course info, but not the CourseTee stuff. I don't get an > error message. > > Since I don't know how many tees any given course will have, I > generate the form inputs dynamically in a loop. > > $form->input('CourseTee.'.$i.'.teeName', array('error' => false, > 'label' => false, 'value'=>$data['course_tees'][$i]['teeName'])) > > The course inputs are simpler: > > $form->input('Course.hcp'.$j, array('error' => false, 'label' => > false, 'class' => 'form_small_w', 'value'=>$data['Course']['hcp'.$j])) > > And this is how my data is formatted: > > Array > ( > [Course] => Array > ( > [id] => 1028476 > ... > ) > > [CourseTee] => Array > ( > [0] => Array > ( > [key] => 636 > [courseid] => 1028476 > ... > ) > > [1] => Array > ( > [key] => 637 > [courseid] => 1028476 > ... > ) > > ... > > ) > ) 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: Router not working as expected
On Jun 2, 12:07 am, blasto333 wrote: > Router::connect( > '/blog_post', > array('controller' => 'posts'), > array('action' => 'view', 1) please link to where in the book you've seen an example that looks like that. 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: Containable() not working for $this->Model1->Model2->find('', array('contain') => 'Model3');
$this->Article->Comment->find( 'threaded', array( 'contain' => array('CommentRank'), 'conditions' => array('Article.id' => $id) ) ); ^^ Sorry it was a typo in the post; the code above is from my application. It does return an Array but doesn't use the containable behavior; but it works when I do: $this->Article->find( 'threaded', array( 'contain' => array('Comment'), 'conditions' => array('Article.id' => $id) ) ); Limiting the results to just the Article and its Comments; what I want is the Article, Comments and the Comment Ranks. I've checked the associations again and they all look fine - they provide results when doing $this->model1->model2->find() but don't like to use the containable behaviour... On 1 June, 18:30, John Andersen wrote: > I do hope it is only a typo in the post and not in your code! > > [code] > $this->Model1->Model2->find( > 'threaded', > array('contain' => 'Model3') > ); > [/code] > > Is the above what is not working? > Have you checked that an association/relationship is defined between > Model2 and Model3? > Enjoy, > John > > On Jun 1, 8:14 pm, Shaz wrote: > > > I'm trying to avoid putting $uses at the top of my controller and > > aiming to make do with model associations, but alas containable() > > doesn't work when trying: > > > $this->Model1->Model2->find('threaded', array('contain') => 'Model3'); > > > But: > > > $this->Model1->find('threaded', array('contain') => 'Model2.Model3'); > > > Provides me a threaded result, containable works, but the find results > > not in the array structure I want (using parent_id to make threaded > > comments)... 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
saveAll/Save not saving associations
I'm having a problem trying to save/update some associated data. I've read about a million google returns, but nothing seems to be the solution. I'm at my wit's end and hope some kind soul here can help. I'm using 1.3.0-RC4, my database is in InnoDB. Course has many course_tees CourseTee belongs to course My controller function is pretty simple (I've made it as simple as possible): if(!empty($this->data)) $this->Course->saveAll($this->data); I've tried a lot of different variations of that $this- >data['Course'], save($this->data), etc without luck. It saves the Course info, but not the CourseTee stuff. I don't get an error message. Since I don't know how many tees any given course will have, I generate the form inputs dynamically in a loop. $form->input('CourseTee.'.$i.'.teeName', array('error' => false, 'label' => false, 'value'=>$data['course_tees'][$i]['teeName'])) The course inputs are simpler: $form->input('Course.hcp'.$j, array('error' => false, 'label' => false, 'class' => 'form_small_w', 'value'=>$data['Course']['hcp'.$j])) And this is how my data is formatted: Array ( [Course] => Array ( [id] => 1028476 ... ) [CourseTee] => Array ( [0] => Array ( [key] => 636 [courseid] => 1028476 ... ) [1] => Array ( [key] => 637 [courseid] => 1028476 ... ) ... ) ) 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
Router not working as expected
Router::connect( '/blog_post', array('controller' => 'posts'), array('action' => 'view', 1) 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
Session unexpectedly dropped between pages in IE
Hello everyone, I've come across an extremely unusual bug that my team has literally no idea how to solve. Doing some research, I found some similar solutions that I thought would work, but alas did not. Here is my situation, let me know if I can provide additional insight to help solve the problem. The first step is that someone chooses a country via a flash map. Flash passes this region name (as well as a date) through the URL, which we then convert to a session. The next page contains no Flash and doesn't display the selected region, but it does hold on to it for further down the process. Everything works perfectly in Safari and Firefox; however, in IE sometimes unexpected results occur. Frequently (but not always), the session is dropped completely and no sessions are stored between the first and 2nd pages. Here are the steps that I have taken thus far, unsuccessfully: 1. Changed Security from Medium -> Low 2. Changed CheckUserAgent from True -> False 3. Changed storing of sessions from PHP -> Database Some additional information that may be useful: I have tried printing out the session data in Debug (debug($_SESSION) on my view file and debug set to 2 in config). In Internet Explorer everything prints out as expected EXCEPT when the region and date don't get set. For example: If the region and date don't get set NOTHING is printed out for debug. I don't get the session details at the top, and I don't get the normal dump of calls at the bottom of the page either. Please let me know if you have ANY idea of what is causing this or any solutions. I am beyond frustrated and have tried as much as I can to solve this. Thanks! 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
Cache / file.php / unserialize() error
Hello, I installed CakePHP 1.3.1 and a CMS app named Croogo on my Solaris server. Loading pages produces errors like this one: Notice (8): unserialize() [function.unserialize]: Error at offset 5 of 602 bytes [CORE/cake/libs/cache/file.php, line 176] Code | Context $key= "cake_core_file_map" $time = 1275420867 $cachetime = 1275420872 $data = "a:3:{s:4:\"Core\";a:3:{s:6:\"Router\";s:32:\"/www/croogo/cake/ libs/router.php\";s:13:\"ClassRegistry\";s:40:\"/www/croogo/cake/libs/ class_registry.php\";s:12:\"Overloadable\";s:38:\"/www/croogo/cake/ libs/overloadable.php\";}s:10:\"Controller\";a:2:{s:9:\"Component\";s: 46:\"/www/croogo/cake/libs/controller/component.php\";s:10:\"Controller \";s:47:\"/www/croogo/cake/libs/controller/controller.php\";}s:4:\"View \";a:3:{s:6:\"Helper\";s:37:\"/www/croogo/cake/libs/view/helper.php \";s:4:\"View\";s:35:\"/www/croogo/cake/libs/view/view.php\";s: 5:\"Media\";s:36:\"/www/croogo/cake/libs/view/media.php\";}} " unserialize - [internal], line ?? FileEngine::read() - CORE/cake/libs/cache/file.php, line 176 Cache::read() - CORE/cake/libs/cache.php, line 347 App::getInstance() - CORE/cake/libs/configure.php, line 967 App::build() - CORE/cake/libs/configure.php, line 650 Configure::__loadBootstrap() - CORE/cake/libs/configure.php, line 431 Configure::getInstance() - CORE/cake/libs/configure.php, line 52 include - CORE/cake/bootstrap.php, line 38 [main] - APP/webroot/index.php, line 76 What can I do to fix it? Many thanks, Brent 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
Newbie question: URL linking
In this example: link($html->image('linkedin.gif', array ('alt' => 'LinkedIn' , 'align' => 'bottom')), ' ', array(), null, false); ?> I am trying to use a field in my social_media table, entitled "linkedin," to be the url of my $html->link statement. But if I plug that php echo line in between the single quotes, I get a parse error. How can I retrieve this table field to be the URL in my $html->link statement? 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: find('first') query cakephp1.2 vs 1.3
$data = $this->User->read(null, 4); that is the official way to get one row.. another possible ways: $this->User->findById(4); $this->User->find('first', array('conditions' => array('User.id' => 4))) bye, gonzalo On 2 jun, 09:09, bram wrote: > I'm porting my app from cakephp 1.2 to 1.3 and followed all steps in > the migration guide. Still having troubles with find queries. > > I have quite some queries doing: > > $this->User->id = 4; > $data = $this->User->find('first'); > > Cake 1.2 builds the following query: > SELECT `User`.`id`, FROM `users` AS `User` WHERE `User`.`id` = 4 > ORDER BY `name` ASC LIMIT 1 > > Cake 1.3.1 builds a different query: > SELECT `User`.`id`, FROM `users` AS `User` WHERE 1 = 1 ORDER BY > `name` ASC LIMIT 1 > > I just get the first record, but not the one that matches the set id. > > I like the short and readable notation of this query. > Is this a wrong way of retreiving model data? Should I go for the long > notation (including the conditions option that tells find to search > for User.id = 4) ?? Or is it a cake bug? > > Bests, > > Bram 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: how i call function in cake link
Look in the CakePHP book at: http://book.cakephp.org/view/1435/Inserting-Well-Formatted-elements#link-1442 The second example is what you need! Enjoy, John On Jun 2, 2:21 pm, Dilip Godhani wrote: > e($html->link('Edit',array('controller'=>'dashboards','action'=>'partner/'.$data[$i]['Partner']['id']))); > ?> > -- > Dilip Godhani > Jr Software Developer, Entourage Solutions > e-mail: di...@entouragesolutions.com > dilip.godh...@gmail.com > Web.:www.entouragesolutions.com > m. 9913822582 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: how i call function in cake link
link('edit', array('controller'=>'dashboards', 'action'=>' 'partner/'.$data[$i]['Partner']['id']')); ?> On Wed, Jun 2, 2010 at 5:49 PM, mike karthauser wrote: > > On 2 Jun 2010, at 12:21, Dilip Godhani wrote: > > e($html->link('Edit',array('controller'=>'dashboards','action'=>'partner/'.$data[$i]['Partner']['id']))); > ?> > > > by reading how in the book > http://book.cakephp.org/view/836/link > > -- > Mike Karthäuser > Managing Director - Brightstorm Ltd > Email: mi...@brightstorm.co.uk > Web: http://www.brightstorm.co.uk > Tel: 07939 252144 > Address: 1 Brewery Court, North Street, Bristol, BS3 1JS > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > 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: how i call function in cake link
Sryy for but i want to call jquery function..! On Wed, Jun 2, 2010 at 5:49 PM, mike karthauser wrote: > > On 2 Jun 2010, at 12:21, Dilip Godhani wrote: > > e($html->link('Edit',array('controller'=>'dashboards','action'=>'partner/'.$data[$i]['Partner']['id']))); > ?> > > > by reading how in the book > http://book.cakephp.org/view/836/link > > -- > Mike Karthäuser > Managing Director - Brightstorm Ltd > Email: mi...@brightstorm.co.uk > Web: http://www.brightstorm.co.uk > Tel: 07939 252144 > Address: 1 Brewery Court, North Street, Bristol, BS3 1JS > > 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.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Dilip Godhani Jr Software Developer, Entourage Solutions e-mail: di...@entouragesolutions.com dilip.godh...@gmail.com Web.: www.entouragesolutions.com m. 9913822582 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
How to pass array value from one ctp file to another ctp file
Hi flocks, I am, new to cake php actually i want display one report, in the down i put the link download link for Excel. For that purpose , i have to display same content for report and excel, so i was set the query results in one variable rows, using that variable i was displayed the records now same variable i have to use in In the export_xls.ctp file so, for that purpose i passed variable through query string. so in that time i din't get data, simple its shows array() in address bar. so how to pass array value form one ctp to ctp in same controller. please help me out. I wrote code like this... MyConroller -- Myview->recursive = 1; $data = $this->Myview->find('all'); $this->set('rows',$data); } function export_xls($data) { $this->set('rows',$data); $this->render('export_xls','export_xls'); } } ?> --- ctp files display.ctp .tableTd { border-width: 0.5pt; border: solid; } .tableTdContent{ border-width: 0.5pt; border: solid; } #titles{ font-weight: bolder; } Export To Excel Sample Date: Number of Rows: Column 1 Column 2 '; echo ''.$row['Myview']['no'].''; echo ''.$row['Myview']['name'].''; echo ''; endforeach; ?> image('button_excel_onclick.gif', array('border' => '0', 'url' => array('controller'=> 'myviews', 'action' => 'export_xls', $rows))); ?> - export_xls.ctp .tableTd { border-width: 0.5pt; border: solid; } .tableTdContent{ border-width: 0.5pt; border: solid; } #titles{ font-weight: bolder; } Export To Excel Sample Date: Number of Rows: Column 1 Column 2 '; echo ''.$row['Myview']['no'].''; echo ''.$row['Myview']['name'].''; echo ''; endforeach; ?> --- please any one can help me out..! thanks in advance...! 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: how i call function in cake link
On 2 Jun 2010, at 12:21, Dilip Godhani wrote: > e($html->link('Edit',array('controller'=>'dashboards','action'=>'partner/'.$data[$i]['Partner']['id']))); > ?> by reading how in the book http://book.cakephp.org/view/836/link -- Mike Karthäuser Managing Director - Brightstorm Ltd Email: mi...@brightstorm.co.uk Web: http://www.brightstorm.co.uk Tel: 07939 252144 Address: 1 Brewery Court, North Street, Bristol, BS3 1JS 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
find('first') query cakephp1.2 vs 1.3
I'm porting my app from cakephp 1.2 to 1.3 and followed all steps in the migration guide. Still having troubles with find queries. I have quite some queries doing: $this->User->id = 4; $data = $this->User->find('first'); Cake 1.2 builds the following query: SELECT `User`.`id`, FROM `users` AS `User` WHERE `User`.`id` = 4 ORDER BY `name` ASC LIMIT 1 Cake 1.3.1 builds a different query: SELECT `User`.`id`, FROM `users` AS `User` WHERE 1 = 1 ORDER BY `name` ASC LIMIT 1 I just get the first record, but not the one that matches the set id. I like the short and readable notation of this query. Is this a wrong way of retreiving model data? Should I go for the long notation (including the conditions option that tells find to search for User.id = 4) ?? Or is it a cake bug? Bests, Bram 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
how i call function in cake link
link('Edit',array('controller'=>'dashboards','action'=>'partner/'.$data[$i]['Partner']['id']))); ?> -- Dilip Godhani Jr Software Developer, Entourage Solutions e-mail: di...@entouragesolutions.com dilip.godh...@gmail.com Web.: www.entouragesolutions.com m. 9913822582 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: Release: CakePHP 1.3.1
For the bake problem: http://groups.google.com/group/cake-php/browse_thread/thread/fddcb1c8f628d5ee On Jun 2, 6:01 am, Quess wrote: > Beside that what you guys say I also can't bake any model files, after > baking is done model files are empty (file size = 0) so I back to > 1.3.0 > > On 30 Maj, 02:48, Sergei wrote: > > > > > Hi, > > > just tried 1.3.1 with one of my project (Cake 1.3). It instantly gave > > me an errors on almost *every* page (see below). Removing TMP\cache > > \persistent\ files doesn't help. > > > = > > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of > > 1661 bytes [CORE\cake\libs\cache\file.php, line 176] > > Code | Context > > $key = "cake_core_file_map" > > $time = 1275179913 > > $cachetime = 1275179919 > > $data = "" > > unserialize - [internal], line ?? > > FileEngine::read() - CORE\cake\libs\cache\file.php, line 176 > > Cache::read() - CORE\cake\libs\cache.php, line 347 > > App::getInstance() - CORE\cake\libs\configure.php, line 967 > > App::build() - CORE\cake\libs\configure.php, line 650 > > Configure::__loadBootstrap() - CORE\cake\libs\configure.php, line 431 > > Configure::getInstance() - CORE\cake\libs\configure.php, line 52 > > include - CORE\cake\bootstrap.php, line 38 > > [main] - APP\webroot\index.php, line 77 > > > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of > > 28 bytes [CORE\cake\libs\cache\file.php, line 176] > > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of > > 5 bytes [CORE\cake\libs\cache\file.php, line 176] > > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of > > 105 bytes [CORE\cake\libs\cache\file.php, line 176] > > == > > > On May 30, 2:29 am, mark_story wrote: > > > > The CakePHP development team is happy to announce the release of > > > CakePHP 1.3.1[1]. 1.3.1 is the first maintenance release for 1.3 and > > > contains bugfixes and optimizations for features found in 1.3. No new > > > features will be introduced in the maintenance releases for 1.3. > > > Regular maintenance releases for 1.3 are planned on a monthly basis > > > for the near future. > > > > Since the release of CakePHP 1.3.0 last month, there have been more > > > than 70 commits and 45 tickets resolved. There have been a few changes > > > that may affect your application. > > > > - The conditional check around including custom session configuration > > > files was removed. This fixes issues where requestAction could cause > > > loss of session settings, and improves the end developers ability to > > > customize the session. Custom session files should ensure that > > > classes/functions are conditionally declared. > > > > - How virtualFields are detected and parsed was modified to allow > > > virtualFields on the same table. A virtualFieldSeparator property was > > > added to DboSource to allow customization of the virtualField > > > separator. If you have fields containing '__' you may have to modify > > > this setting to avoid issues. > > > > - EmailComponent had a number of changes made to better support ELHO > > > and slow SMTP servers. > > > > Be sure to check the full changelog[2] for all changes that have > > > occurred. We'd like to welcome Juan Basso[3] to the development team. > > > Juan has been very active in the brazilian community and we're really > > > happy to have him. Work on the 2.0 branch continues to progress. > > > Currently much of the effort is focused on getting our migration to > > > PHPUnit complete. We'd like to thank the ongoing community efforts > > > around the documentation. There are now over 18,500 revisions in the > > > cookbook and 4 languages now have more than 70% of the documentation > > > translated. > > > > As always, thank you for helping us make a great framework and > > > fantastic community. > > > > Download a packaged release [1] > > > View the changelog [2] > > > > [1]http://github.com/cakephp/cakephp/downloads > > > [2]http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-1 > > > [3]http://blog.cakephp-brasil.org/ 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: cakephp.lighthouseapp.com does not show tickets
Virker fint hos mig med FF 3.6.3! Enjoy, John On May 31, 10:09 pm, desolat wrote: > When visitinghttp://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets > with Firefox 3.6.3 no tickets are shown. div at looks like that: > > 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
how to activate child afterDelete callbacks when i delete parent model?
hi, i have a parent model that hasMany child models. when the child model is deleted, i need to delete the images associated with the child model. hence i want to place it in the afterDelete callback of the child model. now the association of parent with child is like this: var $hasMany = array( 'Child' => array( 'className' => 'Child', 'foreignKey' => 'parent_id', 'dependent' => true, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => true, 'finderQuery' => '', 'counterQuery' => '' ), ); how do i activate the child afterDelete when i delete parent? 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: Release: CakePHP 1.3.1
Beside that what you guys say I also can't bake any model files, after baking is done model files are empty (file size = 0) so I back to 1.3.0 On 30 Maj, 02:48, Sergei wrote: > Hi, > > just tried 1.3.1 with one of my project (Cake 1.3). It instantly gave > me an errors on almost *every* page (see below). Removing TMP\cache > \persistent\ files doesn't help. > > = > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of > 1661 bytes [CORE\cake\libs\cache\file.php, line 176] > Code | Context > $key = "cake_core_file_map" > $time = 1275179913 > $cachetime = 1275179919 > $data = "" > unserialize - [internal], line ?? > FileEngine::read() - CORE\cake\libs\cache\file.php, line 176 > Cache::read() - CORE\cake\libs\cache.php, line 347 > App::getInstance() - CORE\cake\libs\configure.php, line 967 > App::build() - CORE\cake\libs\configure.php, line 650 > Configure::__loadBootstrap() - CORE\cake\libs\configure.php, line 431 > Configure::getInstance() - CORE\cake\libs\configure.php, line 52 > include - CORE\cake\bootstrap.php, line 38 > [main] - APP\webroot\index.php, line 77 > > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of > 28 bytes [CORE\cake\libs\cache\file.php, line 176] > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of > 5 bytes [CORE\cake\libs\cache\file.php, line 176] > Notice (8): unserialize() [function.unserialize]: Error at offset 0 of > 105 bytes [CORE\cake\libs\cache\file.php, line 176] > == > > On May 30, 2:29 am, mark_story wrote: > > > > > The CakePHP development team is happy to announce the release of > > CakePHP 1.3.1[1]. 1.3.1 is the first maintenance release for 1.3 and > > contains bugfixes and optimizations for features found in 1.3. No new > > features will be introduced in the maintenance releases for 1.3. > > Regular maintenance releases for 1.3 are planned on a monthly basis > > for the near future. > > > Since the release of CakePHP 1.3.0 last month, there have been more > > than 70 commits and 45 tickets resolved. There have been a few changes > > that may affect your application. > > > - The conditional check around including custom session configuration > > files was removed. This fixes issues where requestAction could cause > > loss of session settings, and improves the end developers ability to > > customize the session. Custom session files should ensure that > > classes/functions are conditionally declared. > > > - How virtualFields are detected and parsed was modified to allow > > virtualFields on the same table. A virtualFieldSeparator property was > > added to DboSource to allow customization of the virtualField > > separator. If you have fields containing '__' you may have to modify > > this setting to avoid issues. > > > - EmailComponent had a number of changes made to better support ELHO > > and slow SMTP servers. > > > Be sure to check the full changelog[2] for all changes that have > > occurred. We'd like to welcome Juan Basso[3] to the development team. > > Juan has been very active in the brazilian community and we're really > > happy to have him. Work on the 2.0 branch continues to progress. > > Currently much of the effort is focused on getting our migration to > > PHPUnit complete. We'd like to thank the ongoing community efforts > > around the documentation. There are now over 18,500 revisions in the > > cookbook and 4 languages now have more than 70% of the documentation > > translated. > > > As always, thank you for helping us make a great framework and > > fantastic community. > > > Download a packaged release [1] > > View the changelog [2] > > > [1]http://github.com/cakephp/cakephp/downloads > > [2]http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-1 > > [3]http://blog.cakephp-brasil.org/ 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: Order problem with deep association
Not sure if I understood the question, but if you want Alix to appear before Shantam you can sort the assignment array with Set::sort Assuming your data array is called $shifts, you could do it like this foreach($shifts as $i => $shift) { $shifts[$i]['Assignment'] = Set::sort($data['Assignment'], '{n}.Person.name', 'asc'); } On Jun 2, 5:52 am, shantamg wrote: > Shift hasMany Assignment > Assignment belongsTo Person, Shift > Person hasMany Assignment > > So if I do this: > > $this->Shift->find('all', array( > 'contain' => 'Assignment.Person' > )); > > I get something like this: > > Array > ( > [0] => Array > ( > [Shift] => Array > ( > [id] => 1 > etc... > [Assignment] => Array > ( > [0] => Array > ( > [id] => 1 > [person_id] => 1 > [shift_id] => 1 > etc... > [Person] => Array > ( > [id] => 1 > [name] => Shantam > etc... > ) > ) > [1] => Array > ( > [id] => 2 > [person_id] => 2 > [shift_id] => 1 > etc... > [Person] => Array > ( > [id] => 2 > [name] => Alix > etc... > ) > ) > etc > ) > ) > ) > > So there's only ever one Person per Assignment. How can I order the > Assignments by Person.name? > > Thanks, > Jason 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