Re: XML output from cake controller/view
digital spaghetti wrote: Instead of your method, check out this tutorial: http://bakery.cakephp.org/articles/view/2 Its an old article, but still works perfectly in Cake 1.2 I had already tried that method i.e. created an xml layout with just header() and print(?xml but I was still getting the space all that example does is move the output from the view to layout+view. As it happens a new day brought an answer I simply removed the ?xml? part from the output and problem solved, I'd still like to know where the space is coming from though. Tane On 4/2/07, Jeremy Pointer [EMAIL PROTECTED] wrote: I'm trying to output an xml document but I seem to be getting a space character just before ?xml.. which is causing the application receiving the data (not mine) to cough and splutter and die. In my controller I am setting $this-layout=false; and my view is: ?php header(Content-type:text/xml); print (?xml version=\1.0\?); print(somedata); foreach ($rows as $row) print(arow.$row['table']['field']./arow); print(/somedata); ? DEBUG is 0 I also tried removing all beforeFilter and beforeRender settings in app_controller and the controller that calls this with no luck. Any ideas why I am getting a space, is there a different/better way to output XML. -- */Jeremy Pointer/* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- */Jeremy Pointer/* [EMAIL PROTECTED] mailto:[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 -~--~~~~--~~--~--~---
Re: Cant change httpd.conf file
Hi Is mod_rewrite enable on your host? If yes, you should not need to edit httpd.conf. If not, you must use Cake rewrite system: http://www.domain.tld/controller/action/param1 will become http://www.domain.tld/index.php/controller/action/param1 Take a look at the first parameter in /app/config/code.php: BASE_URL Who's your hosting provider? Maybe someone already spoke about it in the group... On 3 avr, 03:30, Edawg [EMAIL PROTECTED] wrote: Hi, trying to get cakePHP up and running, but having problems with the layout, it does not seem to render right, and the manual explains that i have to edit the httpd.conf file, but i dont have access to this file, its not allowed by my host, so i cant modify LoadModule rewrite_module libexec/httpd/mod_rewrite.so and AddModule mod_rewrite.c What can I do??. --~--~-~--~~~---~--~~ 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: Cant change httpd.conf file
Hi Edawag, On 3 Apr, 03:30, Edawg [EMAIL PROTECTED] wrote: Hi, trying to get cakePHP up and running, but having problems with the layout, it does not seem to render right, and the manual explains that i have to edit the httpd.conf file, but i dont have access to this file, its not allowed by my host, so i cant modify LoadModule rewrite_module libexec/httpd/mod_rewrite.so and AddModule mod_rewrite.c What can I do??. try to uncommnet define ('BASE_URL', env('SCRIPT_NAME')); in app/config/core.php --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
On Apr 3, 2:48 am, jyrgen [EMAIL PROTECTED] wrote: hi all, in this thread http://groups.google.com/group/cake-php/browse_thread/thread/f23b1825... Andy Dawson gave valuable information for searching HABTM related models by creating a dummy model for the HABTM lookup table. $constraint['PostsTag.tag_id'] = $tagId; // or pass an array to genereate IN (1,2,3..) in the sql. now here i want fields to be AND-ed while IN (1,2,3..) generates OR-ed fields. i tried this: $conditions['ArticlesRight']['right_id'] = Array(and = array(1,2)); with the same result. and this: $conditions['ArticlesRight']['right_id'] = Array(and = array(ArticlesRight = Array(right_id = 1, right_id = 2))); which doesn't make sense, because the innermost Array has identical keys. how do i have to construct the array in order to achieve AND logic ? thank you, jyrgen /me flicks his burning ear. Hi jyrgen, Did you and I discuss this on irc recently..? While the result of what you want is clear (at least to me), the way it is described here cannot solve the problem. Changing the IN to be an AND is illogical - the field in A row in the database can only have ONE value. It's important to know or at least understand the sql that will give you what you want. // Find all posts SELECT * FROM posts; // Find all posts linked to the tag with id 1 SELECT * FROM posts LEFT JOIN posts_tags ON posts_tags.post_id = posts.id WHERE posts_tags.tag_id = 1 // Find all post linked to both tag 1 AND tag 2 // Note the increase in complexity SELECT * FROM posts LEFT JOIN posts_tags AS tag1 ON tag1.post_id = posts.id LEFT JOIN posts_tags AS tag2 ON tag2.post_id = posts.id WHERE tag1.tag_id = 1 AND tag2.tag_id = 2 What you need is to bind a hasOne association for each of the joins which appears in that last example. If you wanted to say linked to all 8 items, you would need to LEFT JOIN (or inkeeping with the previous thread bind a hasOne for) 8 dummies to achieve the goal. 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: Foreign Keys and Cake Naming Conventions
As you have stated above, you only need to create a link table for many-to-many relationships. If your table is joining to eight other tables and they are one-to-one or many-to-one relationships, then the table will simply have eight foreign keys. 'Link' tables should not be that common, it should often be a full entity with other attributes (other than the two foreign keys) so becomes part of many-to-one and one-to-many relationship with the other two tables. In the unlikely event you really have a schema that requires eight link tables off one table, you should perhaps revisit your design - I work with schemas that have tens of thousands of tables/views and cannot think of a true 'link' table amongst them. HTH GreyCells On Apr 3, 3:18 am, uk_maul [EMAIL PROTECTED] wrote: Here is an example of what I was trying to ask: many-to-many join tables should be named: alphabetically_first_table_plural_alphabetically_second_table_plural ie: tags_users So if my table is joining to 8 other tables, with the 8 foreign keys, how do I get the table name? Will it just be the first fk join table that I will put in the name and ignore the others? Thanks On Apr 2, 7:21 pm, uk_maul [EMAIL PROTECTED] wrote: Hi I am new to CakePHP and need some help with the Cake database naming conventions. Our ERD has over a 100 tables (its almost fully normalized). Most tables have one or two foreign key relationships with other tables, so we followed the Cake conventions fine for those and named all the tables in plural and with underscores between the related tables. There are a few tables however that have as many as 6 or 8 foreign keys. I would like to know how to follow the Cake naming conventions for those tables and how can we set up the relationships for those tables in the models and how it will impact the automagic database functions that depend on the naming conventions. Thanks in advance for help with 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: Use off-the-shelf (bloated) open source product, or develop with cake?
2¢ for you if you are looking for the quick and easy fix for a low budget project - look into Joomla / VirtueMart. Zen cart can be a bit of a pain to work with and the community is not quite as helpful as the Joomla / VirtuMart one. - Dan. On 01/04/2007, at 10:21 PM, keymaster wrote: 7. losing contracts to your competitors who are releasing on top of ZenCart or Drupal much quicker /* Nitro Intelligence * Web Hosting * IT Consultancy * Server Solutions * Web Development http://www.nitro.com.au Ph: (02) 9029 9555 Fx: (02) 8208 3210 ABN 63 616 726 613 */ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
webroot out of app and mod_rewrite disabled
Hi everyone, I have some problems with a particular configuration of cake. I have an application that it's structured like this: /home/myhome/lib/cake - here there's cake's library /home/myhome/workspace/myapp - here there is my application without webroot dir /home/myhome/workspace/mywebroot - here there is only webroot of my app /var/www/htdocs/workspace - it's a symbolic link to mywebroot in myhome I have tested with mod_rewrite ON and all works well, but I have to use mod_rewrite OFF. I have uncommented in core.php the line with define ('BASE_URL', env('SCRIPT_NAME')); and I have configured my mywebroot/index.php like this: define('ROOT', dirname(dirname(__FILE__))); define('APP_DIR', myapp); define('CAKE_CORE_INCLUDE_PATH', DS . 'home' . DS . 'myhome' . DS . 'lib'); When I point to webroot (localhost/workspace/mywebroot) my page appear with no css becaue the urls that cake writes to link css (javascript, ...) are wrongs. $html-css('cake.generic') produces link rel=stylesheet type=text/css href=/workspace/mywebroot/ myapp/mywebroot/css/cake.generic.css / The same thing succeed when I write any url in cake mode: $html-url('/users/login') return /workspace/mywebroot/index.php/workspace/mywebroot/users/login and if I print $html-webroot: /workspace/mywebroot/myapp/mywebroot/ Any ideas? Maybe cake dosen't work properly with mod_rewrite disabled and webroot out of app directory? Thanks in advance Bato --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Debian cakephp installation
Hey, I'm using Debian stable with apache v2. I can download and extract the latest cakephp into /home/me/public_html/cakephp The proble is when I browse to latest installation I got the following error The requested URL /home/me/public_html/cakephp/cake1113/app/webroot/ was not found on this server. Can any of you give me some hint please? --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
an AND is illogical - the field in A row in the database can only have ONE value. i see... how would i find posts containing both tags foo and bar ? this appears to be a rather common query to me. jyrgen --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
On Apr 3, 12:06 pm, jyrgen [EMAIL PROTECTED] wrote: an AND is illogical - the field in A row in the database can only have ONE value. i see... how would i find posts containing both tags foo and bar ? dunno. maybe read the rest of what I wrote :D? 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: filtering HABTM data (once more)
sure, it won't make sense to bind a model for each value... so what remains is to build the query manually. hm actually i want to avoid this, since the query is already quite complex. hmm... let me rethink this. maybe i missed sth, because i'm wondering that apparently nobody ever came across this problem. i'll let you know :-} J. --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
could you please give an example, maybe according to the one in the thread i mentioned above, this one: I don't think it's any more complex than: $this-Post-bindModel(array('hasOne'=array('TagAssociationA'=array(; $this-Post-bindModel(array('hasOne'=array('TagAssociationB'=array(; $constraint['Post.published'] = ' '.date('Y-m-d H:i:s'); $constraint['TagAssociationA.tag_id'] = $tagAId; $constraint['TagAssociationB.tag_id'] = $tagBId; $this-Post-findAll($constraint); hth Jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
could you please give an example, maybe according to the one in the thread i mentioned above, this one: I don't think it's any more complex than: hmm, yes it is sorry, it's more like: $this-Post-bindModel(array('hasOne'=array('TagAssociationA'=array('ClassName'='PostTags'; $this-Post-bindModel(array('hasOne'=array('TagAssociationB'=array('ClassName'='PostTags'; $constraint['Post.published'] = ' '.date('Y-m-d H:i:s'); $constraint['TagAssociationA.tag_id'] = $tagAId; $constraint['TagAssociationB.tag_id'] = $tagBId; $this-Post-findAll($constraint); that's off the cuff btw (sorry!) jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
thanks jon, a more simple (silly?) question about TagAssociationA and TagAssociationB resp. did i get you right that they are identical but just carry different names in order to get sql set up ? thx, j --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
selectTag with optgroup, how?
HI everyone, i'm trying to set up a selectTag with optgroupes and have seen this: http://api.cakephp.org/class_html_helper.html#dc661e84e1710023d94691fad33f40ec but what do i put in? $ fieldName, $ optionElements = array(), $ selected = null, $ selectAttr = array(), $ optionAttr = array(), $ showEmpty = true, $ return = false a nested array doesn't work do i need separate arrays for selectAttr and optionAttr? If anyone has an example of this working it would be much appreciated. Cheers TWIOF --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
Can somebody please explain the model definitions of TagAssociation ? Are they bare ? J --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$this-Ajax-linkToRemote
Hi! I know that linkToRemote is deprecated, but i want to use searchpagination helper that use this function: $text = $this-Ajax-linkToRemote($pc,array(fallback=$this- action.#,url =$this-link.$pc,update = ajax_update,method=get)); What is the correct syntax of the mentioned sentece but using Ajax- link instead of linkToRemote? --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
sorry for insisting, but it is still not clear for me, after i did some testing. do i have to create a model file for each association ? or does your code create the assiociations dynamically ? thanks again, jyrgen --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
i'm getting this error: Fatal error: Cannot instantiate non-existent class: tagassociationa in /var/www/cake/cake/libs/model/model_php4.php on line 445 J --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
Jyrgen, maybe if it's written like this it will answer your question: $TagIdList = array(1,2,3); // can be any length foreach ($TagIdList as $tagId) { $bindArray = array(); $Alias = rand();//'PostsTag'.$tagId; // could be any (unique)string $bindArray['hasOne'][$Alias] = array('className'='PostsTag'); $this-Post-bindModel($bindArray); $constraint[$Alias.'.tag_id'] = $tagId; } $constraint['Post.published'] = ' '.date('Y-m-d H:i:s'); // Find all posts publish and linked to all of tags in the tagIdList $this-Post-findAll($constraint); The ONLY 'extra' model definition required to use jon's code, this, or the code from the original thread is the one for the join table. 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: filtering HABTM data (once more)
it took some time to translate everything into my naming. basically i have Articles and (Publishing) Rights, associated via HABTM code in articles controller: ### $RightIdList = array(1,2,3); // can be any length foreach($RightIdList as $rightId){ $bindArray = array(); $Alias = rand(); // could be any (unique)string $bindArray['hasOne'][$Alias] = array('className'='ArticlesRight'); $this-Article-bindModel($bindArray); $constraint[$Alias.'.right_id'] = $rightId; } pr($constraint);exit; ### the helper model called articlesright.php ### class ArticlesRight extends AppModel { var $name = 'ArticlesRight'; var $hasOne = array( 'Right' = array('className'= 'Right', 'joinTable'= 'articles_rights', 'foreignKey' = 'right_id', 'associationForeignKey'= 'article_id', 'conditions' = '', 'order'= '', 'limit'= '', 'unique' = true, 'finderQuery' = '', 'deleteQuery' = '', ), ); } ### and the framework complains : Fatal error: Cannot instantiate non-existent class: articlesright in / var/www/cake/cake/libs/model/model_php4.php on line 445 i can feel i am so close. :-) jyrgen --~--~-~--~~~---~--~~ 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: selectTag with optgroup, how?
I just browsed the 1.x code, and I didn't see any optgroup possibility in the HtmlHelper But when searching in Trac: https://trac.cakephp.org/changeset/3326 This feature is available only in FormHelper in 1.2 On 3 avr, 13:04, TWIOF [EMAIL PROTECTED] wrote: HI everyone, i'm trying to set up a selectTag with optgroupes and have seen this:http://api.cakephp.org/class_html_helper.html#dc661e84e1710023d94691f... but what do i put in? $ fieldName, $ optionElements = array(), $ selected = null, $ selectAttr = array(), $ optionAttr = array(), $ showEmpty = true, $ return = false a nested array doesn't work do i need separate arrays for selectAttr and optionAttr? If anyone has an example of this working it would be much appreciated. Cheers TWIOF --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
and the framework complains : Fatal error: Cannot instantiate non-existent class: articlesright in / var/www/cake/cake/libs/model/model_php4.php on line 445 you need to name your model file correctly, 'articles_right.php', and you just need a $name and $useTable, no associations, eg: class ArticlesRight extends AppModel { var $name = 'ArticlesRight'; var $useTable = 'articles_right'; } that should do it hth jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
articlesright.php - articles_right.php i can't believe it, i got it running ! thanks a ton guys esp. for your patience :-)) i'd suggest to include this solution into the faq, if you're still gathering useful techniques... have a nice day (or night) jyrgen --~--~-~--~~~---~--~~ 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: filtering HABTM data (once more)
thanks jon, we crossposted. i'll remove the association array from the lookup model, it is not needed there, you're right. j. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pagination - rendering the counter differently
Hi all, I've been developing a few sites in Cake for internal use, to demonstrate its power to my bosses. I'm using 1.2, and the Pagination helper quite a lot (for some reason they want all the content to fit on an 800x600 screen, so I have a LOT of multiple page sections). Currently, the helper renders my pagination links like this: Previous | Page 1 of 5 | Next Which I thought was fine, it works well enough. But what they're asking for is something more like this: Previous | 1 2 3 4 5 | Next Is it possible to do it this way with the pagination code as is, or do I have to look for an alternate way to get it working the way they want? Thanks in advance for any help :) --~--~-~--~~~---~--~~ 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 problem
I've done the following: $aro= new Aro(); $aco= new Aco(); //aro groups $aro-create(0,null,'Super'); $aro-create(0,null,'Administrator'); $aro-create(0,null,'AddOnly'); $aro-create(0,null,'ReadOnly'); $aro-setparent('Super','root'); //aco groups $aco-create(0,null,'user management'); $aco-create(0,null,'protected area management'); $aco-create(0,null,'protected area data entry'); $aco-create(0,null,'protected area list'); //an aro $aro-create(1, null, 'root'); //acos $aco-create(1,null,'/users/edit'); $aco-create(2,null,'/users/add'); $aco-create(3,null,'/users/delete'); $aco-create(4,null,'/users/view'); $aco-create(5,null,'/users/index'); $aco-create(6,null,'/users/managegroups'); $aco-create(7,null,'/users/manageusers'); $aco-create(8,null,'/protectedareas/edit'); $aco-create(9,null,'/protectedareas/add'); $aco-create(10,null,'/protectedareas/view'); $aco-create(11,null,'/protectedareas/index'); $aco-setparent('protected area management', '/protectedareas/ edit'); $aco-setparent('protected area data entry', '/protectedareas/add'); $aco-setparent('protected area management', '/protectedareas/ view'); $aco-setparent('protected area list', '/protectedareas/index'); $aco-setparent('user management','/users/add'); $aco-setparent('user management', 'users/edit'); $aco-setparent('user management', 'users/delete'); $aco-setparent('user management', 'users/view'); $aco-setparent('user management', 'users/index'); $aco-setparent('user management', 'users/managegroups'); $aco-setparent('user management', 'users/manageusers'); Access Control/ $this-Acl-allow('Super','user management'); $this-Acl-allow('Super','protected area management'); $this-Acl-allow('Super','protected area data entry'); $this-Acl-allow('Super','protected area list'); $this-Acl-allow('Administrator','protected area management'); $this-Acl-allow('Administrator','protected area data entry'); $this-Acl-allow('Administrator','protected area list'); $this-Acl-allow('AddOnly','protected area data entry'); $this-Acl-allow('AddOnly','protected area list'); $this-Acl-allow('ReadOnly','protected area list'); The problem is that, root is allowed to visit the /users/add page but not /users/edit page even if they belong to the same aco group. Why is this? Please find the problem and tell me what it is... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Manually invalidating a form field
Hello bakers, Is it possible to manually invalidate a form field in order to show an error-message? The field 'image' is not present in the $validate array of the News model. But i want it to be invalidated, when a file upload fails. if ($fileUploadFailed) { $this-News-invalidate('image', 'Image upload failed!'); } But when i do $this-validateErrors($this-News) I don't get the error div for 'image'. Has anyone an idea, how to solve this problem? Many thx, Christoph :-) --~--~-~--~~~---~--~~ 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: selectTag with optgroup, how?
OK if anyone elase gets confused over this try this post: http://groups.google.com/group/cake-php/browse_thread/thread/a6d1767796a5af18/a6e4d4b5be99f518?lnk=gstq=optgrouprnum=1#a6e4d4b5be99f518 create the new helper and remember to call it using echo $Morehtml-selectOptTag rather than the ususal $html-selecttag --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Curious incidence of infinitely nested recurring views
This is a curious one. I'm using 1.2 r4746 and periodically get infinitely nested recurring views all with the error message shown below. I can't seem to replicate what triggers this, as it has only happened a couple of times after extremely trivial code changes. Reversing those changes out does not make the problem go away, in fact, once 'triggered' the infinite recurring views appear for *every* page of the application, which implies it's not the changes that I'm making that are causing it. There are no errors in the apache logs and the cake log does not show any recursive calls (i.e. the recursion seems to be in the view rendering, not the controller). Clearing the cache directory has no effect, thus far the only way I have been able to clear the issue is to revert cake to a previous revision, then work forward to the current release (4746). But I have not yet been able to find the specific release that trigger this, as I can bring the libs bang up to date without any problems. Next time it occurs, I'll work backwards, one release at a time... Has anyone else experience this? GreyCells Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [COREcake/libs/view/view.php, line 473] Context | Code $content_for_layout = $layout_fn = /path/to/my/app/views/layouts/.ctp $debug = $pageTitle = 'scripts_for_layout' = join(\n\t, $this- __scripts), 'cakeDebug' = $debug ) ); array_merge - [internal], line ?? View::renderLayout() - COREcake/libs/view/view.php, line 473 SessionHelper::flash() - COREcake/libs/view/helpers/session.php, line 128 include - APP/views/elements/flash.ctp, line 15 View::_render() - COREcake/libs/view/view.php, line 778 View::renderElement() - COREcake/libs/view/view.php, line 400 include - APP/views/layouts/default.ctp, line 30 View::_render() - COREcake/libs/view/view.php, line 778 View::renderLayout() - COREcake/libs/view/view.php, line 484 View::render() - COREcake/libs/view/view.php, line 347 Controller::render() - COREcake/libs/controller/controller.php, line 611 SearchController::index() - APP/controllers/search_controller.php, line 44 Dispatcher::_invoke() - COREcake/dispatcher.php, line 346 Dispatcher::dispatch() - COREcake/dispatcher.php, line 328 [main] - APP/webroot/index.php, line 84 --~--~-~--~~~---~--~~ 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: IE7 Not Updating Ajax Divs
Awesome, that worked. Thanks a ton, bernardo! I wanted it to update on each keypress so, I think I will have it check if it is FF or IE and set the value based on what browser the user is viewing the page in. Unless anyone else knows of a way to make IE update faster. On Apr 2, 7:19 pm, bernardo [EMAIL PROTECTED] wrote: Have you tried with frequency 0 Just a guess... On Apr 2, 7:59 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Well, after searching, I have found a script that you can bookmark to debug XHtmlRequests for IE(7). It shows that there are no requests going through. Wierd. Further more, I have downgraded to prototype 1.5 (the one that's supposed to work for everything) and nothing. I have gone to other sites that update ajax fine so there has to be an error in the code on my side somewhere. Or possibly in Cake's code. Didn't find anything on Trac yet either. Here is the script in case you're wondering. http://blog.monstuff.com/archives/000291.html On Apr 2, 2:45 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Hello. I am having a small problem where the divs that need to be updated via ajax are not being updated in IE7. It works fine in FF. I have searched this group and have found only one other question like this but, no answers. The wierd thing is, when I type something in a field, go to another page and then hit my browser's back button, you can see what is supposed to be in the div. It's like it is only updating on a page load. Anyways, I am using cake 1.1.14.4306, PHP5, Prototype 1.15 and Script.aculo.us 1.7.1 Here is the code I am using. Remember, this works fine in FireFox // /user/view/register.thtml !--snip-- echo div class=\required\span class=\userRegisterLabel\label for=\UserUsername\User Name:/label/spanspan class= \userRegisterField\ . $html-input('User/username', array ( 'size' = 30 ))./spandiv id=\userRegisterUsername\/div/div; echo ; echo $html-tagErrorMsg('User/username', 'Username can only contain Letters, Numbers, Underscores(_) and/or Dashes(-). The username must also between 3-25 characters long.'); echo $ajax-observeField('UserUsername', array ( 'url' = 'check_registration_form/username/', 'update' = 'userRegisterUsername', 'frequency' = 0, 'loading' = document.getElementById('userRegisterUsername').style.display = 'block', 'loaded' = document.getElementById('userRegisterUsername').style.display = 'block' )); !--snip-- If you would like to see more code, just post here please. I will keep searching in the mean-time. If I find an answer I will post here again for anyone who has this problem in the future. --~--~-~--~~~---~--~~ 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: Curious incidence of infinitely nested recurring views
https://trac.cakephp.org -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de GreyCells Enviado el: Martes, 03 de Abril de 2007 12:07 p.m. Para: Cake PHP Asunto: Curious incidence of infinitely nested recurring views This is a curious one. I'm using 1.2 r4746 and periodically get infinitely nested recurring views all with the error message shown below. --~--~-~--~~~---~--~~ 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: Manually invalidating a form field
Paste the code you have in your thtml file. You should have a $this- tagErrorMsg somewhere in there. On Apr 3, 7:14 am, Preloader [EMAIL PROTECTED] wrote: Hello bakers, Is it possible to manually invalidate a form field in order to show an error-message? The field 'image' is not present in the $validate array of the News model. But i want it to be invalidated, when a file upload fails. if ($fileUploadFailed) { $this-News-invalidate('image', 'Image upload failed!'); } But when i do $this-validateErrors($this-News) I don't get the error div for 'image'. Has anyone an idea, how to solve this problem? Many thx, Christoph :-) --~--~-~--~~~---~--~~ 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: Curious incidence of infinitely nested recurring views
Hi Mariano I have not raised a trac because I cannot replicate the issue. Once I gather sufficient information to allow the devs to replicate, I will raise a bug, enhancement or fix my code or whatever. Here, I am looking for help to track down what triggers this - whether it is just me or if it has occured in other installs. Having been on the receiving end of many, many 'it doesn't work' support calls, I prefer, at the very least, to work out how to replicate the issue before logging a bug. (or at least try my hardest to :) ~GreyCells On Apr 3, 4:18 pm, Mariano Iglesias [EMAIL PROTECTED] wrote: https://trac.cakephp.org -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog:http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de GreyCells Enviado el: Martes, 03 de Abril de 2007 12:07 p.m. Para: Cake PHP Asunto: Curious incidence of infinitely nested recurring views This is a curious one. I'm using 1.2 r4746 and periodically get infinitely nested recurring views all with the error message shown below. --~--~-~--~~~---~--~~ 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: Saving in a loop
After looking at the link Dr. Tarique Sani posted, try this: for ( $counter = 0; $counter = 4; $counter += 1) { $this-data['Person']['first_name'] = 'First Name ' . $counter; $this-data['Person']['last_name'] = 'Last Name ' . $counter; $this-data['Person']['age'] = 50 + $counter; $this-Person-create(); $this-Person-save($this-data); } On Apr 2, 9:59 pm, behrangsa [EMAIL PROTECTED] wrote: Hi, When I execute the following code, only one item gets inserted into the people table: for ( $counter = 0; $counter = 4; $counter += 1) { $this-data['Person']['first_name'] = 'First Name ' . $counter; $this-data['Person']['last_name'] = 'Last Name ' . $counter; $this-data['Person']['age'] = 50 + $counter; $this-Person-save($this-data); } Any ideas why? How can I insert 5 items in a loop like above to the database? Regards, Behi -- View this message in context:http://www.nabble.com/Saving-in-a-loop-tf3509818.html#a9803735 Sent from the CakePHP mailing list archive at Nabble.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: Curious incidence of infinitely nested recurring views
Fair enough :) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de GreyCells Enviado el: Martes, 03 de Abril de 2007 12:32 p.m. Para: Cake PHP Asunto: Re: Curious incidence of infinitely nested recurring views Having been on the receiving end of many, many 'it doesn't work' support calls, I prefer, at the very least, to work out how to replicate the issue before logging a bug. (or at least try my hardest to :) --~--~-~--~~~---~--~~ 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: IE7 Not Updating Ajax Divs
Bah, found someone else's code that states if you put frequency to 0.xx, it works in IE and it updates like a keypress. On Apr 3, 8:21 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Awesome, that worked. Thanks a ton, bernardo! I wanted it to update on each keypress so, I think I will have it check if it is FF or IE and set the value based on what browser the user is viewing the page in. Unless anyone else knows of a way to make IE update faster. On Apr 2, 7:19 pm, bernardo [EMAIL PROTECTED] wrote: Have you tried with frequency 0 Just a guess... On Apr 2, 7:59 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Well, after searching, I have found a script that you can bookmark to debug XHtmlRequests for IE(7). It shows that there are no requests going through. Wierd. Further more, I have downgraded to prototype 1.5 (the one that's supposed to work for everything) and nothing. I have gone to other sites that update ajax fine so there has to be an error in the code on my side somewhere. Or possibly in Cake's code. Didn't find anything on Trac yet either. Here is the script in case you're wondering. http://blog.monstuff.com/archives/000291.html On Apr 2, 2:45 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Hello. I am having a small problem where the divs that need to be updated via ajax are not being updated in IE7. It works fine in FF. I have searched this group and have found only one other question like this but, no answers. The wierd thing is, when I type something in a field, go to another page and then hit my browser's back button, you can see what is supposed to be in the div. It's like it is only updating on a page load. Anyways, I am using cake 1.1.14.4306, PHP5, Prototype 1.15 and Script.aculo.us 1.7.1 Here is the code I am using. Remember, this works fine in FireFox // /user/view/register.thtml !--snip-- echo div class=\required\span class=\userRegisterLabel\label for=\UserUsername\User Name:/label/spanspan class= \userRegisterField\ . $html-input('User/username', array ( 'size' = 30 ))./spandiv id=\userRegisterUsername\/div/div; echo ; echo $html-tagErrorMsg('User/username', 'Username can only contain Letters, Numbers, Underscores(_) and/or Dashes(-). The username must also between 3-25 characters long.'); echo $ajax-observeField('UserUsername', array ( 'url' = 'check_registration_form/username/', 'update' = 'userRegisterUsername', 'frequency' = 0, 'loading' = document.getElementById('userRegisterUsername').style.display = 'block', 'loaded' = document.getElementById('userRegisterUsername').style.display = 'block' )); !--snip-- If you would like to see more code, just post here please. I will keep searching in the mean-time. If I find an answer I will post here again for anyone who has this problem in the future. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session Woes
I am having problems maintaining a session. It seems the domain object I place into session is dropped after a single request ( similar to flash scope )... Login Post Valid ( adds partner to session ) Renders flash redirect message Shows homepage When I am on the home page the partner is still in session ( using firecake for debugging ). However, if I refresh the homepage partner is dropped from session. Config values still the same. [code] // In login controller $this-Session-write('partner',$partner[Partner]); $this-flash('You have successfully logged in.',$homepage); [/code] [code] // in home controller view ( action is empty method ) ?php echo $session-read('partner.email'); ? [/code] Is this something people have experienced? Also, session-read method is not working properly for me, ( it always return a quotation mark, when the value exists in session ). Again, I have verified it is in session using firecake. help --~--~-~--~~~---~--~~ 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: Pagination - rendering the counter differently
I needed to do this too, but the current paginator helper doesn't support it. But the work has been done for you. If you copy /cake/libs/ view/helpers/paginator.php to /app/views/helpers/paginator.php and apply the patch from this ticket: https://trac.cakephp.org/ticket/2202 , then you can use the new pageNumbers function like so: ?php echo $paginator-pageNumbers(array('maxPages'=5), ' ');? Take a look at the pageNumbers function's comments. It works pretty much like you would expect. - Frank On Apr 3, 9:31 am, MrTufty [EMAIL PROTECTED] wrote: Hi all, I've been developing a few sites in Cake for internal use, to demonstrate its power to my bosses. I'm using 1.2, and the Pagination helper quite a lot (for some reason they want all the content to fit on an 800x600 screen, so I have a LOT of multiple page sections). Currently, the helper renders my pagination links like this: Previous | Page 1 of 5 | Next Which I thought was fine, it works well enough. But what they're asking for is something more like this: Previous | 1 2 3 4 5 | Next Is it possible to do it this way with the pagination code as is, or do I have to look for an alternate way to get it working the way they want? Thanks in advance for any help :) --~--~-~--~~~---~--~~ 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: Saving in a loop
Thanks, I solved the problem by nullifying the id in the loop :-) Looks like the correct way of handling is to call the Create function. Regards, Behi Dr. Tarique Sani wrote: On 4/3/07, behrangsa [EMAIL PROTECTED] wrote: When I execute the following code, only one item gets inserted into the people table: for ( $counter = 0; $counter = 4; $counter += 1) { $this-data['Person']['first_name'] = 'First Name ' . $counter; $this-data['Person']['last_name'] = 'Last Name ' . $counter; $this-data['Person']['age'] = 50 + $counter; $this-Person-save($this-data); } http://groups.google.com/group/cake-php/search?hl=engroup=cake-phpq=saving+in+loopqt_g=Search+this+group Do your homework if you don't want your head to be bitten off ;) Tarique -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org = -- View this message in context: http://www.nabble.com/Saving-in-a-loop-tf3509818.html#a9813961 Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
how to select data from 3 tables, need help.
I have table, users, posts and comments 1 user has many posts, each post has many comments. on my view page, I want to see that user's all hte posts with comments. hasMany just for 2 tables, how can I go 1 more level to get all the comments as well ? thanks for help. --~--~-~--~~~---~--~~ 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: how to select data from 3 tables, need help.
$this-User-recursive = 2; in the controller action should help see http://manual.cakephp.org/chapter/models for information On 4/3/07, feelexit [EMAIL PROTECTED] wrote: I have table, users, posts and comments 1 user has many posts, each post has many comments. on my view page, I want to see that user's all hte posts with comments. hasMany just for 2 tables, how can I go 1 more level to get all the comments as well ? thanks for help. -- (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/ --~--~-~--~~~---~--~~ 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: Curious incidence of infinitely nested recurring views
This disappears when reverting back past r4719 - which makes sense, because r4719 refactors session flash stuff and I have customized that area ( to give me $controller-flashWarning, flashError, flashInfo etc with multiple messages). I'm still unable to replicate the actual trigger (I'm able to use my custom flashError OK most of the time), so it's probably time for me to refactor my code... I guess, Mariano, there's still a slim possibility I should raise a trac - perhaps a check is needed before the array_merge in view.php to ensure you don't end up with a big pile of pants on your screen when passing a non-array (however it is that I'm managing to do that :) ~GreyCells --~--~-~--~~~---~--~~ 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: Saving in a loop
I guess that would have worked too. ($this-Person-id = null;). I took me awhile to realize that $this-ModelName-id is generated automatically at times. I still don't understand how it works completely. I've had edit methods that work even though I didn't really deal with the id like I thought I should. On Apr 3, 7:54 am, behrangsa [EMAIL PROTECTED] wrote: Thanks, I solved the problem by nullifying the id in the loop :-) Looks like the correct way of handling is to call the Create function. Regards, Behi Dr. Tarique Sani wrote: On 4/3/07, behrangsa [EMAIL PROTECTED] wrote: When I execute the following code, only one item gets inserted into the people table: for ( $counter = 0; $counter = 4; $counter += 1) { $this-data['Person']['first_name'] = 'First Name ' . $counter; $this-data['Person']['last_name'] = 'Last Name ' . $counter; $this-data['Person']['age'] = 50 + $counter; $this-Person-save($this-data); } http://groups.google.com/group/cake-php/search?hl=engroup=cake-phpq... Do your homework if you don't want your head to be bitten off ;) Tarique -- = PHP for E-Biz:http://sanisoft.com Cheesecake-Photoblog needs you!:http://cheesecake-photoblog.org = -- View this message in context:http://www.nabble.com/Saving-in-a-loop-tf3509818.html#a9813961 Sent from the CakePHP mailing list archive at Nabble.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 -~--~~~~--~~--~--~---
Issue with Date Time fields
Hey folks, Before I raise a ticket in the trac I wanted to check out if anyone knows if this is a bug, or if I should be doing something in beforeSave? I have a model, Event. In it, I have 2 fields event_date and event_time, obviously being DATE and TIME fields. In my view, I render them using the form helper and they show up fine - but when I save, they don't insert into the table. I did a print_r($this-data) and got this: Array ( [Event] = Array ( [venue] = Prime Club [address] = [city] = Cologne [country] = DE [event_date_month] = 04 [event_date_day] = 26 [event_date_year] = 2007 [event_time_hour] = 08 [event_time_min] = 0 [event_time_meridian] = pm [notes] = Part of British Music Week [published] = 1 [user_id] = 1 ) ) However, on my inset I have this: INSERT INTO `events` (`venue`,`city`,`country`,`notes`,`published`,`user_id`,`created`,`modified`) VALUES ('Prime Club','Cologne','DE','Part of British Music Week\r\n',1,1,'2007-04-03 16:35:13','2007-04-03 16:35:13') Apart from address (which was empty in this example anyway) all the fields seem to save, EXCEPT for event_date and event_time. So can anyone clarify, is this a bug, or should I be doing something in beforeSave?? Thanks, Tane --~--~-~--~~~---~--~~ 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: selectTag with optgroup, how?
FormHelper::select( ) in Cake 1.2 natively supports optgroup / and can be used with the new grouping option in Model::generateList( ). On Apr 3, 10:17 am, TWIOF [EMAIL PROTECTED] wrote: OK if anyone elase gets confused over this try this post:http://groups.google.com/group/cake-php/browse_thread/thread/a6d17677... create the new helper and remember to call it using echo $Morehtml-selectOptTag rather than the ususal $html-selecttag --~--~-~--~~~---~--~~ 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: Cant change httpd.conf file
Im using VerveHosting.com, and dont have any access to the mod_rewrite, it must be set to off, because ive tried to uncommnet define ('BASE_URL', env('SCRIPT_NAME'));, and still the same result, so im thinking I must have to use the Cake rewrite system, but am having problems understanding it?. When I installed cake, i put it into the public_html folder right on my server, so the address i have to goto to get my cake homepage is http://www.mydomain.com/cake/index.php, and this brings up the homepage, but without any images or colors??, no css styles at all??. have you had this problem, can you walk me through what to do to fix it?. thanks so much for all your help:). On Apr 3, 3:20 am, bato [EMAIL PROTECTED] wrote: Hi Edawag, On 3 Apr, 03:30, Edawg [EMAIL PROTECTED] wrote: Hi, trying to get cakePHP up and running, but having problems with the layout, it does not seem to render right, and the manual explains that i have to edit the httpd.conf file, but i dont have access to this file, its not allowed by my host, so i cant modify LoadModule rewrite_module libexec/httpd/mod_rewrite.so and AddModule mod_rewrite.c What can I do??. try to uncommnet define ('BASE_URL', env('SCRIPT_NAME')); in app/config/core.php --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Is e(...) from Cake or PHP?
Will someone point me to a reference to this language feature? I have been unable to find one in CakePHP or PHP. Thanks for the help. Peter - --~--~-~--~~~---~--~~ 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: Is e(...) from Cake or PHP?
Peter, It's a Cake shorcut for echo() function (found in cake/basics.php) . There are someother shorcuts, pr() for print_r(), aa() create an associative array, up() and low() for strtoupper() and strtolower(), etc. Regards, -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On 4/3/07, peterhf [EMAIL PROTECTED] wrote: Will someone point me to a reference to this language feature? I have been unable to find one in CakePHP or PHP. Thanks for the help. Peter - --~--~-~--~~~---~--~~ 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: Pagination - rendering the counter differently
$params = $paginator-params(); echo $paginator-prev(' Previous') . ' | '; for ($i = 1; $i = $params['pageCount']; $i++) { if ($i == $params['page']) { echo $i; } else { echo $paginator-link($i, array('page' = $i)); } echo ' | '; } echo $paginator-next('Next '); Any questions? On Apr 3, 10:21 am, Frank P [EMAIL PROTECTED] wrote: I needed to do this too, but the current paginator helper doesn't support it. But the work has been done for you. If you copy /cake/libs/ view/helpers/paginator.php to /app/views/helpers/paginator.php and apply the patch from this ticket:https://trac.cakephp.org/ticket/2202 , then you can use the new pageNumbers function like so: ?php echo $paginator-pageNumbers(array('maxPages'=5), ' ');? Take a look at the pageNumbers function's comments. It works pretty much like you would expect. - Frank On Apr 3, 9:31 am, MrTufty [EMAIL PROTECTED] wrote: Hi all, I've been developing a few sites in Cake for internal use, to demonstrate its power to my bosses. I'm using 1.2, and the Pagination helper quite a lot (for some reason they want all the content to fit on an 800x600 screen, so I have a LOT of multiple page sections). Currently, the helper renders my pagination links like this: Previous | Page 1 of 5 | Next Which I thought was fine, it works well enough. But what they're asking for is something more like this: Previous | 1 2 3 4 5 | Next Is it possible to do it this way with the pagination code as is, or do I have to look for an alternate way to get it working the way they want? Thanks in advance for any help :) --~--~-~--~~~---~--~~ 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: Manually invalidating a form field (Cake 1.2)
Hi Christopher, no, I don't use $html-tagErrorMsg ... sorry, i didn't mention that i use Cake 1.2!! This is what I do in my view: echo $form-input('News.image', array('type' = 'hidden', 'error' = 'Error')); When put the 'image' field to the $validate array of my News model, the validation works. var $validate = array( 'headline' = VALID_NOT_EMPTY, 'image' = '/invalidateworkswiththis/' ); Anyone? Thank you, Christoph --~--~-~--~~~---~--~~ 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: Session Woes
Here is a var_dump of the _SESSION variable at the very beginning of script processing. 1st request array(2) { [Config]= array(3) { [rand]= int(377719362) [time]= int(1175658289) [userAgent]= string(32) 64892a71614760306f6c52f1cb727cca } [partner]= array(6) { [id]= string(5) 11429 [created]= string(19) 2007-04-25 10:00:00 [modified]= string(19) 2007-04-28 10:00:00 [name]= string(12) Kerry Wilson [email]= string(17) [EMAIL PROTECTED] [password]= string(32) d1e96978c6935ec01d995b1b8e4d8c33 } } 2nd request array(2) { [Config]= string(92) Config:{rand:377719362,time: 1175658290,userAgent:64892a71614760306f6c52f1cb727cca} [partner]= string(183) partner:{id:11429,created:2007-04-25 10:00:00,modified:2007-04-28 10:00:00,name:Kerry Wilson,email:[EMAIL PROTECTED],password:d1e96978c6935ec01d995b1b8e4d8c33} } 3rd request array(1) { [Config]= string(93) Config:{rand:2084398870,time: 1175658300,userAgent:64892a71614760306f6c52f1cb727cca} } It looks like the data is being stored differently ( converted ) on every request or something --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
img element not enclosed properly by html-image
hi, I am using html helper for displaying all my images ?= $html-image(logo.png, array('class'=displayed, 'style'=margin-top:25px;) ); ? Althought this works fine both in IE and Firefox, I notice one thing..it does closes img tag properly above statements prints out img src=/mysite/img/logo.png class=displayed style=margin-top: 25px; whereas it should be img src=/mysite/img/logo.png class=displayed style=margin-top: 25px; / the enclosing tag is missing.. --~--~-~--~~~---~--~~ 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: Curious incidence of infinitely nested recurring views
Trac now raised as an enhancement ('cos it works OK if you get the datatypes right.. :) https://trac.cakephp.org/ticket/2340 ~GreyCells On Apr 3, 4:18 pm, Mariano Iglesias [EMAIL PROTECTED] wrote: https://trac.cakephp.org -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog:http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de GreyCells Enviado el: Martes, 03 de Abril de 2007 12:07 p.m. Para: Cake PHP Asunto: Curious incidence of infinitely nested recurring views This is a curious one. I'm using 1.2 r4746 and periodically get infinitely nested recurring views all with the error message shown below. --~--~-~--~~~---~--~~ 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: IE7 Not Updating Ajax Divs
Glad to help! Be careful if you plan to upgrade to cakephp 1.2 because ajax- observeField changed and its behavior is now different if frequency is not set or is less than 1 second. See: https://trac.cakephp.org/ticket/1194 Also I think your code uncovered a bug in 1.2 when frequency is 0. I reported it here: https://trac.cakephp.org/ticket/2339 On Apr 3, 12:37 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Bah, found someone else's code that states if you put frequency to 0.xx, it works in IE and it updates like a keypress. On Apr 3, 8:21 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Awesome, that worked. Thanks a ton, bernardo! I wanted it to update on each keypress so, I think I will have it check if it is FF or IE and set the value based on what browser the user is viewing the page in. Unless anyone else knows of a way to make IE update faster. On Apr 2, 7:19 pm, bernardo [EMAIL PROTECTED] wrote: Have you tried with frequency 0 Just a guess... On Apr 2, 7:59 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Well, after searching, I have found a script that you can bookmark to debug XHtmlRequests for IE(7). It shows that there are no requests going through. Wierd. Further more, I have downgraded to prototype 1.5 (the one that's supposed to work for everything) and nothing. I have gone to other sites that update ajax fine so there has to be an error in the code on my side somewhere. Or possibly in Cake's code. Didn't find anything on Trac yet either. Here is the script in case you're wondering. http://blog.monstuff.com/archives/000291.html On Apr 2, 2:45 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Hello. I am having a small problem where the divs that need to be updated via ajax are not being updated in IE7. It works fine in FF. I have searched this group and have found only one other question like this but, no answers. The wierd thing is, when I type something in a field, go to another page and then hit my browser's back button, you can see what is supposed to be in the div. It's like it is only updating on a page load. Anyways, I am using cake 1.1.14.4306, PHP5, Prototype 1.15 and Script.aculo.us 1.7.1 Here is the code I am using. Remember, this works fine in FireFox // /user/view/register.thtml !--snip-- echo div class=\required\span class=\userRegisterLabel\label for=\UserUsername\User Name:/label/spanspan class= \userRegisterField\ . $html-input('User/username', array ( 'size' = 30 ))./spandiv id=\userRegisterUsername\/div/div; echo ; echo $html-tagErrorMsg('User/username', 'Username can only contain Letters, Numbers, Underscores(_) and/or Dashes(-). The username must also between 3-25 characters long.'); echo $ajax-observeField('UserUsername', array ( 'url' = 'check_registration_form/username/', 'update' = 'userRegisterUsername', 'frequency' = 0, 'loading' = document.getElementById('userRegisterUsername').style.display = 'block', 'loaded' = document.getElementById('userRegisterUsername').style.display = 'block' )); !--snip-- If you would like to see more code, just post here please. I will keep searching in the mean-time. If I find an answer I will post here again for anyone who has this problem in the future. --~--~-~--~~~---~--~~ 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: Issue with Date Time fields
I will usually do something like this before doing a save $this-cleanUpFields('Event'); see http://api.cakephp.org/class_controller.html#43aea5e84ef8550cf3ae8a97ca18ec1e On 4/3/07, digital spaghetti [EMAIL PROTECTED] wrote: Hey folks, Before I raise a ticket in the trac I wanted to check out if anyone knows if this is a bug, or if I should be doing something in beforeSave? I have a model, Event. In it, I have 2 fields event_date and event_time, obviously being DATE and TIME fields. In my view, I render them using the form helper and they show up fine - but when I save, they don't insert into the table. I did a print_r($this-data) and got this: Array ( [Event] = Array ( [venue] = Prime Club [address] = [city] = Cologne [country] = DE [event_date_month] = 04 [event_date_day] = 26 [event_date_year] = 2007 [event_time_hour] = 08 [event_time_min] = 0 [event_time_meridian] = pm [notes] = Part of British Music Week [published] = 1 [user_id] = 1 ) ) However, on my inset I have this: INSERT INTO `events` (`venue`,`city`,`country`,`notes`,`published`,`user_id`,`created`,`modified`) VALUES ('Prime Club','Cologne','DE','Part of British Music Week\r\n',1,1,'2007-04-03 16:35:13','2007-04-03 16:35:13') Apart from address (which was empty in this example anyway) all the fields seem to save, EXCEPT for event_date and event_time. So can anyone clarify, is this a bug, or should I be doing something in beforeSave?? Thanks, Tane -- (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/ --~--~-~--~~~---~--~~ 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: Is e(...) from Cake or PHP?
documented here http://api.cakephp.org/basics_8php.html#8e9e812ec353d68946a9296612bab8f4 and http://manual.cakephp.org/chapter/constants On 4/3/07, Pablo Viojo [EMAIL PROTECTED] wrote: Peter, It's a Cake shorcut for echo() function (found in cake/basics.php) . There are someother shorcuts, pr() for print_r(), aa() create an associative array, up() and low() for strtoupper() and strtolower(), etc. Regards, -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On 4/3/07, peterhf [EMAIL PROTECTED] wrote: Will someone point me to a reference to this language feature? I have been unable to find one in CakePHP or PHP. Thanks for the help. Peter - -- (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/ --~--~-~--~~~---~--~~ 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: Debian cakephp installation
rocky [EMAIL PROTECTED] wrote: Can any of you give me some hint please? Check your AllowOverride in /etc/apache2/mods-enabled/userdir.conf ? Is PHP installed correctly? -- Chris Lamb, Cambridgeshire, UK GPG: 0x634F9A20 signature.asc Description: PGP signature
Re: Session Woes
looks like this problem was caused by the firecake helper, wasted a day b/c of firecake. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pagination with CakePHP 1.2 Out of the box - Ajax update shows up twice first time.
I have a strange issue with Pagination. When I click on the next/previous/first/last link for the first time the previous content is pushed below and the new content shows up. After that it just replaced the new content. In other words, when i click on the first time on pagination links, it retains the old content with in content div tag and push it below, get the new content dump it before the old content. If I disable the javascript and click on the links it works without this issue. You can check the issue here Go to http://ps.namo-namaha.net/messages Check the Messages: content. Click on 'Next link on top. Browse below, you will see the page twice. I am not sure what I am doing wrong, I just took the cakephp 1.2 nightly code and did as per nate's blog. TIA --~--~-~--~~~---~--~~ 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: IE7 Not Updating Ajax Divs
Thanks for the heads up! I went ahead and applied your patch and checked the other bug. The other one was resolved as fixed so, I will see what happens when I finish upgrading to 1.2 On Apr 3, 11:14 am, bernardo [EMAIL PROTECTED] wrote: Glad to help! Be careful if you plan to upgrade to cakephp 1.2 because ajax-observeField changed and its behavior is now different if frequency is not set or is less than 1 second. See:https://trac.cakephp.org/ticket/1194 Also I think your code uncovered a bug in 1.2 when frequency is 0. I reported it here: https://trac.cakephp.org/ticket/2339 On Apr 3, 12:37 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Bah, found someone else's code that states if you put frequency to 0.xx, it works in IE and it updates like a keypress. On Apr 3, 8:21 am, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Awesome, that worked. Thanks a ton, bernardo! I wanted it to update on each keypress so, I think I will have it check if it is FF or IE and set the value based on what browser the user is viewing the page in. Unless anyone else knows of a way to make IE update faster. On Apr 2, 7:19 pm, bernardo [EMAIL PROTECTED] wrote: Have you tried with frequency 0 Just a guess... On Apr 2, 7:59 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Well, after searching, I have found a script that you can bookmark to debug XHtmlRequests for IE(7). It shows that there are no requests going through. Wierd. Further more, I have downgraded to prototype 1.5 (the one that's supposed to work for everything) and nothing. I have gone to other sites that update ajax fine so there has to be an error in the code on my side somewhere. Or possibly in Cake's code. Didn't find anything on Trac yet either. Here is the script in case you're wondering. http://blog.monstuff.com/archives/000291.html On Apr 2, 2:45 pm, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Hello. I am having a small problem where the divs that need to be updated via ajax are not being updated in IE7. It works fine in FF. I have searched this group and have found only one other question like this but, no answers. The wierd thing is, when I type something in a field, go to another page and then hit my browser's back button, you can see what is supposed to be in the div. It's like it is only updating on a page load. Anyways, I am using cake 1.1.14.4306, PHP5, Prototype 1.15 and Script.aculo.us 1.7.1 Here is the code I am using. Remember, this works fine in FireFox // /user/view/register.thtml !--snip-- echo div class=\required\span class=\userRegisterLabel\label for=\UserUsername\User Name:/label/spanspan class= \userRegisterField\ . $html-input('User/username', array ( 'size' = 30 ))./spandiv id=\userRegisterUsername\/div/div; echo ; echo $html-tagErrorMsg('User/username', 'Username can only contain Letters, Numbers, Underscores(_) and/or Dashes(-). The username must also between 3-25 characters long.'); echo $ajax-observeField('UserUsername', array ( 'url' = 'check_registration_form/username/', 'update' = 'userRegisterUsername', 'frequency' = 0, 'loading' = document.getElementById('userRegisterUsername').style.display = 'block', 'loaded' = document.getElementById('userRegisterUsername').style.display = 'block' )); !--snip-- If you would like to see more code, just post here please. I will keep searching in the mean-time. If I find an answer I will post here again for anyone who has this problem in the future. --~--~-~--~~~---~--~~ 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: Pagination with CakePHP 1.2 Out of the box - Ajax update shows up twice first time.
Post your relavent code, please. It looks like what happened to me in 1.1.xx I didn't have a $ajax-div('content'); and $ajax- divEnd('content'); in the remote view that I was calling. Without those two tags, it would just display another entire page. On Apr 3, 1:51 pm, Humble Groups [EMAIL PROTECTED] wrote: I have a strange issue with Pagination. When I click on the next/previous/first/last link for the first time the previous content is pushed below and the new content shows up. After that it just replaced the new content. In other words, when i click on the first time on pagination links, it retains the old content with in content div tag and push it below, get the new content dump it before the old content. If I disable the javascript and click on the links it works without this issue. You can check the issue here Go tohttp://ps.namo-namaha.net/messages Check the Messages: content. Click on 'Next link on top. Browse below, you will see the page twice. I am not sure what I am doing wrong, I just took the cakephp 1.2 nightly code and did as per nate's blog. TIA --~--~-~--~~~---~--~~ 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: Going crazy with an error!
What version of cake? Can you post the code you have for UserController and Models? What database tables do you have and what is the structure of the one that is trying to be called? On Apr 3, 10:42 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all, well, I have my database ready and to see how an application would be I used the bake.php script; it generated everything without a single error. Great, I think...but then just as I try to access the /users page I get this error: Notice: Undefined property: Object::$table in /Applications/MAMP/ htdocs/*/cake/libs/model/model_php5.php on line 441 I tried EVERYTHING, literaly EVERYTHING...but the models, controllers and views are generated by bake.php...what it could be? Anyone could help me? 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 -~--~~~~--~~--~--~---
cake-php on Gmane
Cake-php, This list is now on Gmane, giving a few more methods for viewing the contents: http://dir.gmane.org/gmane.comp.php.cakephp.general The 'bloggy' interface looks attractive too: http://blog.gmane.org/gmane.comp.php.cakephp.general Even less excuse for searching the archives now, folks. :) (On a related note, may I propose the admins creating a cake-php-announce list? I sometimes miss project announcements between other mails) Enjoy, -- Chris Lamb, Cambridgeshire, UK GPG: 0x634F9A20 --~--~-~--~~~---~--~~ 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: Saving in a loop
BlenderStyle [EMAIL PROTECTED] wrote: I still don't understand how it works completely. Take a look at the Cake source - it's not that scary, and will improve your understanding far greater than anything written in English. Regarding the create function, I would suggest using create() over setting id to null as it follows the same verb used when discussing the active record pattern elsewhere: having a consistent lexicon is one of the key points of Design Patterns. In addition, calling the create() allows one to override the functionality in your model in the future, if you need to. -- Chris Lamb, Cambridgeshire, UK GPG: 0x634F9A20 signature.asc Description: PGP signature
New PHP Bug Reporting Site
Hello all, For all of us interested in PHP's vulnerabilities, this site posts monthly security bugs in PHP core. http://www.php-security.org/ I hope it proves useful to all. Michael Tuzi --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to execute OthAuth protected actions with a CRON job?
I'm generating a view that is emailed to my subscribers regularly through a CRON job. It works fine if the CRON job is only accessing actions that are unprotected by OthAuth (for example if bvar $othAuthRestrictions = null;/b). It's alright if the initial action being called is unprotected, but it's critical that this action call other actions which are protected. As soon as the action is protected by OthAuth, however, the CRON just stops executing with that call. Any ideas on how to solve this? I can't be the only one trying to run protected actions wtih a CRON job, right? This is the line where the action stops functioning: $this-set('percentage', $this-requestAction('/actions/ get_percentage/'.$user_id)); But if I set var $othAuthRestrictions = null in the ActionsController, then everything runs fine. (But anyone can access my ActionController actions without logging in.) Many thanks for you help! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Integrate cakephp with existing app sessions
I've read a few of the messages here about integration but I can't seem to figure out my situation My existing app sets a session var on login and checks this for each subsequent page. When creating my cake app I thought it would be a simple matter of using $this-Session to access the vars populated by my old script But I can't seem to access them at all I saw a note on the type of sessions possible with cake: cake database and php Aha! I'll change it to php so that they are using the same sessions but this appears to be the default... and I still can't access the other app's session. if I print_r $_SESSION I get some values that are set by cake but I'm not sure where or how this happens it seems to be a seperate session to the existing app Any advice on how to stop cake from doing its own session thing while still starting a regualr session for every page? can I remove some code and replace it with session_start()? Thanks in advance . scoby. --~--~-~--~~~---~--~~ 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 install - missing controller error
I tried making the permissions really open - read/write for everybody and this didn't help. Didn't really expect it to, but oh well. Anybody? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
layout needs variables from db
Hi all, Got a problem. I have a search-form in my layout, that (after submitted) will start search for realestates that fit in the search request. So far, so good. But now i want one field to depend on the database. I want people to be able to select the city wherein they want to search, and for that, it must only be possible to select cities whereof the database has realestates of. So i guess i have to move the searchform to something. First i thought i'd made a component which will select all cities. Then, place the component in app_controller.php, so every controller uses it. And then the cities would be available in the layout. The only problem was i didn't know wheter this would work: would it be possible for the layout to access the cities variable? Then i thought i'd do a requestAction at the place the form should go, and make a action that would select the cities, with a view that only shows the form. The problem with that is that it isn't very efficient. RequestAction would be called with every request the site makes, and i read somewhere that requestAction really slows down the execution. So how do you think about this? What would be the best solution of these two, or is there a totally different way i should do this? Thanks in advance, MYRZ --~--~-~--~~~---~--~~ 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 install - missing controller error
When you point your browser to http://localhost/users/ , cakePHP searches for an index action in users_controller.php, and an index.thtml. So you must add them. /app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; function index() { //Do something } } ? /app/views/users/index.thtml ?php echo hello, world! ? On 4월4일, 오전7시00분, Dave [EMAIL PROTECTED] wrote: I tried making the permissions really open - read/write for everybody and this didn't help. Didn't really expect it to, but oh well. Anybody? --~--~-~--~~~---~--~~ 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: layout needs variables from db
I'm not 100% sure, but I think you want to do the following: I think you need to access the database in your action to get a list of all the cities in the database. That means you'll do it right before every search, but at least then it will be up to date on the latest additions to the database. You might also be able to use caching to make it faster. Use: (Quoted from the cake manual) b Cities-generateList() * string $conditions * string $order * int $limit * string $keyPath * string $valuePath This function is a shortcut to getting a list of key value pairs - especially handy for creating a html select tag from a list of your models. Use the $conditions, $order, and $limit parameters just as you would for a findAll() request. The $keyPath and $valuePath are where you tell the model where to find the keys and values for your generated list. For example, if you wanted to generate a list of roles based on your Role model, keyed by their integer ids, the full call might look something like: $this-set( 'Roles', $this-Role-generateList(null, 'role_name ASC', null, '{n}.Role.id', '{n}.Role.role_name') ); //This would return something like: array( '1' = 'Account Manager', '2' = 'Account Viewer', '3' = 'System Manager', '4' = 'Site Visitor' ); /b You might need to put cities in their own table with an ID number that is used in any other tables that might need to be linked to a city (like address for example). So when you get a new property, you check the city to see if it's unique, and if it is you add it to the cities table. If you already have the city in the cities table, you just refer to it by ID. --~--~-~--~~~---~--~~ 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: layout needs variables from db
I'm not sure how proper this is, but this _should_ work for what I think you're talking about: Instead of using a component, I would define a beforeFilter() method in the AppController that would request the states and set them for the view. So in essence that set() method would be run for every time the page is loaded. Throw in an if statement to avoid loading it for anything using ajax updates or flashes (and to be picky about overhead) and you're gold...I think. Not tested. ? Class AppController extends Controller { public $uses = array('City'); //change to whatever this is for you /* Your stuff... */ public function beforeFilter() { if ($this-layout == 'default') { $this-set('cities', $this-City-findAll()); } } } ? On Apr 3, 7:34 pm, Bootstrapper [EMAIL PROTECTED] wrote: I'm not 100% sure, but I think you want to do the following: I think you need to access the database in your action to get a list of all the cities in the database. That means you'll do it right before every search, but at least then it will be up to date on the latest additions to the database. You might also be able to use caching to make it faster. Use: (Quoted from the cake manual) b Cities-generateList() * string $conditions * string $order * int $limit * string $keyPath * string $valuePath This function is a shortcut to getting a list of key value pairs - especially handy for creating a html select tag from a list of your models. Use the $conditions, $order, and $limit parameters just as you would for a findAll() request. The $keyPath and $valuePath are where you tell the model where to find the keys and values for your generated list. For example, if you wanted to generate a list of roles based on your Role model, keyed by their integer ids, the full call might look something like: $this-set( 'Roles', $this-Role-generateList(null, 'role_name ASC', null, '{n}.Role.id', '{n}.Role.role_name') ); //This would return something like: array( '1' = 'Account Manager', '2' = 'Account Viewer', '3' = 'System Manager', '4' = 'Site Visitor' ); /b You might need to put cities in their own table with an ID number that is used in any other tables that might need to be linked to a city (like address for example). So when you get a new property, you check the city to see if it's unique, and if it is you add it to the cities table. If you already have the city in the cities table, you just refer to it by ID. --~--~-~--~~~---~--~~ 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: layout needs variables from db
I'm not 100% sure, but I think you want to do the following: I think you need to access the database in your action to get a list of all the cities in the database. That means you'll do it right before every search, but at least then it will be up to date on the latest additions to the database. You might also be able to use caching to make it faster. Use: (Quoted from the cake manual) b Cities-generateList() * string $conditions * string $order * int $limit * string $keyPath * string $valuePath This function is a shortcut to getting a list of key value pairs - especially handy for creating a html select tag from a list of your models. Use the $conditions, $order, and $limit parameters just as you would for a findAll() request. The $keyPath and $valuePath are where you tell the model where to find the keys and values for your generated list. For example, if you wanted to generate a list of roles based on your Role model, keyed by their integer ids, the full call might look something like: $this-set( 'Roles', $this-Role-generateList(null, 'role_name ASC', null, '{n}.Role.id', '{n}.Role.role_name') ); //This would return something like: array( '1' = 'Account Manager', '2' = 'Account Viewer', '3' = 'System Manager', '4' = 'Site Visitor' ); /b You might need to put cities in their own table with an ID number that is used in any other tables that might need to be linked to a city (like address for example). So when you get a new property, you check the city to see if it's unique, and if it is you add it to the cities table. If you already have the city in the cities table, you just refer to it by ID. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pagination with CkePHP 1.2 Out of the box - Ajax update shows up twice first time.
Thanks for the reply. i have attached the controller, layout and the view used. Hope it would throw some light. On 4/3/07, Christopher E. Franklin, Sr. [EMAIL PROTECTED] wrote: Post your relavent code, please. It looks like what happened to me in 1.1.xx I didn't have a $ajax-div('content'); and $ajax- divEnd('content'); in the remote view that I was calling. Without those two tags, it would just display another entire page. On Apr 3, 1:51 pm, Humble Groups [EMAIL PROTECTED] wrote: I have a strange issue with Pagination. When I click on the next/previous/first/last link for the first time the previous content is pushed below and the new content shows up. After that it just replaced the new content. In other words, when i click on the first time on pagination links, it retains the old content with in content div tag and push it below, get the new content dump it before the old content. If I disable the javascript and click on the links it works without this issue. You can check the issue here Go tohttp://ps.namo-namaha.net/messages Check the Messages: content. Click on 'Next link on top. Browse below, you will see the page twice. I am not sure what I am doing wrong, I just took the cakephp 1.2 nightly code and did as per nate's blog. TIA --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- default.ctp Description: Binary data index.ctp Description: Binary data messages_controller.php Description: Binary data
Re: New install - missing controller error
OK - this is really funny. So when you have several directories where your site projects reside, confusion can ensue. I had 2 new installs of Cake on my system, one in my ~/Home/Sites dir and one in the primary apache documents folder. I was modifying the former and pointing my browser at the latter. Forgot to change the setup in my editor... Doh. Works fine now. --~--~-~--~~~---~--~~ 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: layout needs variables from db
I've also used: $this-set('cities', $this-{$this-modelNames[0]}-query('SELECT id, title FROM cities as City')); inside the beforeFilter of app_controller.php to do that. The only time you'll run into trouble that way is if no models are defined for a particular controller, so you might check for that. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---