Re: User Management\Login\Auth Framework
Oh also a good idea to add HumanCheck or some kind of CAPTCHA on the forgotpassword and register pages (even if turned off by default you may need it later) -Ben On Feb 8, 4:10 pm, Mr-Yellow <[EMAIL PROTECTED]> wrote: > DAuth (patch in forgotpassword etc) + Cake ACL (patch in multi-groups > or whatever) > > Good > start:http://www.realm3.com/articles/setting_up_user_groups_with_acl_and_au... > > -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: User Management\Login\Auth Framework
DAuth (patch in forgotpassword etc) + Cake ACL (patch in multi-groups or whatever) Good start: http://www.realm3.com/articles/setting_up_user_groups_with_acl_and_auth_in_cakephp_1.2 -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: user authentication example...login redirects
>From the first Error message It looks your Cache directory is not writable. and The third message regarding Cannot modify header information.. I Use Writing ob_start(); just next line to PHP start tags before starting my controller class and ob_clean(); just before my php end tags and after the end of my controller class. It is PHP way, but it worked for me in Cake too. Hope this helps. On Feb 8, 9:36 am, polomasta <[EMAIL PROTECTED]> wrote: > no luck yet, I tried this as well: > > $this->redirect(array('controller'=>'users','action'=>'login')); > > I'm also getting these things in the debug area... > > Warning (512): /var/www/html/bradsCakeApp/app/tmp/cache/ is not > writable [CORE/cake/libs/cache/file.php, line 263] > > Notice (8): Use of undefined constant VALID_NOT_EMPTY - assumed > 'VALID_NOT_EMPTY' [CORE/cake/dispatcher.php, line 508] > > Warning (2): Cannot modify header information - headers already sent > by (output started at /var/www/html/bradsCakeApp/cake/basics.php:194) > [CORE/cake/libs/controller/controller.php, line 546] > > I've double checked all my files for extra whitespace at the end of > files and can't find anything. I'm not sure what else to try. Really > appreciate any additional help. > > _brad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: user authentication example...login redirects
no luck yet, I tried this as well: $this->redirect(array('controller'=>'users','action'=>'login')); I'm also getting these things in the debug area... Warning (512): /var/www/html/bradsCakeApp/app/tmp/cache/ is not writable [CORE/cake/libs/cache/file.php, line 263] Notice (8): Use of undefined constant VALID_NOT_EMPTY - assumed 'VALID_NOT_EMPTY' [CORE/cake/dispatcher.php, line 508] Warning (2): Cannot modify header information - headers already sent by (output started at /var/www/html/bradsCakeApp/cake/basics.php:194) [CORE/cake/libs/controller/controller.php, line 546] I've double checked all my files for extra whitespace at the end of files and can't find anything. I'm not sure what else to try. Really appreciate any additional help. _brad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Dispatcher baseUrl method setting wrong webroot variable in CakePhp 1.2
Look at dispatcher.test.php, line 1031. There's a whole set of tests dedicated to emulating different server environments in order to test the paths which the Dispatcher generates. Please add your settings to the list, along with the 'path' expected, and open a ticket with a diff of your changes attached. On Feb 7, 7:25 pm, Gerardo Glez <[EMAIL PROTECTED]> wrote: > I have recently change from version 1.19 to 1.2 and I start to have > problems with routes. I note something odd when Cake thinks that my > webroot directory is a controller. > > I have the following dir configuration (that works fine in cake 1.19) > > site-->www-->app-->myApp > site->www-->cake > site->www->webroot->index.php > > I have checked the path in the index.php and everithing is fine. But > when I try to link to my css and images the webroot var is set to / > site/www/ instead of /site/www/webroot/ > > I do a litle bit o research and find the problem in the Dispatcher > class, because the method baseUrl was setting wrong my webroot > directory. So I comment the lines 414 to 424, because after that > lines the webroot is set with the value of base dir wich value at that > moment is wrong > > if ($webroot === 'webroot' && $webroot === basename($base)) { > $base = dirname($base); > } > if ($dir === 'app' && $dir === > basename($base)) { > $base = dirname($base); > } > > if (in_array($base, array(DS, '.'))) { > $base = ''; > } > > > > someone else is having the same trouble? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Model Association Query....stumped
All - I've been using Mariano Iglesias Bindable behavior with 1.2 beta to nice effect, but I've run into a query I can't figure out. Here's what I have: Team hasMany Clip Team hasMany Site Site hasMany Clipranking A Site can play any of the Clips available in their Team in whatever ranked order they wish. The Clipranking table contains a field 'rank' and 'clip_id'. Clipranking and Clip are not related (at least not now...). In my Sites controller I want to retrieve all the Cliprankings and get the Clip data that corresponds to the 'clip_id'. I can't seem to get a query or on the fly BindModel() that will get me what I want. I guess I'm obtuse. I've never done a HBTM relationship before, and maybe that's what I need? I'm open to any suggestions or noob sledgehammering for not seeing it. Much obliged, Jeremy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: user authentication example...login redirects
try using the full path in the login redirect, i.e. $this->redirect('/users/login'); you also should add the 'true' tag, if you are using CakePHP1.2, to automatically call the exit() function after the redirect. i.e. $this->redirect('/users/login', true); Hope this helps! On Feb 7, 2008 5:43 PM, polomasta <[EMAIL PROTECTED]> wrote: > > i've been trying to implement that scattered examples of user > registration/authentication systems and without much success. I know > it's due to my lack of sKiLLz or whatever, but I could use some help. > > The code i have creates my user and puts it into the database just > fine..but after that, nothing happens... no flash, no redirect. I > can't figure it out. here is my register code in the users_controller: > > function register() { >if (!empty($this->data)) { >if ($this->data['User']['password'] == $this->Auth- > >password($this->data['User']['password_confirm'])) { >$this->User->create(); >$this->User->save($this->data); >$this->redirect('login'); >} >} >} > > what am I doing wrong? > > > -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS d- s+: a19 C UL++ P L++ !E W++ N(-) o? K? w(+) O? M-- V? PS+ PE Y- PGP- t+ 5? X- R tv-- b++ Di D+ G+ e h! r y- --END GEEK CODE BLOCK-- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Adding a radio groups destroys text input validation
I have a form with a text input field with validation code that works just fine... until I add a radio group to the form. Then if I enter invalid data the whole thing crashes without generating an error message (I have debug on). Is there a way to validate the radio group input? Is this a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Bug in $model->saveAll in 1.2
Use the newest SVN copy: svn co https://svn.cakephp.org/repo/trunk/cake/1.2.x.x /path/to/save On Feb 7, 5:00 pm, gerhardsletten <[EMAIL PROTECTED]> wrote: > Hi FL1 > > Where do i find the 6337 release? > And I can't see any //return true; in the model.php saveAll function > on line 1349. > > BTW: Rgarg thanks for the tip! > > Gerhard > > On Feb 6, 3:49 pm, FL1 <[EMAIL PROTECTED]> wrote: > > > It's not returning true on success because the "return true;" was left > > out in the beta release. You can either grab any release after 6337 > > (beta was 6311) or go into cake's model.php and add the return at the > > end of the saveAll function and it should work like a dream. > > > On Feb 5, 5:07 pm, gerhardsletten <[EMAIL PROTECTED]> wrote: > > > > I am trying to save related models with saveAll, but it will not > > > return true even if it succeed to save: > > > > if($this->Contentclass->ContentclassAttribute->saveAll($this->data['Content > > > classAttribute'])) { > > > > $this->Session->setFlash(__('The Contentclass and all attributes > > > has been saved', true)); > > > $this->redirect(array('action'=>'edit', $id));} else { > > > > $this->Session->setFlash(__('The Contentclass was saved but the > > > attributes faild to saved', true)); > > > > } > > > > In the api it says True on success, or an array of validation errors > > > on failure public. > > > > Is this a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL caching?
Cake1.2 var $cacheQueries = true; In cake/libs/model/db_acl.php I thought the URL below was where I saw the docs say that it should be true for ACL (can't see that anymore), however when I set it to true the cache wasn't cleared when modifications were made as intended. http://api.cakephp.org/1.2/class_model.html#75f9b4a0f5c2080e6c31b1121d0b5ff3 So short answer is "maybe not", with an "unintended results". -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: new mssql driver
There will be a new version of mssql driver from Microsoft in a couple of weeks which will supercede the one you are using. If what i have heard is correct then there are several API changes as well. So if I were you I would wait a while - well in fact I am waiting ;) I too have a similar work in progress... Cheers Tarique On Feb 8, 2008 3:32 AM, emrah <[EMAIL PROTECTED]> wrote: > > As you heard or not microsoft declared that, php will not be > compatible with current mssql dlls. As a result they published a new > dll called sqlsrv.dll for usage in 2008 versions. I tried to write the > new driver of it for cake, I 'm able to overcome errors but it doesn't > see my tables. > > you can find microsofts new php driver and its documentation from > > http://www.microsoft.com/sql/technologies/php/default.mspx > > here is my cake driver, ( I know there are some missing parameters, > and functions but it is in progress) I'm waiting your supplies > rename extension as php. > > http://www.samanyolu.k12.tr/dbo_sqlsrv.txt > > Thanks :) > > > > > -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Dispatcher baseUrl method setting wrong webroot variable in CakePhp 1.2
I have recently change from version 1.19 to 1.2 and I start to have problems with routes. I note something odd when Cake thinks that my webroot directory is a controller. I have the following dir configuration (that works fine in cake 1.19) site-->www-->app-->myApp site->www-->cake site->www->webroot->index.php I have checked the path in the index.php and everithing is fine. But when I try to link to my css and images the webroot var is set to / site/www/ instead of /site/www/webroot/ I do a litle bit o research and find the problem in the Dispatcher class, because the method baseUrl was setting wrong my webroot directory. So I comment the lines 414 to 424, because after that lines the webroot is set with the value of base dir wich value at that moment is wrong if ($webroot === 'webroot' && $webroot === basename($base)) { $base = dirname($base); } if ($dir === 'app' && $dir === basename($base)) { $base = dirname($base); } if (in_array($base, array(DS, '.'))) { $base = ''; } someone else is having the same trouble? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
user authentication example...login redirects
i've been trying to implement that scattered examples of user registration/authentication systems and without much success. I know it's due to my lack of sKiLLz or whatever, but I could use some help. The code i have creates my user and puts it into the database just fine..but after that, nothing happens... no flash, no redirect. I can't figure it out. here is my register code in the users_controller: function register() { if (!empty($this->data)) { if ($this->data['User']['password'] == $this->Auth- >password($this->data['User']['password_confirm'])) { $this->User->create(); $this->User->save($this->data); $this->redirect('login'); } } } what am I doing wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Can A Permanent Place Be Found for the IBM Articles about CakePHP 1.1?
I was talking to Duane O'Brien today to try to find out what happened to the 1.1 version of the IBM articles. I started working through these articles but they all changed to 1.2 before I got through them. IMHO as long as 1.1 is the stable version, somebody needs to make the 1.1 version of the IBM articles available. --Dave Aiello --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Configuration and usage of CakePHP with SQLite
Hi folks, currently I am getting mad trying to bring CakePHP together with SQLite. Lets tell you my settings first: On a Windows system running Lighttpd with PHP 5.2.5 and unpacked cake_1.1.19.6305.tar.bz2. The php sqlite extension is uncommented and running. The default start website of CakePHP shows up correctly and tells me: Your database configuration file is present. Cake is able to connect to the database. My database.php looks like this: class DATABASE_CONFIG { var $default = array('driver' => 'sqlite', 'connect' => 'sqlite_popen', 'host' => 'localhost', 'login' => 'user', 'password' => 'password', 'database' => 'posts', 'prefix' => ''); var $test = array('driver' => 'mysql', 'connect' => 'mysql_connect', 'host' => 'localhost', 'login' => 'user', 'password' => 'password', 'database' => 'project_name-test', 'prefix' => ''); } My directory layout is like this (some here not so important dirs left out): Lighttpd - htdocs -- app -- posts (the SQLite 2.1 file) - PHP The files in the app dir are created as described in The Cake Blog Tutorial. However if I go to the address http://localhost/posts/index I get a "404 - Not Found" error. Another mysterium is, that I can set any name for 'database' and Cake still tells me "Cake is able to connect to the database." and creates a 0 byte file in the htdocs dir. I'd really appreciate any help! Thanks alot, Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
new mssql driver
As you heard or not microsoft declared that, php will not be compatible with current mssql dlls. As a result they published a new dll called sqlsrv.dll for usage in 2008 versions. I tried to write the new driver of it for cake, I 'm able to overcome errors but it doesn't see my tables. you can find microsofts new php driver and its documentation from http://www.microsoft.com/sql/technologies/php/default.mspx here is my cake driver, ( I know there are some missing parameters, and functions but it is in progress) I'm waiting your supplies rename extension as php. http://www.samanyolu.k12.tr/dbo_sqlsrv.txt Thanks :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Custom Component and Redirect problem
If you just wanna test if the timestamp is there, you can simply "exit" before doing the redirect(). You could just do this: pr($timeStamp); exit(); if you expect an array.. if you expect just a string exit($timeStamp); will do the same trick.. as an alternative to pr() which is just the print_r() output with a tag around it, you can use var_dump($timeStamp); to get more details. If you are happy with the results, remove the exit() and continue.. Another way is to take a decent remote debugger with an IDE that uses it. That way you can save yourself from doing all that print_r and echo stuff.. Good IDEs are Zend Studio and Komodo Pro. HTH, Kjell On Feb 7, 2008 11:43 PM, Micro <[EMAIL PROTECTED]> wrote: > > I am using CakePhp 1.2 So, I created a component called Date. I > embedded in my class following the example. > > My controller class: > > class TradesController extends AppController { > >var $name = 'Trades'; >var $components = array('Date'); >var $helpers = array('Html', 'Form'); > > function index() { > >} > > function add() { >$timeStamp = $this->Date->getTimestamp(); > print_r($timeStamp); >$this->redirect(array('action'=>'index')); > } > > } > > I get this error > > Warning (2): Cannot modify header information - headers already sent > by (output started at C:\xampplite\htdocs\cake12\app\controllers > \components\date.php:119) [CORE\cake\libs\controller\controller.php, > line 546] > > > If I uncomment the $this->redirect(array('action'=>'index')), my > component works perfectly fine, and i don't get any error. I try to > comment out the component part, and it works fine. The problem only > occurs when I use my custom component and has the redirect line. Any > clue? Thank you. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
HABTM between models with different db configs
I'm currently combining two web apps, both with their own databases (but located on the same server). One app is Pligg-based and handles user-authentication. The other app (mine) is CakePHP-based, and manages all of the "resources." I can create CakePHP models representing the user in Pligg's tables using a custom dbconfig, etc. Reading/writing it are no problem. I've also created Cake models representing my resources and can read/write them, no problem. Users can own multiple resources and resources can have multiple owners, so I believe HABTM is the right association between the models. When specifying HABTM, it's possible to specify a custom table for the association (convention would be "resources_users"), but I'm not able to (AFAIK) specify a custom dbconfig as well. The error is that whichever model gets traversed first goes looking for the association table in its dbconfig, which it will find (for one model) or it won't (for the other model). So, is what I'm looking to do possible? Or am I going to have to do the joins, etc., with straight SQL queries? (Or, more likely, just combine the databases into one for now.) Thanks, Troy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Custom Component and Redirect problem
El 07/02/2008, a las 23:43, Micro escribió: > If I uncomment the $this->redirect(array('action'=>'index')), my > component works perfectly fine, and i don't get any error. I try to > comment out the component part, and it works fine. The problem only > occurs when I use my custom component and has the redirect line. Any > clue? Redirect sends headers, and you has just printed a result. You have to rethink the code. -- Fran Iglesias [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Custom Component and Redirect problem
I am using CakePhp 1.2 So, I created a component called Date. I embedded in my class following the example. My controller class: class TradesController extends AppController { var $name = 'Trades'; var $components = array('Date'); var $helpers = array('Html', 'Form'); function index() { } function add() { $timeStamp = $this->Date->getTimestamp(); print_r($timeStamp); $this->redirect(array('action'=>'index')); } } I get this error Warning (2): Cannot modify header information - headers already sent by (output started at C:\xampplite\htdocs\cake12\app\controllers \components\date.php:119) [CORE\cake\libs\controller\controller.php, line 546] If I uncomment the $this->redirect(array('action'=>'index')), my component works perfectly fine, and i don't get any error. I try to comment out the component part, and it works fine. The problem only occurs when I use my custom component and has the redirect line. Any clue? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Bug in $model->saveAll in 1.2
Hi FL1 Where do i find the 6337 release? And I can't see any //return true; in the model.php saveAll function on line 1349. BTW: Rgarg thanks for the tip! Gerhard On Feb 6, 3:49 pm, FL1 <[EMAIL PROTECTED]> wrote: > It's not returning true on success because the "return true;" was left > out in the beta release. You can either grab any release after 6337 > (beta was 6311) or go into cake's model.php and add the return at the > end of the saveAll function and it should work like a dream. > > On Feb 5, 5:07 pm, gerhardsletten <[EMAIL PROTECTED]> wrote: > > > I am trying to save related models with saveAll, but it will not > > return true even if it succeed to save: > > > if($this->Contentclass->ContentclassAttribute->saveAll($this->data['Content > > classAttribute'])) { > > > $this->Session->setFlash(__('The Contentclass and all attributes > > has been saved', true)); > > $this->redirect(array('action'=>'edit', $id));} else { > > > $this->Session->setFlash(__('The Contentclass was saved but the > > attributes faild to saved', true)); > > > } > > > In the api it says True on success, or an array of validation errors > > on failure public. > > > Is this a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: User Management\Login\Auth Framework
You might want to try this one by Mariano: It uses phpgacl which is a generic php acl app. http://dev.sypad.com/installing-phpgacl-plugin-cakephp Later, Codecowboy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 1.2.x.x Autocomplete Ajax Helper not working
Dear group, I have fixed this by removing the "Security" component from my components list in the controller. Evidently the security component kills the ajax requests. Is this a bug or a feature? Thanks, Seth On Feb 6, 4:23 pm, seedifferently <[EMAIL PROTECTED]> wrote: > Hello group, > > I've been trying to get the ajax helperautocompleteexample in the > tempdocs for 1.2.x.x working but for some reason it just doesn't seem > to be functioning properly for me. > > I'm using firebug in firefox, and when I start typing in theautocompletefield > firebug shows me the following: > POSThttp://localhost/myapp/orders/auto_complete/ 404(123ms) > prototype.js (line 1222) > > I would assume this to mean that prototype is throwing a "404" error > for theautocompletefield, however if I point firefox > tohttp://localhost/myapp/orders/auto_complete/it shows the list as it > should. > > My orders_controller.php file: > > function auto_complete() { > $this->set('companies', $this->Order->findAll("WHERE `company` LIKE > '%seedifferently%'")); // {$this->data['Order']['company']} > $this->layout = 'ajax'; > > } > > My order view file snippet: > > echo $ajax->autoComplete('company', '/orders/auto_complete/', > array('minChars' => 2, 'frequency' => 0.8)) > > My auto complete view file: > > > > > > > > > > What would the problem be here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: SOLVED Re: cake is ignoring my hasMany/belongsTo (noob)
On Feb 7, 2008 1:30 PM, sbeam <[EMAIL PROTECTED]> wrote: > > sorry folks I had model/project.php named as model/projects.php - I > finally realized Cake was ignoring the whole thing, without > complaining. So moral of the story - watch your cases and inflections! > just like ROR, figuring out what should be plural/singular or > camelCase/under_score_separated is a PITA (esp. for noobs) > Learn them http://manual.cakephp.org/appendix/conventions Live them http://tempdocs.cakephp.org/#TOC20140 when starting out you will be much happier. When you get the real feel of the framework then break them bust em and really stretch them -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction on crashes apache
On Feb 7, 9:21 pm, majna <[EMAIL PROTECTED]> wrote: > There is no autoload for components, so requestAction is better for > maintenance. > (cached elements with requestAction). Don't know what that means but: Subjective your honor! :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Beautiful URLs with tree behaviour
On Feb 7, 9:29 pm, martinp <[EMAIL PROTECTED]> wrote: > Thanks AD for your ideas. > > My thinking is that if I store the whole slug in the slug field (ie > with the ancestors) then that will be a unique key to search for the > data from (I'll validate this to make sure it is). The typical problem with such logic is what happens when a typo is made and corrected. >I guess I'll also > have to handle the fact that the user may change their location > setting, in which case a redirect to the correct URL based on the page > ID will be needed. if you change your from DE to ES (for example) you won't be able to find the slug (without checking all languages) to be able to redirect to the right url. > > My problem now is to read the slug from the i18n table when looking up > the correct record in my 'pagina' table (that's just what I've called > it). How do I do this? Can you help? without something unique that doesn't change depending on the site language, with a bit of work, sweat and tears I would say :). hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why forcing by default the primary key to be 'id'?
It can be whatever, but just like regular SQL, the user will need to manually keep track when inserting, etc. Search the Api for the Model Class. On Feb 7, 2008 2:18 PM, majna <[EMAIL PROTECTED]> wrote: > > Can primary key be id, but without auto_increment in 1.2? > > On 7 velj, 21:12, jakecake <[EMAIL PROTECTED]> wrote: > > > Some things are simply more practical. You need certain conventions or > there > > > would be a gazillion configurations that need to be set before you can > > > start. > > > > However it seems that most of the conventions can be overridden by > > configuration, so that odd situations can be managed. > > > > Jake > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
SOLVED Re: cake is ignoring my hasMany/belongsTo (noob)
sorry folks I had model/project.php named as model/projects.php - I finally realized Cake was ignoring the whole thing, without complaining. So moral of the story - watch your cases and inflections! just like ROR, figuring out what should be plural/singular or camelCase/under_score_separated is a PITA (esp. for noobs) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Beautiful URLs with tree behaviour
Thanks AD for your ideas. My thinking is that if I store the whole slug in the slug field (ie with the ancestors) then that will be a unique key to search for the data from (I'll validate this to make sure it is). I guess I'll also have to handle the fact that the user may change their location setting, in which case a redirect to the correct URL based on the page ID will be needed. My problem now is to read the slug from the i18n table when looking up the correct record in my 'pagina' table (that's just what I've called it). How do I do this? Can you help? On Feb 7, 9:04 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Feb 7, 8:34 pm, martinp <[EMAIL PROTECTED]> wrote: > > > I should maybe also add that I'm trying to also implement the > > Translate Behaviour with this and the slug field would be hopefully be > > translatable as well, so it has to read from the i18n table. > > I would recommend using urls of the form > /a number/whatever/you/want > > or any url so long as you have something unique and in a specific > place to find what you are looking for and > where 'a number' is (probably) the id of the item with the slug "want" > > Then > Use the number to find what you are looking for; > Check the slug is what it should be and redirect to the correct > id/slug if not > Move along, nothing to see here. > > if you want users to be able to type their own urls to find stuff; > have /search/I/want/this redirect to /a number/I/want/this if it > exists etc. > > Especially useful tactic if you want multilingual content to be > reflected in the url. > > my 2c, hth, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Programmatically creating/saving HABTM
Great that was it, thanks After I updated another issue popped up related to using variables declared with define(). Was something done in the latest cakePHP to cause a problem with these defined vars? I am using phpCAS which is riddled with those types of declarations. Thanks again!! Michael On Feb 7, 11:46 am, jakecake <[EMAIL PROTECTED]> wrote: > That's a known bug > :http://groups.google.com/group/cake-php/browse_thread/thread/2ad48c4e... > > Try to update to a recent version of cake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction on crashes apache
There is no autoload for components, so requestAction is better for maintenance. (cached elements with requestAction). On 7 velj, 21:10, AD7six <[EMAIL PROTECTED]> wrote: > On Feb 7, 5:35 pm, benniog <[EMAIL PROTECTED]> wrote: > > > Thanks for the replies... > > I am trying to get dynamic content into the default layout (a side bar > > containing latest news items).. thats why I can only think of using > > requestAction... does that make more sense? > > See the frequent discussions page I, for reasons that will become > obvious, would recommend using a component based (mini-controller) > approach. > > hth, > > AD( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why forcing by default the primary key to be 'id'?
Can primary key be id, but without auto_increment in 1.2? On 7 velj, 21:12, jakecake <[EMAIL PROTECTED]> wrote: > > Some things are simply more practical. You need certain conventions or there > > would be a gazillion configurations that need to be set before you can > > start. > > However it seems that most of the conventions can be overridden by > configuration, so that odd situations can be managed. > > Jake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Associating data with a HABTM join?
Make a model for your join table (ProductCustomers / whatever) In the habtm, use the 'with' index to specify this model. This only works in recent versions of 1.2 though, can't remember which revision it actually came out in. simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why forcing by default the primary key to be 'id'?
> Some things are simply more practical. You need certain conventions or there > would be a gazillion configurations that need to be set before you can > start. However it seems that most of the conventions can be overridden by configuration, so that odd situations can be managed. Jake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction on crashes apache
On Feb 7, 5:35 pm, benniog <[EMAIL PROTECTED]> wrote: > Thanks for the replies... > I am trying to get dynamic content into the default layout (a side bar > containing latest news items).. thats why I can only think of using > requestAction... does that make more sense? See the frequent discussions page I, for reasons that will become obvious, would recommend using a component based (mini-controller) approach. hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Associating data with a HABTM join?
I am working with a HABTM join as follows: Customer <--HABTM--> Product I want to take this one step further and associate a discount % with each join - ie each Customer -> Product relationship has a specific discount. The goal is so that CustomerA and CustomerB could both have the "Rubber Duckie" product available, but due to differing business arrangements, we might offer CustomerA a 50% wholesale discount but only offer a 25% discount to CustomerB. I already added a discount float field in the customers_products table, and while it doesn't break the relationship in Cake, I am not sure how to access any additional data stored on the join table. I can write out the SQL query by hand to accomplish this, but I would like to keep it within Cake's API as much as possible. Suspect it may have something to do with modifying the finder query in one/both of the models? Or am I out of luck? Thanks in advance for any assistance. -Brad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
cake is ignoring my hasMany/belongsTo (noob)
I am starting out with Cake after messing with RoR for a while. I jumped right in with a project where 'ArtWorks' are organized into 'Projects'. I wrote it all thusly: === class Project extends AppModel { var $hasMany = array('PubWorks' => array('className' => 'ArtWork', 'foreignKey'=> 'project_id', 'dependent' => true, 'exclusive' => false)); } - class ArtWork extends AppModel { var $belongsTo = array('Project' => array('className' => 'Project', 'foreignKey' => 'project_id' ) ); } class ProjectsController extends AppController { function show($id) { $w = $this->Project->read(); print "DEBUG: at line " . __LINE__ . ' of ' . __FILE__ . "\n"; print_r($w); print ''; } } = I have set up the DB correctly with FKs using mySQL InnoDB. And entered some sample data. But when I call http://localhost/projects/show/2 I get the debug dump of: DEBUG: at line 8 of /xxx/cake_1.2.0.6311-beta/app/controllers/ projects_controller.php Array ( [Project] => Array ( [id] => 2 [name] => War Room [begin_date] => -00-00 ) ) = no sign of the ArtWorks belonging to the Project. The SQL dumps show the artworks table was never queried. I am out of ideas, according to the manual this should work right? What am I missing? thanks Sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Beautiful URLs with tree behaviour
On Feb 7, 8:34 pm, martinp <[EMAIL PROTECTED]> wrote: > I should maybe also add that I'm trying to also implement the > Translate Behaviour with this and the slug field would be hopefully be > translatable as well, so it has to read from the i18n table. I would recommend using urls of the form /a number/whatever/you/want or any url so long as you have something unique and in a specific place to find what you are looking for and where 'a number' is (probably) the id of the item with the slug "want" Then Use the number to find what you are looking for; Check the slug is what it should be and redirect to the correct id/slug if not Move along, nothing to see here. if you want users to be able to type their own urls to find stuff; have /search/I/want/this redirect to /a number/I/want/this if it exists etc. Especially useful tactic if you want multilingual content to be reflected in the url. my 2c, hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
Thanks John for the reply. I really look forward to the new wiki-like application. - Rajesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
Rajesh, The new application is very wiki-like. It allows easy contributions (hopefully). It's different in that it has more structure (data is in tree form) and there's an approval/revision process built in. We hope it'll make things easier - hopefully we can have something to show really soon. -- John On Feb 7, 2008, at 12:42 PM, Rajesh wrote: > > I ever think that you understood what i wrote. i just tried to explain > what would ease the pressure on you guys. If there was a discussion > previously on wiki, you could have just said "NO for a wiki" or "Its > on the way" but not they way you had said. > > I just started cakePHP for about 4 months now and i don't or i can't > read all the postings in this group. I just search if i wanted > something.I just found out that there was a previous discussion on > wiki and what _psychic_ had replied. > > Given the duration of my learning in cakephp, i will not be able to > write pages of documentation at this point, but atleast i can help > find/edit something that is not correct or that can be enhanced to my > knowledge. > > On Feb 7, 1:58 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: >> On Feb 7, 2008 1:03 PM, Rajesh <[EMAIL PROTECTED]> wrote: >> >> >> >>> Just a suggestion, why not open up a WIKI where everyone can >>> contribute and have a set of people as Moderators, that way sending >>> emails back and forth for documentation would reduce and also that >>> would ease the load on the people writing the current documentation. >> >>> -Rajesh >> >> Again with the same old tired refrain about the inexplicable need for >> a wiki. Does nobody read the emails that our overworked and >> underappreciated documentation expert _psychic_ puts out? Because in >> those emails he's talked several times about a wiki-like solution >> that >> is on the way. >> >> If you have your heart set on a wiki, then put one up yourself and >> tell the list about it. Given the level of participation in the >> current documentation project, I'd be surprised if you get anything >> of >> value posted. >> >> -- >> Chris Hartjes >> Internet Loudmouth >> Motto for 2008: "Moving from herding elephants to handling snakes..." >> @TheKeyBoard:http://www.littlehart.net/atthekeyboard > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why forcing by default the primary key to be 'id'?
I'm not sure that a lot of people really understand what's going on behind the scenes here. You are writing code that writes code. Some things are simply more practical. You need certain conventions or there would be a gazillion configurations that need to be set before you can start. Sorry for the rant. I'm not even on the team On Feb 7, 2008 6:29 AM, RichardAtHome <[EMAIL PROTECTED]> wrote: > > I doubt the naming of any keys would have any effect on database > performance. > > CakePHP is flexible enough to allow you to use any primary key name in > your tables, but if you use the recommended format you will find that > cake does a lot more automatically. > > See Model::primaryKey ( > http://api.cakephp.org/1.2/class_model.html#19ba09de3c283f574a175db48a6acab4 > ) > > On Feb 7, 11:04 am, Guillaume Chomat <[EMAIL PROTECTED]> > wrote: > > Hi everyone, > > > > I'm little newby in cake so perhaps it would be simple to answer to my > > concerns. > > According to my knowledge a natural join is better when the two joined > > fields have the same name. > > In the cake policy the primary key and referenced one have different > > name: 'id' and '_id. > > Is the performance issue minor in join queries? What the initial > > reason to chooce this policy? > > > > Best regards. > > > > PS: Thanks for the cake team for this very great job. I hope to be > > able to participate for the evolution of our framework in 2008. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
I ever think that you understood what i wrote. i just tried to explain what would ease the pressure on you guys. If there was a discussion previously on wiki, you could have just said "NO for a wiki" or "Its on the way" but not they way you had said. I just started cakePHP for about 4 months now and i don't or i can't read all the postings in this group. I just search if i wanted something.I just found out that there was a previous discussion on wiki and what _psychic_ had replied. Given the duration of my learning in cakephp, i will not be able to write pages of documentation at this point, but atleast i can help find/edit something that is not correct or that can be enhanced to my knowledge. On Feb 7, 1:58 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Feb 7, 2008 1:03 PM, Rajesh <[EMAIL PROTECTED]> wrote: > > > > > Just a suggestion, why not open up a WIKI where everyone can > > contribute and have a set of people as Moderators, that way sending > > emails back and forth for documentation would reduce and also that > > would ease the load on the people writing the current documentation. > > > -Rajesh > > Again with the same old tired refrain about the inexplicable need for > a wiki. Does nobody read the emails that our overworked and > underappreciated documentation expert _psychic_ puts out? Because in > those emails he's talked several times about a wiki-like solution that > is on the way. > > If you have your heart set on a wiki, then put one up yourself and > tell the list about it. Given the level of participation in the > current documentation project, I'd be surprised if you get anything of > value posted. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: form error detection (1.2)
$form->error(, array('div' => 'classForDiv', 'id' => 'id for field')); This would give you a wrapping div and/id and id on the field. or: FormHelper::isFieldError (...) returns true on error in field. On Feb 7, 2008 1:24 PM, <[EMAIL PROTECTED]> wrote: > > The problem is more cosmetic where I have a line box around the > errors. I need to be able to detect errors before I use form->error() > otherwise I have a visible box with no content. I am hoping I missed > something in API doc that behave like the old > HtmlHelper::validateErrors. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Beautiful URLs with tree behaviour
I should maybe also add that I'm trying to also implement the Translate Behaviour with this and the slug field would be hopefully be translatable as well, so it has to read from the i18n table. I'm thinking that maybe I have to store the entire URL in the slug field - eg 'common-expressions/greetings/hello' rather than just 'hello' to implement this. When a page is added or moved I would need to loop through all the ancestors and build the slug before the save. Am I on the right track here? This is my controller at the moment: function index($slug = null) { $pagina = $this->Pagina->findBySlug($slug); if(empty($pagina)) { $this->Session->setFlash(__('Sorry, this page could not be found.', true)); //$this->redirect(somewhere); } else { $this->set('pagina', $pagina); } } But it's not reading the slug from the i18n table. All help gratefully received. On Feb 7, 7:12 pm, martinp <[EMAIL PROTECTED]> wrote: > I'm getting to grips with the Tree behaviour in 1.2, but what I really > want to be able to do is have sections and sub-sections in my URLs as > required. > > For example, if my page, "hello", had a parent, "greetings", which in > turn had a parent, "common-expressions", I'd like my URL to be /common- > expressions/greetings/hello > > Does anyone have any pointers on how to implement this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: form error detection (1.2)
The problem is more cosmetic where I have a line box around the errors. I need to be able to detect errors before I use form->error() otherwise I have a visible box with no content. I am hoping I missed something in API doc that behave like the old HtmlHelper::validateErrors. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
Ok ok ok, enough of all this talk Pointing fingers is going to help. I gather that people are busy, due to CakeFest etc. But when that's done, I'm expecting someone to send me a link or something telling me where to go to sign up for stuff. Because I've heard tons of complaints about nobody being willing to help with docs. I admit (for reasons previously stated) that I had my reservations. However, since it has been made abundantly clear that being new is NOT a problem, let's get this thing going. 1. Is there an existing system that you guys use or do I just start blabbing away? 2. Should I just focus on incomplete stuff in tempdocs or should I add to what I already know? 3. Can I add code? I personally find code examples EXTREMELY useful? 4. Assuming the API is generated off the code, can I maybe add examples to the doc blocks of some functions? $form anyone? 5. How does the Bakery fit into all of this? Will it be used for stuff not in the core? 6. Finally, just tell me where to sign up. Zoe, no offense intended, but I agree with John, someone needs to start working on the official docs, otherwise CakePHP will remain an underground framework. Just ask the folks who have tried to convince bosses and project managers to use CakePHP. I'm willing to help, point me in the right direction. -- Baz L Web Development 2.0 http://WebDevelopment2.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: form error detection (1.2)
echo $form->error(...) only returns something if there's an errorNo need to wrap in a condition. On Feb 7, 2008 12:23 PM, <[EMAIL PROTECTED]> wrote: > > Hi, > > I am looking for means to detect if any errors exist in a form and > then wrap my errors in a div. The deprecated > HtmlHelper::validateErrors would work by returning an error count but > according to API doc form->errors should now be used. The problem is > that this method appears not to currently exist. Can anyone suggest a > clean way of doing this ? > > i.e > > if(form has errors) { > if($form->isFieldError(...) > echo $form->error(...) > .. > } > > Thanks, > > Tom > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
On Feb 7, 2008 1:03 PM, Rajesh <[EMAIL PROTECTED]> wrote: > > Just a suggestion, why not open up a WIKI where everyone can > contribute and have a set of people as Moderators, that way sending > emails back and forth for documentation would reduce and also that > would ease the load on the people writing the current documentation. > > -Rajesh Again with the same old tired refrain about the inexplicable need for a wiki. Does nobody read the emails that our overworked and underappreciated documentation expert _psychic_ puts out? Because in those emails he's talked several times about a wiki-like solution that is on the way. If you have your heart set on a wiki, then put one up yourself and tell the list about it. Given the level of participation in the current documentation project, I'd be surprised if you get anything of value posted. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
I like that one. On Feb 7, 2008 4:03 PM, Rajesh <[EMAIL PROTECTED]> wrote: > > Just a suggestion, why not open up a WIKI where everyone can > contribute and have a set of people as Moderators, that way sending > emails back and forth for documentation would reduce and also that > would ease the load on the people writing the current documentation. > > -Rajesh > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
form error detection (1.2)
Hi, I am looking for means to detect if any errors exist in a form and then wrap my errors in a div. The deprecated HtmlHelper::validateErrors would work by returning an error count but according to API doc form->errors should now be used. The problem is that this method appears not to currently exist. Can anyone suggest a clean way of doing this ? i.e if(form has errors) { if($form->isFieldError(...) echo $form->error(...) .. } Thanks, Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Beautiful URLs with tree behaviour
I'm getting to grips with the Tree behaviour in 1.2, but what I really want to be able to do is have sections and sub-sections in my URLs as required. For example, if my page, "hello", had a parent, "greetings", which in turn had a parent, "common-expressions", I'd like my URL to be /common- expressions/greetings/hello Does anyone have any pointers on how to implement this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
Just a suggestion, why not open up a WIKI where everyone can contribute and have a set of people as Moderators, that way sending emails back and forth for documentation would reduce and also that would ease the load on the people writing the current documentation. -Rajesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $belongsTo Inserts Line
Thanks to anyone who has any insight. m On Feb 6, 10:06 pm, Mark <[EMAIL PROTECTED]> wrote: > Hi everyone: > > I have a model that is inserting a blank like at the top of the > produced page. I've tracked the problem to the $belongsTo variable. If > I take $belongsTo out of the model I don't get the blank line. The > model also has a $hasMany but it doesn't cause any trouble. > > Most of the time a blank line at the top of your page wouldn't be a > problem, but I'm trying to produce an xml file and the first line in > the document needs to be . > > Has anybody else run into this problem? Please find my model's code > below (note that I don't have an extra carriage return at the end of > the class in my source code): > > class Photographer extends AppModel > { > var $name = 'Photographer'; > > var $validate = array( > 'firstName' => VALID_NOT_EMPTY > ); > > var $belongsTo = array('Region' => > array('className' => 'Region', > 'conditions' => '', > 'order' => '', > 'foreignKey' => 'region_id' > ), > 'Country' => > array('className' => 'Country', > 'conditions' => '', > 'order' => '', > 'foreignKey' => 'country_id' > ), > 'City' => > array('className' => 'City', > 'conditions' => '', > 'order' => '', > 'foreignKey' => 'city_id' > ) > ); > > var $hasMany = array('Portfolio' => > array('className' => 'Portfolio', > 'conditions' => '', > 'order' => '', > 'limit' => '', > 'foreignKey' => 'photographer_id', > 'dependent' => true, > 'exclusive' => false, > 'finderQuery' => '', > 'fields' => '', > 'offset' => '', > 'counterQuery' => '' > ) > ); > > } > > ?> > > Thanks! > Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with new feature to create List
You'd do that in your view: $form->input('article', array('empty' => true)); or $form->input('article', array('empty' => 'Please select an article')); On Feb 7, 2008 9:29 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I migrated to cake 1.2 and i have a little problem with the new list > creation. > Before, that was easy to let a blank element il front of the list. > But now, with this code: > > $articles = $this->Article->find("all", array('fields' => > array('Article.id','Article.titre') )); > $result = > Set::combine($articles,'{n}.Article.id','{n}.Article.titre'); > > How can i do the same thing?? > > Thanks for your help > > Gil > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
On Feb 7, 2008, at 6:17 AM, MonkeyGirl wrote: > > find a better way of doing something and I'll update my guide to do it > that way instead." > > If I was writing official documentation, I'd feel like I was saying > "this is how it's *supposed* to be done, how it *should* be done." I > don't feel confident enough to make that claim. There's plenty of eyes that go on official docs before they go out the door. Helping the official docs effort doesn't mean we give you the keys and walk away. No one (especially at first) really has publishing power like that. It's a collaborative effort. Most people submitting docs just hand me what they have. I edit the submissions for (grammar, spelling) voice, style, etc but we also edit for completeness and correctness. Sometimes I'll hand it back with some suggestions, but I mostly try to iron out what I can in order to make the submission process easier. Being too new shouldn't be a problem, nor is a worry about accuracy. > If anyone else can get the documentation and code commenting to the > stage where us early adopters of CakePHP 1.2 can see what each method > of each class is doing in sufficient detail, I'm sure we can all group > together and help with the official documentation. I'd be happy to, > and it looks like others are too. Experience shows that they aren't. Experience shows that I *can't* get "someone else" to do that. It wasn't that way with 1.1, at least. Forgive me for being frank, but no one likes to help in the docs. Most people prefer to either 1: complain without helping, or 2: publish things themselves. The problem with 1 is obvious, and the problem with 2 is that we're unfocused as a community. Why are people publishing their own rather than jumping in to an official effort? It's probably some combination of these: 1. The submission process isn't clear (my fault) 2. Docs are a moving target for beta software (my fault) 3. People enjoy the credit and traffic self-published material generates 4. The docs situation is too bad to be helped (my fault), or 5. The docs situation isn't as bad as people think. I'm about ready to try the experiment of quitting, mostly to see if I'm the bottleneck. Maybe that's the problem, I don't really know. It's hard to see how I'm really doing, because I don't feel like I've ever really had an abundance of support. In two years, there's only a handful of people that have contributed multiple times (that aren't already overwhelmed with core team responsibilities). In any case, this is really like waiting to take your medicine until you feel well. Why would we need documentation if everyone "can see what each method of each class is doing in sufficient detail" ? If we're doing that, I think we're nearly done. It's rather obvious we need help *now*. :) > Is this something we can do together? I hope I'm not out of line with > these suggestions, I'm just trying to help bridge the gap between > those who are great at writing code, and those like myself who are > perhaps not so good at programming, but are still good at explaining > how things work in simpler terms. Right now I'm working on getting our new docs application online and ready for everyone. Everyone else is at Cakefest this week, so it's been hard to make decisions on things. Stay tuned, I'm working as best I can to solve these problems. I'm banking on the guess that this docs app will help out the docs process, so here's hoping. Thanks for the input, -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Programmatically creating/saving HABTM
That's a known bug : http://groups.google.com/group/cake-php/browse_thread/thread/2ad48c4e10f58fc0/c7c4511051071b52 Try to update to a recent version of cake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction on crashes apache
Thanks for the replies... I am trying to get dynamic content into the default layout (a side bar containing latest news items).. thats why I can only think of using requestAction... does that make more sense? Thanks Gary On Feb 7, 4:28 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Feb 7, 2008 11:16 AM, benniog <[EMAIL PROTECTED]> wrote: > > > > > Whats the alternative? > > I need to get data from the DB and i cant think of any other way to do > > it... > > Um, what's wrong with using the existing methods in a model or > creating custom methods in your model to return the data in the format > you need, then pass it to the view or wherever else it needs to go. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem merging arrays. String-keys are cast as numners.
That looks like exactly what I am looking for. Thanks a lot! On Feb 7, 5:17 pm, Claudia <[EMAIL PROTECTED]> wrote: > I am not sure whether this will bring the desired result but have a > look at the union > operatorhttp://lu.php.net/manual/en/language.operators.array.php > > Good luck > > Claudia > > On Feb 7, 4:07 pm, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > This is not strictly a CakePHP question but I hope that is OK. > > > I am trying to merge two arrays. One containing dummy-data for each > > hour of the day, the other containing actual data extracted from a > > model for only some hours. > > > All keys are strings but keys that looks like nice integers to php > > gets treated as such. That sucks. I specifically set them as string > > for a reason. for a number of good and bad reasons I really don't want > > to rethink everything around this by using all numbers. I also would > > like to avoid using another for-loop when there are merge-functions. > > > Is there a way to get array_merge() or Set::merge() to comply? > > Is there a way to merge these two arrays in the way I would expect > > them to be merged? > > > code: > > Part of the dummy array > > ( > > [08] => 0 > > [09] => 0 > > [10] => 0 > > [11] => 0 > > [12] => 0 > > ) > > Part of the data to merge int it > > ( > > [10] => 5 > > [12] => 3 > > [09] => 4 > > ) > > Value '09' is padded and thus still a string. 10 and 12 is treated as > > numbers (dispite being generated as strings) and totally mess up the > > resulting array. The mess is different depending on the merge function > > I use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction on crashes apache
apache crashes how? out of memory, what? how do you expect someone to help you with so little information. returning a lot of stuff or a little, what's in the logs, want some love, show a little effort Can't help with nothing in the way of information here. Hey my car won't start... help On Feb 7, 2008 8:22 AM, benniog <[EMAIL PROTECTED]> wrote: > > Hi, > I'm a cake newbie writing my first app... > However, I have a problem that whenever I use requestAction ie. $this- > >requestAction("profiles/index"); Apache crashes !!! I'm not using > Zend optimizer which seems to have cause similar problems in the past, > so i'm a little stuck !!! > > As anyone any suggestions? > > Thanks in advance > Gary > > > > -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction on crashes apache
On Feb 7, 2008 11:16 AM, benniog <[EMAIL PROTECTED]> wrote: > > Whats the alternative? > I need to get data from the DB and i cant think of any other way to do > it... Um, what's wrong with using the existing methods in a model or creating custom methods in your model to return the data in the format you need, then pass it to the view or wherever else it needs to go. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Validate one or two fields?
I don't actually need to compare the information with that from the database, I just need to validate the data in the fields, preferably using the $validate array present in my User Model, in order to make sure that it is valid data for those fields, without having to add validation data to the controller On Feb 6, 2008 10:18 PM, Rgarg <[EMAIL PROTECTED]> wrote: > > > do you want to cum pair user written data with database?? > > > -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS d- s+: a19 C UL++ P L++ !E W++ N(-) o? K? w(+) O? M-- V? PS+ PE Y- PGP- t+ 5? X- R tv-- b++ Di D+ G+ e h! r y- --END GEEK CODE BLOCK-- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Programmatically creating/saving HABTM
Hello All!! Before posting this I searched around this group, the cake manual, and api but was unable to find any information related to my problem. I am hoping someone here knows of a solution or can point me to information related to what I am trying to do. I have the need to programmatically create and add additional items to a HABTM relationship. I wrote the following: $this->User = new User; $user = $this->User->create(array('username' => $uname)); $user['Tag'] = array(); array_push($user['Tag'], $auth_tag['Tag']); //$auth_tag is a valid object $this->User->log($user); $this->User->save($user); The log shows the object I created looks as follows: Array ( [User] => Array ( [username] => test ) [Tag] => Array ( [0] => Array ( [id] => 1 [name] => phpCAS [created] => [modified] => [tag_type_id] => 1 ) ) ) Which appears correct. The save does save the User object but does not create the Tag relationship. I also attempted to do this on an existing object: $user = $this->User->findByUsername('test'); array_push($user['Tag'], $auth_tag['Tag']); $this->User->log($user); $this->User->save($user); But still is does not save. Has anyone run into similar issues? Any suggestions on how I might archive this functionality? Thanks in advance for all the help -M --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem with new feature to create List
I migrated to cake 1.2 and i have a little problem with the new list creation. Before, that was easy to let a blank element il front of the list. But now, with this code: $articles = $this->Article->find("all", array('fields' => array('Article.id','Article.titre') )); $result = Set::combine($articles,'{n}.Article.id','{n}.Article.titre'); How can i do the same thing?? Thanks for your help Gil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: find(all) and preppend a third value using Combine
Thank you. $cities = $this->City->find('all', array('fields' => array('City.id', 'City.name', 'Country.iso2', 'Country.name'), 'order'=>'City.country_id ASC')); $citiesCombine = Set::combine($cities, '{n}.City.id', array('%s - %s', '{n}.Country.iso2', '{n}.City.name'), '{n}.Country.name'); $this->set('cities', $citiesCombine); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem merging arrays. String-keys are cast as numners.
I am not sure whether this will bring the desired result but have a look at the union operator http://lu.php.net/manual/en/language.operators.array.php Good luck Claudia On Feb 7, 4:07 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This is not strictly a CakePHP question but I hope that is OK. > > I am trying to merge two arrays. One containing dummy-data for each > hour of the day, the other containing actual data extracted from a > model for only some hours. > > All keys are strings but keys that looks like nice integers to php > gets treated as such. That sucks. I specifically set them as string > for a reason. for a number of good and bad reasons I really don't want > to rethink everything around this by using all numbers. I also would > like to avoid using another for-loop when there are merge-functions. > > Is there a way to get array_merge() or Set::merge() to comply? > Is there a way to merge these two arrays in the way I would expect > them to be merged? > > code: > Part of the dummy array > ( > [08] => 0 > [09] => 0 > [10] => 0 > [11] => 0 > [12] => 0 > ) > Part of the data to merge int it > ( > [10] => 5 > [12] => 3 > [09] => 4 > ) > Value '09' is padded and thus still a string. 10 and 12 is treated as > numbers (dispite being generated as strings) and totally mess up the > resulting array. The mess is different depending on the merge function > I use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction on crashes apache
Whats the alternative? I need to get data from the DB and i cant think of any other way to do it... On Feb 7, 4:12 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Feb 7, 4:22 pm, benniog <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm a cake newbie writing my first app... > > However, I have a problem that whenever I use requestAction ie. > > $this->requestAction("profiles/index"); Apache crashes !!! I'm not using > > > Zend optimizer which seems to have cause similar problems in the past, > > so i'm a little stuck !!! > > > As anyone any suggestions? > > Don't use requestAction? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction on crashes apache
On Feb 7, 4:22 pm, benniog <[EMAIL PROTECTED]> wrote: > Hi, > I'm a cake newbie writing my first app... > However, I have a problem that whenever I use requestAction ie. > $this->requestAction("profiles/index"); Apache crashes !!! I'm not using > > Zend optimizer which seems to have cause similar problems in the past, > so i'm a little stuck !!! > > As anyone any suggestions? Don't use requestAction? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
requestAction on crashes apache
Hi, I'm a cake newbie writing my first app... However, I have a problem that whenever I use requestAction ie. $this- >requestAction("profiles/index"); Apache crashes !!! I'm not using Zend optimizer which seems to have cause similar problems in the past, so i'm a little stuck !!! As anyone any suggestions? Thanks in advance Gary --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Fatal error: Call to a member function schema() on a non-object
fixed! - this may have been overkill, but i added defined var $uses = array(...) where "..." included all of the associated model classnames. On Feb 7, 10:42 am, aaron bauman <[EMAIL PROTECTED]> wrote: > I am hitting the same snag with a class called "Filter" with belongsTo > and habtm assoc's. > Is filter also a class already? > > On Feb 2, 4:17 pm, AD7six <[EMAIL PROTECTED]> wrote: > > > On Feb 2, 4:22 pm, "Doug @ Straw Dogs" <[EMAIL PROTECTED]> wrote: > > > > I'm having loads of problems using bake in 1.2 beta. The above error > > > ("Fatal error: Call to a member function schema() on a non-object") > > > occurs when I attempt to bake a view for my tables called "apps". > > > > It has multiple relationships to other tables. Mainly "hasMany" > > > relationships. > > > > I've created the controller and model. Although when I did create the > > > controller I also got errors: > > > > Warning: Invalid argument supplied for foreach() in /var/www/flex2/ > > > cake/console/libs/tasks/controller.php on line 291 > > > The problem is your choice of model name. > > > There is already a class named App*, and therefore as it already > > exists your model class named App will never, ever, be instanciated. > > > hth, > > > AD > > *http://api.cakephp.org/1.2/classes.html > > > > It didn't die that time but its disconcerting. > > > > Does anyone have any ideras on this or should I stick to 1.1 (which > > > I'm also having problems with)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Fatal error: Call to a member function schema() on a non-object
I am hitting the same snag with a class called "Filter" with belongsTo and habtm assoc's. Is filter also a class already? On Feb 2, 4:17 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Feb 2, 4:22 pm, "Doug @ Straw Dogs" <[EMAIL PROTECTED]> wrote: > > > I'm having loads of problems using bake in 1.2 beta. The above error > > ("Fatal error: Call to a member function schema() on a non-object") > > occurs when I attempt to bake a view for my tables called "apps". > > > It has multiple relationships to other tables. Mainly "hasMany" > > relationships. > > > I've created the controller and model. Although when I did create the > > controller I also got errors: > > > Warning: Invalid argument supplied for foreach() in /var/www/flex2/ > > cake/console/libs/tasks/controller.php on line 291 > > The problem is your choice of model name. > > There is already a class named App*, and therefore as it already > exists your model class named App will never, ever, be instanciated. > > hth, > > AD > *http://api.cakephp.org/1.2/classes.html > > > It didn't die that time but its disconcerting. > > > Does anyone have any ideras on this or should I stick to 1.1 (which > > I'm also having problems with)? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake PHP installation problem
see my sig On Feb 7, 2008 2:03 AM, Rgarg <[EMAIL PROTECTED]> wrote: > > Hi > > i am trying to cake php folder(cake_1.1.19.6305) on our server(eg > server.com). > > i have created model(product.php), views(view/products/index.thtml) > and controller(product_controller.php) > > everything working fine on http://server.com/cake_1.1.19.6305/products/index > > > when i try > http://server.com/cake_1.1.19.6305/ > > it shows index page with > > Your database configuration file is present. > > Cake is able to connect to the database. > > when i try http://server.com/cake_1.1.19.6305/products/index > > it shows error message > > The requested URL /cake1/products/ was not found on this server. > > What's the solution for this? > > > -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem merging arrays. String-keys are cast as numners.
This is not strictly a CakePHP question but I hope that is OK. I am trying to merge two arrays. One containing dummy-data for each hour of the day, the other containing actual data extracted from a model for only some hours. All keys are strings but keys that looks like nice integers to php gets treated as such. That sucks. I specifically set them as string for a reason. for a number of good and bad reasons I really don't want to rethink everything around this by using all numbers. I also would like to avoid using another for-loop when there are merge-functions. Is there a way to get array_merge() or Set::merge() to comply? Is there a way to merge these two arrays in the way I would expect them to be merged? code: Part of the dummy array ( [08] => 0 [09] => 0 [10] => 0 [11] => 0 [12] => 0 ) Part of the data to merge int it ( [10] => 5 [12] => 3 [09] => 4 ) Value '09' is padded and thus still a string. 10 and 12 is treated as numbers (dispite being generated as strings) and totally mess up the resulting array. The mess is different depending on the merge function I use. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Inner Join on hasMany
On Feb 7, 2:44 pm, Baz <[EMAIL PROTECTED]> wrote: > Hey AD7six, > > This sounds promising, but I'm unsure how to implement in my case. > >1. What would I use as the 'join table' since I have a Has Many and a >Belongs To? > > ThanX in advance. $this->bindModel(array('hasOne' => 'Dummy' => array('className' => 'Date'))); $conditions = array('Dummy.date_start' => '> ' . $start); $recursive = 1; $results = $this->find('all', compact('conditions', 'recursive')); // find all requests with at least one Date that starts in the future. Or similar. hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: find(all) and preppend a third value using Combine
On Feb 7, 2:06 pm, Josoroma <[EMAIL PROTECTED]> wrote: > Im trying to generate a select list, but before the value Citiy.name i > need to add Country.name like: > > Costa Rica - Heredia > EEUU - New York > > $cities = $this->City->find('all', array('fields' => array('City.id', > 'City.name', 'Country.name'), 'order'=>'City.country_id ASC')); > > My question is, how can i preppend the country name to the city name > using combine?: look for an example that does the same. e.g. https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/model/behaviors/tree.php?rev=6383#L301 hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Inner Join on hasMany
Hey AD7six, This sounds promising, but I'm unsure how to implement in my case. 1. What would I use as the 'join table' since I have a Has Many and a Belongs To? ThanX in advance. On Feb 7, 2008 3:50 AM, AD7six <[EMAIL PROTECTED]> wrote: > > > > On Feb 7, 7:03 am, Baz L <[EMAIL PROTECTED]> wrote: > > Any ideas anyone? > > See the frequent discussions page, the description for how to handle > habtm queries with conditions on both sites applies to hasMany too. > > hth, > > AD > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: find(all) and preppend a third value using Combine
Sorry, bit of a typo there - where I've got '{n}.Country.name', '{n}.Country.name' [several times] It should of course be '{n}.Country.name', '{n}.City.name' On Feb 7, 1:34 pm, grigri <[EMAIL PROTECTED]> wrote: > To do exactly what you want: > > $citiesCombine = Set::combine($cities, '{n}.City.id', array('%s - %s', > '{n}.Country.name', '{n}.Country.name')); > > But wouldn't you be better off generating option groups based on the > country? That's easy too: > > $citiesCombine = Set::combine($cities, '{n}.City.id', > '{n}.Country.name', '{n}.Country.name'); > > Also bear in mind that if you're not using the $cities variable > anywhere else, you can use find('list') to generate the list in one > call: > > [1] $citiesCombine = $this->City->find('list', array('recursive' => 0, > 'order' => [...], 'fields' => array('City.id', array('%s - %s', > 'Country.name', 'Country.name'))); > or > [2] $citiesCombine = $this->City->find('list', array('recursive' => 0, > 'order' => [...], 'fields' => array('City.id', 'Country.name', > 'Country.name')); > > (you just have to set the recursive because it defaults to -1, you > need 0 for the Country join) > > On Feb 7, 1:06 pm, Josoroma <[EMAIL PROTECTED]> wrote: > > > Im trying to generate a select list, but before the value Citiy.name i > > need to add Country.name like: > > > Costa Rica - Heredia > > EEUU - New York > > > $cities = $this->City->find('all', array('fields' => array('City.id', > > 'City.name', 'Country.name'), 'order'=>'City.country_id ASC')); > > > My question is, how can i preppend the country name to the city name > > using combine?: > > > $citiesCombine = Set::combine($cities, '{n}.City.id', > > '{n}.Country.name'); > > > thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: find(all) and preppend a third value using Combine
To do exactly what you want: $citiesCombine = Set::combine($cities, '{n}.City.id', array('%s - %s', '{n}.Country.name', '{n}.Country.name')); But wouldn't you be better off generating option groups based on the country? That's easy too: $citiesCombine = Set::combine($cities, '{n}.City.id', '{n}.Country.name', '{n}.Country.name'); Also bear in mind that if you're not using the $cities variable anywhere else, you can use find('list') to generate the list in one call: [1] $citiesCombine = $this->City->find('list', array('recursive' => 0, 'order' => [...], 'fields' => array('City.id', array('%s - %s', 'Country.name', 'Country.name'))); or [2] $citiesCombine = $this->City->find('list', array('recursive' => 0, 'order' => [...], 'fields' => array('City.id', 'Country.name', 'Country.name')); (you just have to set the recursive because it defaults to -1, you need 0 for the Country join) On Feb 7, 1:06 pm, Josoroma <[EMAIL PROTECTED]> wrote: > Im trying to generate a select list, but before the value Citiy.name i > need to add Country.name like: > > Costa Rica - Heredia > EEUU - New York > > $cities = $this->City->find('all', array('fields' => array('City.id', > 'City.name', 'Country.name'), 'order'=>'City.country_id ASC')); > > My question is, how can i preppend the country name to the city name > using combine?: > > $citiesCombine = Set::combine($cities, '{n}.City.id', > '{n}.Country.name'); > > thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
> By the way, I am Japanese. I think Japanese developers want to read > documents in Japanese. So I want to translate your guide into Japanese. > Can I do that? The way I understand the hacker spirit, everybody's free to share and build upon everyone else's work, which is what makes free software and the Internet so great. I can't speak for anyone else, but you're welcome to translate my guide into any language you'd like, and I'd be happy to host any translations of it. I'm guessing this is also the kind of help the official documentation also needs, and I agree that we should all be helping with that too. Thanks, Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp 1.2 pdfb helper
Andrés, With the information you are giving us there is little we can do to help you. Also, you didn't asked a question. Are you looking for another PDF solution? What does broken PDF means? Why don't you post the code of you controller/view? Cheers, On Feb 7, 2008 11:07 AM, Andrés Otárola <[EMAIL PROTECTED]> wrote: > > Hi people! > > I've been having trouble using the library pdfb as a helper, even > following the guide > http://bakery.cakephp.org/articles/view/barcode-with-cake > ( well, that's for 1.1 anyways...) > > ...the result is a broken pdf document > > > > any help would be appreciated... > > > > -- Matias Lespiau http://www.gignus.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem select
Hi grigri, can you tell me what options I must use to remove optgroup from my select? ìWhat you suggest not work for me, I think that the problem is in which way I format my selct box. thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
On Feb 6, 5:03 pm, Baz <[EMAIL PROTECTED]> wrote: > I'm never sure whether I'm doing things the "right" way. To be > honest, all this MVC stuff was brand new to me by the time I started. This > is why I've been hesitant to submit articles to the bakery, for example. > Since a lot of my stuff, can be considered patchwork, I wouldn't want to > mislead people searching for "official" solutions on the bakery (and even > Official Docs). That's why I usually keep my ramblings on my own blog. This sums up how I feel as well. I dived into using CakePHP maybe a year ago now, and it's taken me all this time to get from the stage where it works, all the way to the stage where I'm starting to use it in the proper MVC spirit. I find it difficult working out from the API/source code just what's going on. For example, it takes me anything up to an hour sometimes just to work out how to do something like disable labels using the form helper, trying to work out where all the different option array elements are being used. So I want to help other people out, but I worry I'm not doing things the right way. On my own site, I can say "this is how I'm making sites. It works, but it may not be the best way. Please tell me if you find a better way of doing something and I'll update my guide to do it that way instead." If I was writing official documentation, I'd feel like I was saying "this is how it's *supposed* to be done, how it *should* be done." I don't feel confident enough to make that claim. If anyone else can get the documentation and code commenting to the stage where us early adopters of CakePHP 1.2 can see what each method of each class is doing in sufficient detail, I'm sure we can all group together and help with the official documentation. I'd be happy to, and it looks like others are too. Is this something we can do together? I hope I'm not out of line with these suggestions, I'm just trying to help bridge the gap between those who are great at writing code, and those like myself who are perhaps not so good at programming, but are still good at explaining how things work in simpler terms. Thanks, Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
cakephp 1.2 pdfb helper
Hi people! I've been having trouble using the library pdfb as a helper, even following the guide http://bakery.cakephp.org/articles/view/barcode-with-cake ( well, that's for 1.1 anyways...) ...the result is a broken pdf document any help would be appreciated... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
find(all) and preppend a third value using Combine
Im trying to generate a select list, but before the value Citiy.name i need to add Country.name like: Costa Rica - Heredia EEUU - New York $cities = $this->City->find('all', array('fields' => array('City.id', 'City.name', 'Country.name'), 'order'=>'City.country_id ASC')); My question is, how can i preppend the country name to the city name using combine?: $citiesCombine = Set::combine($cities, '{n}.City.id', '{n}.Country.name'); thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP guide
> Settle down - I think you've completely over-reacted. Nate's comment > wasn't a flame, but yours was. While Nate's opinion might be correct here (up to a point), it is obvious that his people skills are not his forte.. This is not a flame, it is just an opinion. No hard feelings towards Nate, I still believe he's doing a great job; but if he's going to "attract" new community members with replies like (real quote) "Dude, you're confusing some very unrelated things." and never elaborate his statement, there is a great chance people will just run away. Nobody likes to be treated like an idiot, not even real idiots. So there. My 2c. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem select
Try : $this->set('regioni', $this->Provincia->Regione->find("list", array("fields"=>array("Regione.idregioni","Regione.nome"; On Feb 7, 12:14 pm, Reny <[EMAIL PROTECTED]> wrote: > On 7 Feb, 12:46, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > > > Try a pr($regioni) and see what you get, if it isn't something like > > array( 1 => "PIEMONTE", 2 => "..." ) then that is your problem. > > in my first select I load all italian regions in my db, the controller > method in my provincia controller is > > $this->set('regioni', $this->Provincia->Regione->find("all", > array("fields"=>array("Regione.idregioni","Regione.nome"),"recursive"=>0))); > > so in view > > echo $form->select('Regione.idregioni', array('options'=>$regioni), > null, array('id' => 'regioni'),false); > > I'd like to implement a method that in my first select I load my > regions and when I choose a region, in my second select I load the > prov. of region. > > when I load my region from db the log dump of set is > > Array > ( > [0] => Array > ( > [Regione] => Array > ( > [idregioni] => 1 > [nome] => PIEMONTE > ) > > ) > > [1] => Array > ( > [Regione] => Array > ( > [idregioni] => 2 > [nome] => VALLE D'AOSTA > ) > > ) > > [2] => Array > ( > [Regione] => Array > ( > [idregioni] => 3 > [nome] => LOMBARDIA > ) > > ) > > thanks ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why forcing by default the primary key to be 'id'?
I doubt the naming of any keys would have any effect on database performance. CakePHP is flexible enough to allow you to use any primary key name in your tables, but if you use the recommended format you will find that cake does a lot more automatically. See Model::primaryKey ( http://api.cakephp.org/1.2/class_model.html#19ba09de3c283f574a175db48a6acab4 ) On Feb 7, 11:04 am, Guillaume Chomat <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm little newby in cake so perhaps it would be simple to answer to my > concerns. > According to my knowledge a natural join is better when the two joined > fields have the same name. > In the cake policy the primary key and referenced one have different > name: 'id' and '_id. > Is the performance issue minor in join queries? What the initial > reason to chooce this policy? > > Best regards. > > PS: Thanks for the cake team for this very great job. I hope to be > able to participate for the evolution of our framework in 2008. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem select
On 7 Feb, 12:46, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote: > Try a pr($regioni) and see what you get, if it isn't something like > array( 1 => "PIEMONTE", 2 => "..." ) then that is your problem. in my first select I load all italian regions in my db, the controller method in my provincia controller is $this->set('regioni', $this->Provincia->Regione->find("all", array("fields"=>array("Regione.idregioni","Regione.nome"),"recursive"=>0))); so in view echo $form->select('Regione.idregioni', array('options'=>$regioni), null, array('id' => 'regioni'),false); I'd like to implement a method that in my first select I load my regions and when I choose a region, in my second select I load the prov. of region. when I load my region from db the log dump of set is Array ( [0] => Array ( [Regione] => Array ( [idregioni] => 1 [nome] => PIEMONTE ) ) [1] => Array ( [Regione] => Array ( [idregioni] => 2 [nome] => VALLE D'AOSTA ) ) [2] => Array ( [Regione] => Array ( [idregioni] => 3 [nome] => LOMBARDIA ) ) thanks ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL caching?
Hey folks, I'm wondering if its possible to enable caching for the ACLs somewhere globally? >From reading the tickets it was explicitly disabled because of it going wrong with adding/updating permissions. But I'm in a mostly read environment and the lots of queries just hurts ;). So, is there any way to explicitly enable caching for the acls beside hacking the db_acl.php? Thanks, thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Why forcing by default the primary key to be 'id'?
Hi everyone, I'm little newby in cake so perhaps it would be simple to answer to my concerns. According to my knowledge a natural join is better when the two joined fields have the same name. In the cake policy the primary key and referenced one have different name: 'id' and '_id. Is the performance issue minor in join queries? What the initial reason to chooce this policy? Best regards. PS: Thanks for the cake team for this very great job. I hope to be able to participate for the evolution of our framework in 2008. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem select
Try a pr($regioni) and see what you get, if it isn't something like array( 1 => "PIEMONTE", 2 => "..." ) then that is your problem. On Feb 7, 2008 8:47 AM, Reny <[EMAIL PROTECTED]> wrote: > > Hi all, > I have problem with select form helper > > I populate the select in this way > > echo $form->select('Regione.idregioni', array('options'=>$regioni), > null, array('id' => 'regioni'),false); > > $options was populate from controller > > this is the generate code > > > > > 1 > PIEMONTE > > > > 1) I want no optgroup in my select, I'll tried some possibility as > 'optgroup'=> false, on label ecc... but without result > > 2) I want > 1 > PIEMONTE > > must begun PIEMONTE > > thanks > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM filtering with indirect model relationship
Use a custom query, search this group or read Frequent Discussions page. On Feb 7, 2008 1:51 AM, patcoll <[EMAIL PROTECTED]> wrote: > > I have the following model structure set up: > > Model1 -hasOne- Model2 -hasAndBelongsToMany- Model3 > > I'm trying to run a paginate() call on Model1 (in Model1's controller) > while trying to pass custom conditions having to do with Model3. For > example: > > $results = $this->paginate('Model1', array('conditions' => > array('Model3.title' => 'LIKE %blah%'))); > > Of course it complains that Model3.title doesn't exist because the > query's not doing any join between Model2 and Model3. I've read all > the posts and articles about binding dummy hasOne associations before > doing my paginate call. > > OK, so I decided to put the dummy bindModel() in the beforeFind() > function in Model2. Then I did my paginate() call on Model2, but of > course now I'm querying the wrong data because I really need > paginate() support for Model1. Arg. > > Has anyone had any success solving this problem? I've seen lots of > solutions for filtering between two models that have a HABTM > relationship and the dummy bindModel() calls seem to work for that, > but this problem seems to be a different animal. Any ideas? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: bake
I think this is what you need: http://www.ad7six.com/MiBlog/CustomBakeTemplates - Dardo Sordi. PD: AD7six you are my hero, thanks for fixing #4000. On Feb 7, 2008 9:25 AM, zeugme <[EMAIL PROTECTED]> wrote: > > Thanks, I'll have a look. > > Why not reusing scaffold templates ? > Bake could be seen as a static scaffold, isn't it ? > So saving the result of a scaffold template could be the bake result. > Doing so will : > * merge that part > * make bake as flexible as scaffold > > I'm not sure ... I'll read that code, try to understand and I'll see ... > > Thanks again. > > > Takuo SHIONO wrote: > > Hello, > > > > The code to deduce table relationship is in ModelTask::doAssociations() > > defined in /cake/console/libs/tasks/model.php > > You also have to check Inflector class defined in > > /cake/libs/inflector.php. This define naming conventions. > > > > I think this mechanism is based on the cakePHP naming convention and > > there is no template for this purpose. So you need modify the source > > code in order to customize bake behaviors. > > > > > > Best Wishes, > > > > Takuo Shiono > > > > zeugme wrote: > > > >> Sorry for reposting but I really would like to custimize bake > >> generation, if it is possible. > >> Are there templates ? Same as scaffolding ? > >> > >> Also, I need more info on table relationship taken into account in the > >> generated model. > >> > >> Any clue appreciated, including pointer to the cake code > >> > >> zeugme wrote: > >> > >>> Hi the list ! > >>> > >>> Do you know if the bake generator is able to deduce table relationship > >>> when it generate the model ? > >>> If it is possible, I suppose it need a DB strict name convention ... any > >>> info, doc, tuto, examples, > >>> > >>> Also, how to customize baked view, model, controller ? Any tips, > >>> example, recommendation ? > >>> Where could I find documented all the "special variable" available ? > >>> (I'm guessing I'll need an array of the field in a view for example) > >>> > >>> Thanks ! > >>> > >>> > >>> > >> > > > > > > > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Just a dumb question
Thanks, Grigri. I nearly bought a GriGri once but found them a little awkward to use. L On Feb 7, 12:11 pm, grigri <[EMAIL PROTECTED]> wrote: > In HTML, newlines are counted as spaces, and multiple consecutive > spaces are displayed as one single space, unless the content is inside > a element. > > In plain old php, the way to properly display print_r (in HTML) is > this: > > ' . htmlentities(print_r($variable, true)) . ' pre>'; ?> > > var_dump doesn't have a return parameter; you have to do: > > ob_start(); > var_dump($variable); > $dump = ob_get_contents(); > ob_end_clean(); > echo '' . htmlentities($dump) . ''; > ?> > > But in CakePHP, the best way is just to do > > > > Which will format the code inside a tag (with class 'cake- > debug') and add the line it was called from. As an added bonus, it > only displays if you're in debug mode - in production mode debug() > calls are ignored. > > On Feb 7, 10:48 am, leo <[EMAIL PROTECTED]> wrote: > > > Does anybody know why my var_dump.s and print_r.s all display without > > format? Could it be a browser config? > > > It all just appears as one continuous string. This isn't just cake, > > it's plain old PHP too. > > > It's something I've been meaning to investigate for years, but never > > got around to doing so. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: turn off certain associations for a model
Also note that is Mariano, not Martin. On Feb 6, 2008 9:06 PM, Baz <[EMAIL PROTECTED]> wrote: > Well it depends... > > If you only want to turn OFF a few, unbind() is fine. The bindable behavior > really shines when you only want to ADD a few... > > > > On Feb 6, 2008 4:20 PM, Robby Anderson <[EMAIL PROTECTED]> wrote: > > > > > > > I'm using Martin's behavior, and its very, very useful. > > > > -r > > > > > > > > > > On Feb 6, 11:32 am, Defranco <[EMAIL PROTECTED]> wrote: > > > Hi Dardo, > > > > > > Very interesting this article. > > > > > > Thanks for the reply. > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: bake
Thanks, I'll have a look. Why not reusing scaffold templates ? Bake could be seen as a static scaffold, isn't it ? So saving the result of a scaffold template could be the bake result. Doing so will : * merge that part * make bake as flexible as scaffold I'm not sure ... I'll read that code, try to understand and I'll see ... Thanks again. Takuo SHIONO wrote: > Hello, > > The code to deduce table relationship is in ModelTask::doAssociations() > defined in /cake/console/libs/tasks/model.php > You also have to check Inflector class defined in > /cake/libs/inflector.php. This define naming conventions. > > I think this mechanism is based on the cakePHP naming convention and > there is no template for this purpose. So you need modify the source > code in order to customize bake behaviors. > > > Best Wishes, > > Takuo Shiono > > zeugme wrote: > >> Sorry for reposting but I really would like to custimize bake >> generation, if it is possible. >> Are there templates ? Same as scaffolding ? >> >> Also, I need more info on table relationship taken into account in the >> generated model. >> >> Any clue appreciated, including pointer to the cake code >> >> zeugme wrote: >> >>> Hi the list ! >>> >>> Do you know if the bake generator is able to deduce table relationship >>> when it generate the model ? >>> If it is possible, I suppose it need a DB strict name convention ... any >>> info, doc, tuto, examples, >>> >>> Also, how to customize baked view, model, controller ? Any tips, >>> example, recommendation ? >>> Where could I find documented all the "special variable" available ? >>> (I'm guessing I'll need an array of the field in a view for example) >>> >>> Thanks ! >>> >>> >>> >> > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Multiple Schemas in PostgreSQL
Thanks for the answer. i was thinking that would be my last hope, to write custom queries for those models. But I think i found a way around this issue playing around with the dbo_postgre file, so far, i havent had any troubles, but i think it wont work if you have tables with the same name in several schemas, anyway, im using this fix which i posted on my blog (its in spanish *use google translator ) http://www.prothotype.com/blog/archives/644/manejar-multiples-schemas-con-postgres-en-cakephp-12/ On Feb 6, 2:50 pm, "b logica" <[EMAIL PROTECTED]> wrote: > On Feb 1, 2008 2:35 PM, Prozac <[EMAIL PROTECTED]> wrote: > > > > > Hi, im new at this group and also kind of new using cakePHP, im having > > a problem with an app im working on with multiple schemas. > > > Now, in this app there are tables relations between schemas, at first > > i thought i could use a different connection for each schema, but > > that didn't work. > > > I found in this group that someone appear to have worked this out in > > this > > threadhttp://groups.google.com/group/cake-php/browse_thread/thread/4f3fcad4... > > but i don't quite get it, and come to think that its no the same > > (could be my poor english) > > That was me. Sorry, that was all pretty complicated. I was also > discussing more than one problem, really. > > Anyway, I never did figure out how to get Cake to use more than one > schema. From examining the source, it appears that a lot of changes > would be necessary before it could work. However, I can still make > queries across schemas, but I have to make the queries directly. But I > don't think that you'll be able to get Cake to honour your > associations if the tables are in different schemas. In my case, I > could do what I needed with a query in afterFind(). > > If you look at the file dbo_postgres.php you might see something that > I missed. Unfortunately, I don't have any time to try to fix this, > myself. It looks like phpnut was working on this earlier. But I have a > feeling that the problem lies more with how Cake works rather than > something that a change in dbo_postgres.php could fix :-( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Just a dumb question
In HTML, newlines are counted as spaces, and multiple consecutive spaces are displayed as one single space, unless the content is inside a element. In plain old php, the way to properly display print_r (in HTML) is this: ' . htmlentities(print_r($variable, true)) . ''; ?> var_dump doesn't have a return parameter; you have to do: ' . htmlentities($dump) . ''; ?> But in CakePHP, the best way is just to do Which will format the code inside a tag (with class 'cake- debug') and add the line it was called from. As an added bonus, it only displays if you're in debug mode - in production mode debug() calls are ignored. On Feb 7, 10:48 am, leo <[EMAIL PROTECTED]> wrote: > Does anybody know why my var_dump.s and print_r.s all display without > format? Could it be a browser config? > > It all just appears as one continuous string. This isn't just cake, > it's plain old PHP too. > > It's something I've been meaning to investigate for years, but never > got around to doing so. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Inner Join on hasMany
http://groups.google.com/group/cake-php/browse_thread/thread/9f092441185a5b72/f32a7b86bc9ec5d1?lnk=gst&q=%22inner+join%22#f32a7b86bc9ec5d1[[BR On Feb 7, 2008 8:00 AM, grigri <[EMAIL PROTECTED]> wrote: > > The easiest way to simulate an INNER join from a LEFT is to impose a > not-null condition on the PK of the joined field. > > Assuming you're using the bindable behavior to add a left join, your > SQL will look like this: > > SELECT [...] FROM `requests` AS `Request` LEFT JOIN `dates` AS `Date` > ON (...) WHERE (...) > > you need to add an external condition (not inside the ON ()), so the > sql is like this > > SELECT [...] FROM `requests` AS `Request` LEFT JOIN `dates` AS `Date` > ON (...) WHERE (`Date`.`id` IS NOT NULL AND (...)) > > You can add that through the $conditions parameter of the find method, > should be simple enough. > > On Feb 7, 6:03 am, Baz L <[EMAIL PROTECTED]> wrote: > > Any ideas anyone? > > -- > > Baz L > > Web Development 2.0: Web Design, CakePHP, > > Javascripthttp://www.WebDevelopment2.com/ > > > > > On Dec 10 2007, 2:55 pm, Baz <[EMAIL PROTECTED]> wrote: > > > > > Hey guys...this is what I'm trying to accomplish: > > > > > I got a model (Request). Each request hasMany Dates. > > > > > I'm doing a simple find on the Request, but I ONLY want to return those > > > requests that have a certain date range. > > > > > I'm been able to using the excellent Bindable behavior to set the > > > condition > > > on the Date. > > > > > But, it always brings back ALL the requests. > > > > > After, I'm having to loop through the array and remove requests where the > > > ...['Request']['Date'] array is empty. Beside the fact that this is > > > extremely sloppy (sorry had a deadline - this is just a demo anyway), it's > > > messing up the numbering on my paginator. > > > > > Any ideas on how to do this simply? > > > Someone once mentioned adding 'type' => 'INNER' to the association, but > > > that > > > didn't work (also didn't find code to support it). > > > > > Any ideas? ThanX in advance. > > > > > BTW: Using Cake 1.2 Nightly (12-08-07) > > > -- > > > Baz L > > > Web Development 2.0http://WebDevelopment2.com/ > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Just a dumb question
Does anybody know why my var_dump.s and print_r.s all display without format? Could it be a browser config? It all just appears as one continuous string. This isn't just cake, it's plain old PHP too. It's something I've been meaning to investigate for years, but never got around to doing so. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem select
Hi all, I have problem with select form helper I populate the select in this way echo $form->select('Regione.idregioni', array('options'=>$regioni), null, array('id' => 'regioni'),false); $options was populate from controller this is the generate code 1 PIEMONTE 1) I want no optgroup in my select, I'll tried some possibility as 'optgroup'=> false, on label ecc... but without result 2) I want 1 PIEMONTE must begun PIEMONTE thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---