AW: Pagination Help
Hi jst4fun, I don't know one, but haven't investigated. I was just happy when mine worked in the standard mode ;-) However for me this sounds as either writing your own controller action or using JavaScript. Good luck! Anja -Ursprüngliche Nachricht- Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von jst4fun Gesendet: Montag, 13. Oktober 2008 08:30 An: CakePHP Betreff: Re: Pagination Help Any help on this issue? Thanks On Oct 10, 3:48 pm, jst4fun <[EMAIL PROTECTED]> wrote: > Hi all, > I would like to have apaginationin which there wont be any numbered > links instead it will be a textbox with next and previous links to > each side of it. In the textbox the user can enter the page number to > be loaded and then press enter. I am not sure if such an helper exist > for cakephp or whether the defaultpaginationclass got that capability. > Is there any helper that does this, then please provide me with the > link or please let me know whether it is possible using the > currentpaginationhelper. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Pagination Help
Any help on this issue? Thanks On Oct 10, 3:48 pm, jst4fun <[EMAIL PROTECTED]> wrote: > Hi all, > I would like to have apaginationin which there wont be any numbered > links instead it will be a textbox with next and previous links to > each side of it. In the textbox the user can enter the page number to > be loaded and then press enter. I am not sure if such an helper exist > for cakephp or whether the defaultpaginationclass got that > capability. Is there any helper that does this, then please provide me > with the link or please let me know whether it is possible using the > currentpaginationhelper. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AW: Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/dispatcher.php, line 337]
Hi Per, If you haven't found out yet: This happens in Cake 1.2 when the attributes of $form->select are null instead of array(). See this article: http://cakebaker.42dh.com/2008/10/02/migration-from-cakephp-12-rc2-to-rc3/ I hope that helps! Anja -Ursprüngliche Nachricht- Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von [EMAIL PROTECTED] Gesendet: Sonntag, 12. Oktober 2008 17:41 An: CakePHP Betreff: Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/dispatcher.php, line 337] I get that error when I load http://example.com/news/first-post I have this in routes.php: Router::connect('/news/:url', array('controller' => 'news','action' => 'view'), array('pass' => array('url'))); I hope someone can help me... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive find()
Did you check the generated query ? Does it contain the shifts table? On Oct 13, 4:43 am, squidliberty <[EMAIL PROTECTED]> wrote: > As an experiment, I downloaded a fresh copy of Cake 1.2 and added only > the scripts above. I wanted to confirm that this was not a problem > caused by my existing site's configuration. The new installation > produced identical results, so there must be something wrong with the > approach. Maybe I'm just overlooking something obvious... > - Scott > > On Oct 12, 5:44 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > After reading again the post > > > $this->find('all', array( > > 'contain' => array( > > 'Department', 'Sale' => 'Shift(closed)'), > > 'fields' => array('Log.cost') > > ), > > ); > > > Hope this works, I did not catch all relations at first glance, you > > might also use the containable behaviors in the Sale / Departement > > model .. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Tree Helper - is it fully operational?
This concerns the tree helper on the Bakery. I am currently trying to implement some of the settings that are part of the settings array that are passed to the generate method. The "autopath" key - does anyone know how to set it? I have read the code and by default is set to false - i have tried a few settings by none work and the code description is vague. Secondly, $tree->addItemAttribute and $tree- >addTypeAttribute do not work as far as i can see. The tree is set before this method can be usefully called - the class variables set in this method are never seen by the generate method which in turn calls the _attributes method. Really appreciate anyone shedding some light on this useful functionality. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
good way to get favorites?
hey guys i have a favorites db, and a posts db. a user can save a post, and its marked in the favorites db using user_id and post_id I was wondering if there is a way to attach favorites to posts, so any time i read the posts it will also determine if it is a favorite or not. I was thinking of setting up a posts HasMany relationship, but when I do it now it gets ALL the favorites, just not that users. I was thinking of setting the conditions in the hasMany section to "user_id = $this->Session->read(User.id)" but u cant do this kind of thing in the model. any ideas? danke :\ rocket --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Complex Find with HABTM Relationship
Eek that first line was supposed to read Hey all, I'm sorry IF something like this already exists but I really had no clue what to search for. On Oct 12, 10:26 pm, JoshSchramm <[EMAIL PROTECTED]> wrote: > Hey all, I'm sorry something like this already exists but I really had > no clue what to search for. > > I'm trying to set up a rather complex find. It works something like > this. > > I have users, those users can have friends (think social networking > esque). Friends is simply a backrefrence to the users table. I.e. my > join table Friends_Users contains to fields (user_id, friend_id) both > of which point to the Users table. > > Users can have Tips. Therefore Friends have tips. > > Relationally > > Users HABTM Friends. > Users HasMany Tips > Tips BelongsTo Users > > I'm trying to do a find that returns all the tips owned by any friend > of the passed in user as well as any tips owned by the user itself. > > The following SQL query works - > > SELECT * > FROM `tips` > JOIN users ON users.id = tips.user_id > JOIN friends_users ON tips.user_id = friends_users.friend_id > WHERE (friends_users.user_id =2 or tips.user_id=2) > LIMIT 0 , 30 > > But i have no idea how to do that in cakephp world. I posted this on > stackoverflow here > -http://stackoverflow.com/questions/196488/complex-find-in-cake-php > - but havent heard much back yet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Please explain scaffolding changes in RC3
Hi, I'd like to reference this change set -> https://trac.cakephp.org/changeset/7671 What I've found is that scaffold URLs for "add" now open the "edit" scaffold view. http://www.example.com/document/add will render the same view as http://www.example.com/document/edit Mostly because in the scaffold.php file the following lines hard code "add" to be "edit". if ($name === 'add') { $name = 'edit'; } I've reviewed the ticket 7671, but it doesn't explain why this was changed. Is RC3 following a new convention for scaffold views? What do I need to do to my RC2 websites to get them working again. I also noticed that the manual lists scaffold.new.ctp as a view for scaffolding. Can anyone validate if http://book.cakephp.org/view/107/Customizing-Scaffold-Views is correct documentation? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive find()
As an experiment, I downloaded a fresh copy of Cake 1.2 and added only the scripts above. I wanted to confirm that this was not a problem caused by my existing site's configuration. The new installation produced identical results, so there must be something wrong with the approach. Maybe I'm just overlooking something obvious... - Scott On Oct 12, 5:44 pm, francky06l <[EMAIL PROTECTED]> wrote: > After reading again the post > > $this->find('all', array( > 'contain' => array( > 'Department', 'Sale' => 'Shift(closed)'), > 'fields' => array('Log.cost') > ), > ); > > Hope this works, I did not catch all relations at first glance, you > might also use the containable behaviors in the Sale / Departement > model .. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Complex Find with HABTM Relationship
Hey all, I'm sorry something like this already exists but I really had no clue what to search for. I'm trying to set up a rather complex find. It works something like this. I have users, those users can have friends (think social networking esque). Friends is simply a backrefrence to the users table. I.e. my join table Friends_Users contains to fields (user_id, friend_id) both of which point to the Users table. Users can have Tips. Therefore Friends have tips. Relationally Users HABTM Friends. Users HasMany Tips Tips BelongsTo Users I'm trying to do a find that returns all the tips owned by any friend of the passed in user as well as any tips owned by the user itself. The following SQL query works - SELECT * FROM `tips` JOIN users ON users.id = tips.user_id JOIN friends_users ON tips.user_id = friends_users.friend_id WHERE (friends_users.user_id =2 or tips.user_id=2) LIMIT 0 , 30 But i have no idea how to do that in cakephp world. I posted this on stackoverflow here - http://stackoverflow.com/questions/196488/complex-find-in-cake-php - but havent heard much back yet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive find()
Hmmm... that seems to yield the same results (no Shift data). Also I tried adding containable to the Sale and Shift models but that didn't seem to make any difference. Any other ideas? Is there some other method to achieve the desired result? Thanks again! Scott On Oct 12, 5:44 pm, francky06l <[EMAIL PROTECTED]> wrote: > After reading again the post > > $this->find('all', array( > 'contain' => array( > 'Department', 'Sale' => 'Shift(closed)'), > 'fields' => array('Log.cost') > ), > ); > > Hope this works, I did not catch all relations at first glance, you > might also use the containable behaviors in the Sale / Departement > model .. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RC3 auth and can't login
i found the problem i dont know what did wrong but most of in my code i refactoring field name from User/login to User.login and from $this->User->set($this- >data['User']); to $this->User->set($this->data); now working before i typed empty login and password and I loged. On 12 Paź, 22:03, francky06l <[EMAIL PROTECTED]> wrote: > What is the problem ? I mean, what kind of problem do you have ? Can > you log in ? if not, did you check the Sql traces with debug = 2 ? > > On Oct 12, 9:15 pm, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > please tell me, only i've problem witch login to my app after update > > on RC3 ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: using methods in a model
Or use the model constructor... On Sun, Oct 12, 2008 at 5:08 PM, francky06l <[EMAIL PROTECTED]> wrote: > > You can't use a function in a member variable. However you can > probably do it in a beforeFind (even just adding the condition in the > query array).. > > On Oct 12, 7:43 pm, Ryan <[EMAIL PROTECTED]> wrote: >> Cake is not liking: >> >> var $hasAndBelongsToMany = array( >> 'Item' => array( >> 'conditions' => array('`Item`.`site_id`' => >> Configure::read('site_id')) >> ) >> ); >> >> But it's ok with: >> >> var $hasAndBelongsToMany = array( >> 'Item' => array( >> 'conditions' => array('`Item`.`site_id`' => 1) >> ) >> ); >> >> How can I use the value of Configure::read('site_id') in my models? >> >> Thanks! > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
problem with validation and auth
hi, i have problem, cus, after update to rc3, validation and auth modules just died - when im "authing" account, im logged with not exists account, validation not worked on at all .. i baked few applications on cake in same way, and it all worked before, until update to rc3, i dont know what is going wrong .. any one had a similar problem ? any solution? regards, mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: can i cache descripe query ?
Can you read the documentation ? On Sun, Oct 12, 2008 at 7:37 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > can i cache it ? > Nr Query Error AffectedNum. rows Took (ms) > 1 DESCRIBE `aros` 7 7 14 > 2 DESCRIBE `acos` 7 7 13 > 3 DESCRIBE `aros_acos`7 7 14 > 4 DESCRIBE `users`9 9 15 > 5 DESCRIBE `roles`2 2 14 > 6 DESCRIBE `countries`2 2 15 > 7 DESCRIBE `tracker` 10 10 14 > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
can i cache descripe query ?
can i cache it ? Nr Query Error AffectedNum. rows Took (ms) 1 DESCRIBE `aros` 7 7 14 2 DESCRIBE `acos` 7 7 13 3 DESCRIBE `aros_acos`7 7 14 4 DESCRIBE `users`9 9 15 5 DESCRIBE `roles`2 2 14 6 DESCRIBE `countries`2 2 15 7 DESCRIBE `tracker` 10 10 14 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Uploading files to "private" folder
If you don't want to change your code, you can simply add a .htaccess file in your uploads directory ... deny from all On Oct 13, 4:52 am, Orhan Toy <[EMAIL PROTECTED]> wrote: > Hi > > There a plenty of guides about uploading files to a database or to the > public folder with Cake. But what if I just want to upload files to > private folder? One solution could be to make my own folder somewhere > in the root but is there a predefined directory for this purpose? > > What I mean about private is that you can't access the file directly > via an url but instead it is the controller's job to get the file from > the "private" folder and serve it to the user. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Yet another site powered by Cakephp
Thank you all for the feedback so far. I am not using bakesale right now, but perhaps that can be a feature for v1.5. Thanks www.sayhello.me On Oct 12, 2:36 pm, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote: > Hi did you use Bakesale and customized it a bit? > regards > > > > On Sat, Oct 11, 2008 at 8:28 AM, Sayhello <[EMAIL PROTECTED]> wrote: > > > Hello all, > > > Just wanted to introduce yet another site built with CakePHP 1.2 RC3 - > >www.sayhello.me. Sayhello is a new classified ads site to help you buy > > and sell. We are initially launching in the Los Angeles market. Check > > it out. Any suggestions and feedback are welcome. > > > Thank you! > >www.sayhello.me- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive find()
After reading again the post $this->find('all', array( 'contain' => array( 'Department', 'Sale' => 'Shift(closed)'), 'fields' => array('Log.cost') ), ); Hope this works, I did not catch all relations at first glance, you might also use the containable behaviors in the Sale / Departement model .. On Oct 12, 11:02 pm, squidliberty <[EMAIL PROTECTED]> wrote: > Thanks for the speedy response! Unfortunately, that doesn't return any > data from the Shift model. I guess 'fields' overrides 'contain'? > - Scott > > On Oct 12, 4:20 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > Probably: > > > $this->find('all', array( > > 'contain' => array( > > 'Department', > > 'Sale', > > 'Sale' => array('Shift(closed)') > > ), > > 'fields' => array('Log.cost'), > > )); > > > hth > > > On Oct 12, 9:50 pm, squidliberty <[EMAIL PROTECTED]> wrote: > > > > I have three models: Shift, Sale and Log that are related using > > > CakePHP associations (see model definitions below). I want to find > > > logs and return their associated sale and the sale's associated shift. > > > But I'm having a hard time with this... > > > > $this->find('all', array( > > > 'contain' => array( > > > 'Department', > > > 'Sale', > > > 'Sale' => array('Shift') > > > ), > > > 'fields' => array('Shift.closed', 'Log.cost'), > > > )); > > > > Any idea why this produces "SQL Error: 1054: Unknown column > > > 'Shift.closed' in 'field list'? Where am I going wring? Any advice > > > would be appreciated! I've also tried using recursive instead of > > > contain, but had similar results. > > > > Models: > > > class Log extends AppModel { > > > var $name = 'Log'; > > > var $belongsTo = array('Department', 'Sale'); > > > var $actsAs = array('Containable');} > > > > ... > > > class Sale extends AppModel { > > > var $name = 'Sale'; > > > var $belongsTo = array('Shift'); > > > var $hasMany = array('Log');} > > > > ... > > > class Shift extends AppModel { > > > var $name = 'Shift'; > > > var $hasMany = array('Sale'); > > > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Yet another site powered by Cakephp
Hi did you use Bakesale and customized it a bit? regards On Sat, Oct 11, 2008 at 8:28 AM, Sayhello <[EMAIL PROTECTED]> wrote: > > Hello all, > > Just wanted to introduce yet another site built with CakePHP 1.2 RC3 - > www.sayhello.me. Sayhello is a new classified ads site to help you buy > and sell. We are initially launching in the Los Angeles market. Check > it out. Any suggestions and feedback are welcome. > > Thank you! > www.sayhello.me > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive find()
Thanks for the speedy response! Unfortunately, that doesn't return any data from the Shift model. I guess 'fields' overrides 'contain'? - Scott On Oct 12, 4:20 pm, francky06l <[EMAIL PROTECTED]> wrote: > Probably: > > $this->find('all', array( > 'contain' => array( > 'Department', > 'Sale', > 'Sale' => array('Shift(closed)') > ), > 'fields' => array('Log.cost'), > )); > > hth > > On Oct 12, 9:50 pm, squidliberty <[EMAIL PROTECTED]> wrote: > > > I have three models: Shift, Sale and Log that are related using > > CakePHP associations (see model definitions below). I want to find > > logs and return their associated sale and the sale's associated shift. > > But I'm having a hard time with this... > > > $this->find('all', array( > > 'contain' => array( > > 'Department', > > 'Sale', > > 'Sale' => array('Shift') > > ), > > 'fields' => array('Shift.closed', 'Log.cost'), > > )); > > > Any idea why this produces "SQL Error: 1054: Unknown column > > 'Shift.closed' in 'field list'? Where am I going wring? Any advice > > would be appreciated! I've also tried using recursive instead of > > contain, but had similar results. > > > Models: > > class Log extends AppModel { > > var $name = 'Log'; > > var $belongsTo = array('Department', 'Sale'); > > var $actsAs = array('Containable');} > > > ... > > class Sale extends AppModel { > > var $name = 'Sale'; > > var $belongsTo = array('Shift'); > > var $hasMany = array('Log');} > > > ... > > class Shift extends AppModel { > > var $name = 'Shift'; > > var $hasMany = array('Sale'); > > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Yet another site powered by Cakephp
Hi Sayhello I like your website, I am also busy working on a very similar website - which will run here in the uk, (mostly) but with a few added features. You can look at the first - version at www.beplaid.com. Regards Gabriel On Sat, Oct 11, 2008 at 8:28 AM, Sayhello <[EMAIL PROTECTED]> wrote: > > Hello all, > > Just wanted to introduce yet another site built with CakePHP 1.2 RC3 - > www.sayhello.me. Sayhello is a new classified ads site to help you buy > and sell. We are initially launching in the Los Angeles market. Check > it out. Any suggestions and feedback are welcome. > > Thank you! > www.sayhello.me > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
cake bake creating empty files?
Hi, I've used cake bake successfully in the past to generate views, controllers. However, when I go to generate a new view, for example an index view for my Listings controller, cake bake only creates a file called "index.ctp" in listings/, but it's completely blank and empty of any code/text. Does anybody have any ideas why this is happening now? p.s. I recently moved all my code from another webhost, so if cake bake stores some settings somehwere (like in a hidden directory), perhaps those didn't get copied over correctly? Jeff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Issue with complex contain in a find
>> Well, when you run this query using cake, what is the value of the >> main condition => 'MixtureCategory.slug'=>$slug ? >> If you set debug = 2, what do you get in the sql log ? ignore me! it's all fine! I think i was checking my local version not the online version... sorry for the time waste! jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Issue with complex contain in a find
> Well, when you run this query using cake, what is the value of the > main condition => 'MixtureCategory.slug'=>$slug ? > If you set debug = 2, what do you get in the sql log ? here's the full shebang... http://bin.cakephp.org/view/1811829522 cheers, Jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive find()
Probably: $this->find('all', array( 'contain' => array( 'Department', 'Sale', 'Sale' => array('Shift(closed)') ), 'fields' => array('Log.cost'), )); hth On Oct 12, 9:50 pm, squidliberty <[EMAIL PROTECTED]> wrote: > I have three models: Shift, Sale and Log that are related using > CakePHP associations (see model definitions below). I want to find > logs and return their associated sale and the sale's associated shift. > But I'm having a hard time with this... > > $this->find('all', array( > 'contain' => array( > 'Department', > 'Sale', > 'Sale' => array('Shift') > ), > 'fields' => array('Shift.closed', 'Log.cost'), > )); > > Any idea why this produces "SQL Error: 1054: Unknown column > 'Shift.closed' in 'field list'? Where am I going wring? Any advice > would be appreciated! I've also tried using recursive instead of > contain, but had similar results. > > Models: > class Log extends AppModel { > var $name = 'Log'; > var $belongsTo = array('Department', 'Sale'); > var $actsAs = array('Containable');} > > ... > class Sale extends AppModel { > var $name = 'Sale'; > var $belongsTo = array('Shift'); > var $hasMany = array('Log');} > > ... > class Shift extends AppModel { > var $name = 'Shift'; > var $hasMany = array('Sale'); > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Issue with complex contain in a find
Well, when you run this query using cake, what is the value of the main condition => 'MixtureCategory.slug'=>$slug ? If you set debug = 2, what do you get in the sql log ? On Oct 12, 10:07 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > Hi > > I'm experiencing something unexpected with a containable within a > find('first') - here's my code: > > $this->data = $this->Mixture->MixtureCategory->find('first', array( > 'conditions'=>array('MixtureCategory.slug'=>$slug, > 'MixtureCategory.status'=>1), > 'recursive'=>2, > 'contain'=>array( > 'BannerImage', > 'Mixture'=>array('BannerImage', > 'conditions'=>array('Mixture.status'=>1)), > 'ParentMixtureCategory'=>array('BannerImage'), > 'ChildMixtureCategory'=>array('BannerImage', > 'Mixture'=>array('conditions'=>array('Mixture.status'=>1))) > ) > )); > > This outputs a few queries, one of which is: > > SELECT `BannerImage`.`id`, `BannerImage`.`document_category_id`, > `BannerImage`.`model`, `BannerImage`.`foreign_key`, > `BannerImage`.`name`, `BannerImage`.`description`, > `BannerImage`.`meta_title`, `BannerImage`.`meta_keywords`, > `BannerImage`.`meta_description`, `BannerImage`.`extension`, > `BannerImage`.`mime_type`, `BannerImage`.`filesize`, > `BannerImage`.`md5`, `BannerImage`.`allow_delete`, > `BannerImage`.`status`, `BannerImage`.`created`, > `BannerImage`.`modified`, `BannerImagesMixtureCategory`.`id`, > `BannerImagesMixtureCategory`.`mixture_category_id`, > `BannerImagesMixtureCategory`.`document_id` FROM `documents` AS > `BannerImage` JOIN `banner_images_mixture_categories` AS > `BannerImagesMixtureCategory` ON > (`BannerImagesMixtureCategory`.`mixture_category_id` = 5 AND > `BannerImagesMixtureCategory`.`document_id` = `BannerImage`.`id`) > WHERE 1 = 1 > > This shows no records found in the SQL log - but when i run the exact > query above in phpmyadmin the record i expect is found. > > Any ideas? > > Thanks, > > Jon > -- > > jon bennett > w:http://www.jben.net/ > iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: New to CakePHP
Seems to be a rewrite-mode story. Be sure you have enabled rewrite-mode .. As I remember on Xampp it's not enabled by default. Check your httpd.conf file in "c:\xampp\apache\conf" and uncomment the line #LoadModule rewrite_module modules/mod_rewrite.so hth On Oct 12, 8:16 pm, imran k <[EMAIL PROTECTED]> wrote: > Hi everyone! I am Imran k and very new to CakePHP. I have downloaded > cake_1.2.0.7692-rc3 and installed on XAMPP server but the 'welcome > screen' appears without any graphics or colors. > > I tried editing the httpd.conf file but it didn't made any difference. > The screen is still with no color, no styles, no layout, and no font > changes appear—it’s just black text on a white background. > > Can anybody please help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: xmlwriter
Do you mean the xml helper for cake ? On Oct 12, 5:52 am, . <[EMAIL PROTECTED]> wrote: > has anybody worked with xmlwriter (or similar) with cakephp? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/dispatcher.php, line 337]
I do not think ':url' is recognized, if :url is an id use :id, if it's an action use :action .. hth On Oct 12, 5:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I get that error when I load the pagehttp://example.com/news/first-post > > I have this in my routes.php: > Router::connect('/news/:url', array('controller' => 'news','action' => > 'view'), array('pass' => array('url'))); > > I hope someone can help me... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can I Cache::write() forever
Well "forever" maybe means parameter "duration" => '+10 years' or so ... hth On Oct 12, 7:38 pm, angel333 <[EMAIL PROTECTED]> wrote: > Hello, > > I would like to cache something forever, can I use Cache::write() for > this? > > Thanks, Ondrej --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: using methods in a model
You can't use a function in a member variable. However you can probably do it in a beforeFind (even just adding the condition in the query array).. On Oct 12, 7:43 pm, Ryan <[EMAIL PROTECTED]> wrote: > Cake is not liking: > > var $hasAndBelongsToMany = array( > 'Item' => array( > 'conditions' => array('`Item`.`site_id`' => > Configure::read('site_id')) > ) > ); > > But it's ok with: > > var $hasAndBelongsToMany = array( > 'Item' => array( > 'conditions' => array('`Item`.`site_id`' => 1) > ) > ); > > How can I use the value of Configure::read('site_id') in my models? > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Issue with complex contain in a find
Hi I'm experiencing something unexpected with a containable within a find('first') - here's my code: $this->data = $this->Mixture->MixtureCategory->find('first', array( 'conditions'=>array('MixtureCategory.slug'=>$slug, 'MixtureCategory.status'=>1), 'recursive'=>2, 'contain'=>array( 'BannerImage', 'Mixture'=>array('BannerImage', 'conditions'=>array('Mixture.status'=>1)), 'ParentMixtureCategory'=>array('BannerImage'), 'ChildMixtureCategory'=>array('BannerImage', 'Mixture'=>array('conditions'=>array('Mixture.status'=>1))) ) )); This outputs a few queries, one of which is: SELECT `BannerImage`.`id`, `BannerImage`.`document_category_id`, `BannerImage`.`model`, `BannerImage`.`foreign_key`, `BannerImage`.`name`, `BannerImage`.`description`, `BannerImage`.`meta_title`, `BannerImage`.`meta_keywords`, `BannerImage`.`meta_description`, `BannerImage`.`extension`, `BannerImage`.`mime_type`, `BannerImage`.`filesize`, `BannerImage`.`md5`, `BannerImage`.`allow_delete`, `BannerImage`.`status`, `BannerImage`.`created`, `BannerImage`.`modified`, `BannerImagesMixtureCategory`.`id`, `BannerImagesMixtureCategory`.`mixture_category_id`, `BannerImagesMixtureCategory`.`document_id` FROM `documents` AS `BannerImage` JOIN `banner_images_mixture_categories` AS `BannerImagesMixtureCategory` ON (`BannerImagesMixtureCategory`.`mixture_category_id` = 5 AND `BannerImagesMixtureCategory`.`document_id` = `BannerImage`.`id`) WHERE 1 = 1 This shows no records found in the SQL log - but when i run the exact query above in phpmyadmin the record i expect is found. Any ideas? Thanks, Jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Recursive find()
I have three models: Shift, Sale and Log that are related using CakePHP associations (see model definitions below). I want to find logs and return their associated sale and the sale's associated shift. But I'm having a hard time with this... $this->find('all', array( 'contain' => array( 'Department', 'Sale', 'Sale' => array('Shift') ), 'fields' => array('Shift.closed', 'Log.cost'), )); Any idea why this produces "SQL Error: 1054: Unknown column 'Shift.closed' in 'field list'? Where am I going wring? Any advice would be appreciated! I've also tried using recursive instead of contain, but had similar results. Models: class Log extends AppModel { var $name = 'Log'; var $belongsTo = array('Department', 'Sale'); var $actsAs = array('Containable'); } ... class Sale extends AppModel { var $name = 'Sale'; var $belongsTo = array('Shift'); var $hasMany = array('Log'); } ... class Shift extends AppModel { var $name = 'Shift'; var $hasMany = array('Sale'); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RC3 auth and can't login
What is the problem ? I mean, what kind of problem do you have ? Can you log in ? if not, did you check the Sql traces with debug = 2 ? On Oct 12, 9:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > please tell me, only i've problem witch login to my app after update > on RC3 ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Uploading files to "private" folder
When you upload files, usually it goes to the temp folder of Apache. The you can use "move_uploaded_file" (php function) to move the file to APP."somewhere" ... Of course you would create the "somewhere" folder before. hth On Oct 12, 8:52 pm, Orhan Toy <[EMAIL PROTECTED]> wrote: > Hi > > There a plenty of guides about uploading files to a database or to the > public folder with Cake. But what if I just want to upload files to > private folder? One solution could be to make my own folder somewhere > in the root but is there a predefined directory for this purpose? > > What I mean about private is that you can't access the file directly > via an url but instead it is the controller's job to get the file from > the "private" folder and serve it to the user. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RC3 auth and can't login
please tell me, only i've problem witch login to my app after update on RC3 ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Uploading files to "private" folder
Hi There a plenty of guides about uploading files to a database or to the public folder with Cake. But what if I just want to upload files to private folder? One solution could be to make my own folder somewhere in the root but is there a predefined directory for this purpose? What I mean about private is that you can't access the file directly via an url but instead it is the controller's job to get the file from the "private" folder and serve it to the user. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
New to CakePHP
Hi everyone! I am Imran k and very new to CakePHP. I have downloaded cake_1.2.0.7692-rc3 and installed on XAMPP server but the 'welcome screen' appears without any graphics or colors. I tried editing the httpd.conf file but it didn't made any difference. The screen is still with no color, no styles, no layout, and no font changes appear—it’s just black text on a white background. Can anybody please help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Security question: AuthComponent and passwords
in rc3 i've big problem witch auth component ;< On 12 Paź, 19:00, "Bernhard J. M. Grün" <[EMAIL PROTECTED]> wrote: > Hi! > > Thanks for your response. > I already know that Security::hash() is used to generate the hash. But the > problem is that the hash is insecure (for passwords) in my eyes. The reason > is that two passwords encrypt to the same hash (given the secret salt is the > same which is the case). > > -- Bernhard J. M. Grün > > 2008/10/12 [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > > > >http://api.cakephp.org/class_auth_component.html#216d4deefcd62ffeac5d... > > > On Oct 11, 5:24 am, "Bernhard J. M. Grün" > > <[EMAIL PROTECTED]> wrote: > > > Hi! > > > > Is it correct that the passwords created with the help of the > > AuthComponent > > > are not public hashed (i.e. only secret hashed)? At least in my test app > > it > > > seems to be like that. > > > If so this is a major security hole. > > > Example: > > > User Alice has password "test": 2dd357c503a6812e276096a306cca02852cc1e4f > > > User Bob has the same password: 2dd357c503a6812e276096a306cca02852cc1e4f > > > Now hacker Charlie becomes access to the database. He sees that both > > > passwords are identical. So it is much easier for him to break in. If > > user > > > Alice for example uses her password for other websites and hacker Charlie > > > gets that password also user Bob's account is lost. > > > IMHO there is a reason why Unix, *BSD, Linux, OSX, ... uses a public salt > > > for their passwords. Maybe CakePHP should do the same. > > > So the correct way for passwords is: > > > crypt(crypt('password', 'secretsalt'), 'publicsalt') where publicsalt is > > > concatenated at front of the crypted password. > > > > -- Bernhard J. M. Grün --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
FirePHP debugging on live server?
I installed the Firephp debugging class on my cakephp site. The debugging in FireBug works on my local server but not on my live server . . . . any thoughts why this would happen? Thanks, Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
captcha validation from controller
Hi, I am using Integrate CakePHP with Kcaptcha from bakery. Finding problem at the time of captcha validation from controller. I found below code $this->User->validate = array('captchaText' => array('Mycaptcha' => array('method' => 'validateCaptcha', 'message' => 'your error message'))); I tried to find out definition for this method but could not succeeded Can any one tell me what's Mycaptcha here and where should I write code for validateCaptcha function. I put this code at three different places but could not succeed, User model , captcha component or a helper validation.php Please tell me what 's Mycaptcha and where should i put code of validateCaptcha function. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
using methods in a model
Cake is not liking: var $hasAndBelongsToMany = array( 'Item' => array( 'conditions' => array('`Item`.`site_id`' => Configure::read('site_id')) ) ); But it's ok with: var $hasAndBelongsToMany = array( 'Item' => array( 'conditions' => array('`Item`.`site_id`' => 1) ) ); How can I use the value of Configure::read('site_id') in my models? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Can I Cache::write() forever
Hello, I would like to cache something forever, can I use Cache::write() for this? Thanks, Ondrej --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Security question: AuthComponent and passwords
Hi! Thanks for your response. I already know that Security::hash() is used to generate the hash. But the problem is that the hash is insecure (for passwords) in my eyes. The reason is that two passwords encrypt to the same hash (given the secret salt is the same which is the case). -- Bernhard J. M. Grün 2008/10/12 [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > > http://api.cakephp.org/class_auth_component.html#216d4deefcd62ffeac5d9334b9cc2614 > > On Oct 11, 5:24 am, "Bernhard J. M. Grün" > <[EMAIL PROTECTED]> wrote: > > Hi! > > > > Is it correct that the passwords created with the help of the > AuthComponent > > are not public hashed (i.e. only secret hashed)? At least in my test app > it > > seems to be like that. > > If so this is a major security hole. > > Example: > > User Alice has password "test": 2dd357c503a6812e276096a306cca02852cc1e4f > > User Bob has the same password: 2dd357c503a6812e276096a306cca02852cc1e4f > > Now hacker Charlie becomes access to the database. He sees that both > > passwords are identical. So it is much easier for him to break in. If > user > > Alice for example uses her password for other websites and hacker Charlie > > gets that password also user Bob's account is lost. > > IMHO there is a reason why Unix, *BSD, Linux, OSX, ... uses a public salt > > for their passwords. Maybe CakePHP should do the same. > > So the correct way for passwords is: > > crypt(crypt('password', 'secretsalt'), 'publicsalt') where publicsalt is > > concatenated at front of the crypted password. > > > > -- Bernhard J. M. Grün > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Security question: AuthComponent and passwords
http://api.cakephp.org/class_auth_component.html#216d4deefcd62ffeac5d9334b9cc2614 On Oct 11, 5:24 am, "Bernhard J. M. Grün" <[EMAIL PROTECTED]> wrote: > Hi! > > Is it correct that the passwords created with the help of the AuthComponent > are not public hashed (i.e. only secret hashed)? At least in my test app it > seems to be like that. > If so this is a major security hole. > Example: > User Alice has password "test": 2dd357c503a6812e276096a306cca02852cc1e4f > User Bob has the same password: 2dd357c503a6812e276096a306cca02852cc1e4f > Now hacker Charlie becomes access to the database. He sees that both > passwords are identical. So it is much easier for him to break in. If user > Alice for example uses her password for other websites and hacker Charlie > gets that password also user Bob's account is lost. > IMHO there is a reason why Unix, *BSD, Linux, OSX, ... uses a public salt > for their passwords. Maybe CakePHP should do the same. > So the correct way for passwords is: > crypt(crypt('password', 'secretsalt'), 'publicsalt') where publicsalt is > concatenated at front of the crypted password. > > -- Bernhard J. M. Grün --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Behaviors called for COUNT queries in RC3
Looks like RC3 has added an empty array for the model when a COUNT is performed. before I would do this in my afterFind method. foreach( $results as &$record ) { if(isset($record['Portfolio'])) { $record['Portfolio']['long_title'] = $this- >getTitle( $record['Portfolio'] ); } } Now, I have to check if $record['Portfolio'] is also not empty. Anyway, I hope this helps someone :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Yet another site powered by Cakephp
Cograts! On 10/12/2008, Gonzalo Servat <[EMAIL PROTECTED]> wrote: > On Sat, Oct 11, 2008 at 4:28 AM, Sayhello <[EMAIL PROTECTED]> wrote: > >> >> Hello all, >> >> Just wanted to introduce yet another site built with CakePHP 1.2 RC3 - >> www.sayhello.me. Sayhello is a new classified ads site to help you buy >> and sell. We are initially launching in the Los Angeles market. Check >> it out. Any suggestions and feedback are welcome. >> > > Hi, > > Congrats on your new site. One thing I've noticed: if I'm browsing through > the categories, say "Cell Phones", and there are no listings in the > category, then it shows me a link that reads "Get noticed. Be the first". > When I click on it, it shows me a listing of categories to pick from. I was > thinking it might be best if it automatically selects the category from > where I clicked on the link (in this case, Cell Phones). > You might also want to think about allowing multiple categories. If I'm > selling a cell phone, I might want the phone to be in "Electronics" and > "Cell Phones". > > Good luck! > - Gonzalo > > > > -- Xavier A. Mathews Student/Developer/Web-Master GG Client Based Tech Support Specialist Hazel Crest Illinois [EMAIL PROTECTED] "Fear of a name, only increases fear of the thing itself." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Behaviors called for COUNT queries in RC3
Really. Sorry about that. I am now getting errors in all my behaviors when COUNT queries are called, because the structure of the array appears to have changed. Is that one of the changes in RC3? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Yet another site powered by Cakephp
On Sat, Oct 11, 2008 at 4:28 AM, Sayhello <[EMAIL PROTECTED]> wrote: > > Hello all, > > Just wanted to introduce yet another site built with CakePHP 1.2 RC3 - > www.sayhello.me. Sayhello is a new classified ads site to help you buy > and sell. We are initially launching in the Los Angeles market. Check > it out. Any suggestions and feedback are welcome. > Hi, Congrats on your new site. One thing I've noticed: if I'm browsing through the categories, say "Cell Phones", and there are no listings in the category, then it shows me a link that reads "Get noticed. Be the first". When I click on it, it shows me a listing of categories to pick from. I was thinking it might be best if it automatically selects the category from where I clicked on the link (in this case, Cell Phones). You might also want to think about allowing multiple categories. If I'm selling a cell phone, I might want the phone to be in "Electronics" and "Cell Phones". Good luck! - Gonzalo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/dispatcher.php, line 337]
I get that error when I load the page http://example.com/news/first-post I have this in my routes.php: Router::connect('/news/:url', array('controller' => 'news','action' => 'view'), array('pass' => array('url'))); I hope someone can help me... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/dispatcher.php, line 337]
I get that error when I load http://example.com/news/first-post I have this in routes.php: Router::connect('/news/:url', array('controller' => 'news','action' => 'view'), array('pass' => array('url'))); I hope someone can help me... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP 1.2 RC3 - Problem with alphaNumeric validation
Sorry for the continued posting, but I've discovered it's cake/libs/ model/model.php which changes between 7689 and 7690 and stops my validation working. There are lots of changes between these revisions so I'm wondering if anyone could help me work out if it's a bug or if I need to change my code. Thanks in advance. On Oct 12, 4:04 pm, John Jackson <[EMAIL PROTECTED]> wrote: > After a bit of investigation, I have found that the exact same > validation code works in revision 7689, but not in 7690. > > On Oct 12, 3:44 pm, John Jackson <[EMAIL PROTECTED]> wrote: > > > I have the same problem here with 1.2 RC3. It's odd because my > > username and email validation appears to be working as expect, but my > > validation on the password fields isn't working. My validation rules > > are as follows: > > > var $validate = array > > ( > > 'email' => array > > ( > > 'valid' => array > > ( > > 'rule' => 'email', > > 'required' => true, > > 'message' => 'Please enter a valid email address', > > ), > > 'unique' => array > > ( > > 'rule' => 'isUnique', > > 'required' => true, > > 'message' => 'This email address has already been > > used', > > ) > > ), > > 'username' => array > > ( > > 'unique' => array > > ( > > 'rule' => 'isUnique', > > 'required' => true, > > 'message' => 'This username has already been taken, > > sorry!', > > ), > > 'alphanumeric' => array > > ( > > 'rule' => 'alphaNumeric', > > 'required' => true, > > 'message' => 'Username must be alphanumeric', > > ), > > 'empty' => array > > ( > > 'rule' => array('custom', '/\S+/'), > > 'required' => true, > > 'message' => 'Please enter your username', > > ) > > ), > > 'new_password' => array > > ( > > 'rule' => array('minLength', '6'), > > 'message' => 'Password must be at least 6 characters long', > > 'required' => true, > > ), > > 'confirm_password' => array > > ( > > 'empty' => array > > ( > > 'rule' => array('minLength', '6'), > > 'message' => 'Password must be at least 6 > > characters long', > > 'required' => true, > > ), > > 'identical' => array > > ( > > 'rule' => array('identicalFieldValues', > > 'new_password'), > > 'message' => 'Passwords do not match', > > 'required' => true, > > ) > > ) > > ); > > > Interestingly, even if I change the rule for the password fields to > > the custom regex I'm using for the username field, it still doesn't > > work, yet the username field validation does work. I have tested the > > same code on svn revision 7673 and it works. So somewhere between > > revision 7673 and 7692 there has either been a bug or a change in > > functionality introduced. > > > On Oct 5, 7:18 pm, James Pearson <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > I upgraded my project from RC2 to RC3 today, and all went smoothly > > > except for 1 area, validation. > > > > I have a User model, with the following validation: (a sample) > > > > var $validate = array( > > > > 'first_name' => array( > > > 'alphanumeric' => array( > > > 'rule' => 'alphaNumeric', > > > 'message' => 'Your name can only > > > contain letters.', > > > ), > > > 'between' => array( > > > 'rule' => array('between', 1, 15), > > > 'message' => 'You must supply > > > your first name', > > > 'required' => true > > > ) > > > ), > > > 'last_name' => array( > > > 'alphanumeric' => array( > > > 'rule' => 'alphaNumeric', > > > 'message' => 'Your name can only > > > contain letters.', > > >
Re: Sanitize problem with writing negative numbers into db
The best part of sanitize that I found was the stripAll/stripScripts, if you want prevent things like XSS attacks. However, I'm a big fan of the HTMLPurifier that I'm already using in my app. I think for my app, I'm going to use the HTMLPurifier and create a function to loop through arrays of data, much like the Sanitize::clean, to clean up my data. Just some thoughts. Speaking of which, how does Sanitize::clean loop through an entire array? Is there some sort of method that's already built into cake that will do this? On Oct 10, 7:37 am, stefanski <[EMAIL PROTECTED]> wrote: > Hi folks, I want to clean up user input before saving into the > database, but when I Sanitize::clean($this->data) it changes negative > integer values like -10 into -10 and I get a database (Postgres) > error because - obviously - it's not an integer anymore. > > I want to avoid manually cleaning avery text field and wonder, what > other people - like you! - do ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: In controller using too many models hit the performance?
Another thing to keep in mind is that you can access all your models through their relations. so $this->model->relatedModel->anotherRelatedModel->find('all') will work. Cake will build all the related models for the models in $uses, so you can access them through relations if you don't need them at $this->model. Personally, I find uses most useful for loading models that would be inaccessible with relations. -Mark On Oct 12, 1:04 am, Bo Huang <[EMAIL PROTECTED]> wrote: > Thanks a lot, Larry and David. > > > > David C. Zentgraf wrote: > > > Yes, the more models you use, the more overhead there is. Not only in > > terms of database hits, but simply the fact that an additional class > > needs to be included and loaded. So design your database and models > > wisely from the start. > > > Having said that, this overhead is often negligible, except for truly > > performance hungry apps. If you have such a performance hungry app, > > think about conditionally loading models with App::import. > > Also, as soon as you go to debug mode 0, the models will be cached and > > not DESCRIBED every single time. (What Larry said.) > > > On 12 Oct 2008, at 11:42, [EMAIL PROTECTED] wrote: > > >> Hi there, > > >> My controller includes eight models as follows, > >> var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'); > > >> When loading a view for the controller, it always DESCRIBE the above > >> eight TABLES (models) even the action (view) has nothing to do with > >> these tables. From the cakephp log on view, it is a big performance > >> hit for me. > > >> Q: > >> 1. is this by design? > >> 2. how to reduce these queries? > > >> I didn't get much helpful info from internet and cakephp official > >> site. I'd appreciate it if any help (or article link). > > >> Thanks, > >> Bo > > -- > View this message in > context:http://n2.nabble.com/In-controller-using-too-many-models-hit-the-perf... > Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP 1.2 RC3 - Problem with alphaNumeric validation
After a bit of investigation, I have found that the exact same validation code works in revision 7689, but not in 7690. On Oct 12, 3:44 pm, John Jackson <[EMAIL PROTECTED]> wrote: > I have the same problem here with 1.2 RC3. It's odd because my > username and email validation appears to be working as expect, but my > validation on the password fields isn't working. My validation rules > are as follows: > > var $validate = array > ( > 'email' => array > ( > 'valid' => array > ( > 'rule' => 'email', > 'required' => true, > 'message' => 'Please enter a valid email address', > ), > 'unique' => array > ( > 'rule' => 'isUnique', > 'required' => true, > 'message' => 'This email address has already been > used', > ) > ), > 'username' => array > ( > 'unique' => array > ( > 'rule' => 'isUnique', > 'required' => true, > 'message' => 'This username has already been taken, > sorry!', > ), > 'alphanumeric' => array > ( > 'rule' => 'alphaNumeric', > 'required' => true, > 'message' => 'Username must be alphanumeric', > ), > 'empty' => array > ( > 'rule' => array('custom', '/\S+/'), > 'required' => true, > 'message' => 'Please enter your username', > ) > ), > 'new_password' => array > ( > 'rule' => array('minLength', '6'), > 'message' => 'Password must be at least 6 characters long', > 'required' => true, > ), > 'confirm_password' => array > ( > 'empty' => array > ( > 'rule' => array('minLength', '6'), > 'message' => 'Password must be at least 6 characters > long', > 'required' => true, > ), > 'identical' => array > ( > 'rule' => array('identicalFieldValues', > 'new_password'), > 'message' => 'Passwords do not match', > 'required' => true, > ) > ) > ); > > Interestingly, even if I change the rule for the password fields to > the custom regex I'm using for the username field, it still doesn't > work, yet the username field validation does work. I have tested the > same code on svn revision 7673 and it works. So somewhere between > revision 7673 and 7692 there has either been a bug or a change in > functionality introduced. > > On Oct 5, 7:18 pm, James Pearson <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I upgraded my project from RC2 to RC3 today, and all went smoothly > > except for 1 area, validation. > > > I have a User model, with the following validation: (a sample) > > > var $validate = array( > > > 'first_name' => array( > > 'alphanumeric' => array( > > 'rule' => 'alphaNumeric', > > 'message' => 'Your name can only > > contain letters.', > > ), > > 'between' => array( > > 'rule' => array('between', 1, 15), > > 'message' => 'You must supply your > > first name', > > 'required' => true > > ) > > ), > > 'last_name' => array( > > 'alphanumeric' => array( > > 'rule' => 'alphaNumeric', > > 'message' => 'Your name can only > > contain letters.', > > ), > > 'between' => array( > > 'rule' => array('between', 1, 15), > > 'message' => 'You must supply your > > last name', > > 'required' => true > > ) > > ) > > ); > > > In CakePHP 1.2 RC3 both first_name and last_name fail to validate with > > valid values (or any value infact). > > > I've traced this down to the re
Re: Behaviors called for COUNT queries in RC3
On Oct 12, 4:50 pm, Mathew <[EMAIL PROTECTED]> wrote: > Behaviors are now called after each COUNT query. The "afterFind" > method is called with data like this. Behaviors have always been called after all finds. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Yet another site powered by Cakephp
Congrats on your new site. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Behaviors called for COUNT queries in RC3
Behaviors are now called after each COUNT query. The "afterFind" method is called with data like this. Array ( [0] => Array ( [count] => 14 ) ) Should behaviors have a new method called afterCount. How can you tell the difference between a COUNT query and a table that has a field called "count". --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP 1.2 RC3 - Problem with alphaNumeric validation
I have the same problem here with 1.2 RC3. It's odd because my username and email validation appears to be working as expect, but my validation on the password fields isn't working. My validation rules are as follows: var $validate = array ( 'email' => array ( 'valid' => array ( 'rule' => 'email', 'required' => true, 'message' => 'Please enter a valid email address', ), 'unique' => array ( 'rule' => 'isUnique', 'required' => true, 'message' => 'This email address has already been used', ) ), 'username' => array ( 'unique' => array ( 'rule' => 'isUnique', 'required' => true, 'message' => 'This username has already been taken, sorry!', ), 'alphanumeric' => array ( 'rule' => 'alphaNumeric', 'required' => true, 'message' => 'Username must be alphanumeric', ), 'empty' => array ( 'rule' => array('custom', '/\S+/'), 'required' => true, 'message' => 'Please enter your username', ) ), 'new_password' => array ( 'rule' => array('minLength', '6'), 'message' => 'Password must be at least 6 characters long', 'required' => true, ), 'confirm_password' => array ( 'empty' => array ( 'rule' => array('minLength', '6'), 'message' => 'Password must be at least 6 characters long', 'required' => true, ), 'identical' => array ( 'rule' => array('identicalFieldValues', 'new_password'), 'message' => 'Passwords do not match', 'required' => true, ) ) ); Interestingly, even if I change the rule for the password fields to the custom regex I'm using for the username field, it still doesn't work, yet the username field validation does work. I have tested the same code on svn revision 7673 and it works. So somewhere between revision 7673 and 7692 there has either been a bug or a change in functionality introduced. On Oct 5, 7:18 pm, James Pearson <[EMAIL PROTECTED]> wrote: > Hello, > > I upgraded my project from RC2 to RC3 today, and all went smoothly > except for 1 area, validation. > > I have a User model, with the following validation: (a sample) > > var $validate = array( > > 'first_name' => array( > 'alphanumeric' => array( > 'rule' => 'alphaNumeric', > 'message' => 'Your name can only > contain letters.', > ), > 'between' => array( > 'rule' => array('between', 1, 15), > 'message' => 'You must supply your > first name', > 'required' => true > ) > ), > 'last_name' => array( > 'alphanumeric' => array( > 'rule' => 'alphaNumeric', > 'message' => 'Your name can only > contain letters.', > ), > 'between' => array( > 'rule' => array('between', 1, 15), > 'message' => 'You must supply your > last name', > 'required' => true > ) > ) > ); > > In CakePHP 1.2 RC3 both first_name and last_name fail to validate with > valid values (or any value infact). > > I've traced this down to the regex in /cake/lib/validations.php, > around line 170. > > My development machine, OS-X, PHP 5.25 this issue does not occur. > On the server, CentOS, PHP 5.1.6 this does occur. > > If this is a setting in PHP, or a known issue with PHP 5.1.6 please > let me know. > > James --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakeP
Re: Associations for multiple tables/models
On Oct 12, 4:22 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > I stand corrected, didn't think of that workaround (not sure I'd call > it a feature). How is understanding and using cake a workaround? > Would be great if Cake would recognize these potentials for > optimization automagically... magic isn't free - and the cost in this case would be unnecessary logic for all queries, with the risk of users being able to make unwanted structural changes to the apps queries. Feel free to write a behavior to do what you're suggesting though. AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Associations for multiple tables/models
I stand corrected, didn't think of that workaround (not sure I'd call it a feature). Would be great if Cake would recognize these potentials for optimization automagically... On 12 Oct 2008, at 23:00, AD7six wrote: > On Oct 12, 3:04 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> Unfortunately there's no makeQueriesSuckLess flag in Cake. Yet. It >> gets you the results you ask for, just don't ask how. If you care >> about the how, do it yourself. ;-) > > FUD. What's the point of using a framework if you are going to ignore > one if it's most powerful features. > > Define or bind B -> belongsTo C > Define or bind B -> hasOne A > > $result = $this->A->B->read/find(); > > $result will contain a, b and c > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Associations for multiple tables/models
On Oct 12, 3:04 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > Unfortunately there's no makeQueriesSuckLess flag in Cake. Yet. It > gets you the results you ask for, just don't ask how. If you care > about the how, do it yourself. ;-) FUD. What's the point of using a framework if you are going to ignore one if it's most powerful features. Define or bind B -> belongsTo C Define or bind B -> hasOne A $result = $this->A->B->read/find(); $result will contain a, b and c --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to remove project from cakeforge.php?
I mainly want to completely delete files I have committed to the subversion repository on cakeforge.org and start from scratch. How can I do that? Or for that matter how can I delete the whole project from cakeforge.org? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Associations for multiple tables/models
Unfortunately there's no makeQueriesSuckLess flag in Cake. Yet. It gets you the results you ask for, just don't ask how. If you care about the how, do it yourself. ;-) On 12 Oct 2008, at 21:52, jkritikos wrote: > > I m cool with that but are you suggesting this because there is no way > for cake to handle this automatically or are you now aware of how to > do it ?:) > > On Oct 12, 3:49 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: >> On 12 Oct 2008, at 21:39, jkritikos wrote: >> >>> What should i do so that i get the data for A+B+C in one query? >> >> Write your own query. >> >> Chrs, >> Dav > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Associations for multiple tables/models
I m cool with that but are you suggesting this because there is no way for cake to handle this automatically or are you now aware of how to do it ?:) On Oct 12, 3:49 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > On 12 Oct 2008, at 21:39, jkritikos wrote: > > > What should i do so that i get the data for A+B+C in one query? > > Write your own query. > > Chrs, > Dav --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Associations for multiple tables/models
On 12 Oct 2008, at 21:39, jkritikos wrote: > What should i do so that i get the data for A+B+C in one query? Write your own query. Chrs, Dav --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Associations for multiple tables/models
hi all - i m having trouble with associations. I have tables A with a foreign key to table B which has a foreign key to table C. Accordingly, model A belongsTo B, and B belongs to C. However, when i call A.read() i only get data for A and B. If i call B.read() i get data for B and C. I ve messed about with the $recursive attribute but that results in 2 queries being made: one that returns A+B and another that returns B+C - What should i do so that i get the data for A+B+C in one query? thanks, jason --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: In controller using too many models hit the performance?
Thanks a lot, Larry and David. David C. Zentgraf wrote: > > > Yes, the more models you use, the more overhead there is. Not only in > terms of database hits, but simply the fact that an additional class > needs to be included and loaded. So design your database and models > wisely from the start. > > Having said that, this overhead is often negligible, except for truly > performance hungry apps. If you have such a performance hungry app, > think about conditionally loading models with App::import. > Also, as soon as you go to debug mode 0, the models will be cached and > not DESCRIBED every single time. (What Larry said.) > > On 12 Oct 2008, at 11:42, [EMAIL PROTECTED] wrote: > >> >> Hi there, >> >> My controller includes eight models as follows, >> var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'); >> >> When loading a view for the controller, it always DESCRIBE the above >> eight TABLES (models) even the action (view) has nothing to do with >> these tables. From the cakephp log on view, it is a big performance >> hit for me. >> >> Q: >> 1. is this by design? >> 2. how to reduce these queries? >> >> I didn't get much helpful info from internet and cakephp official >> site. I'd appreciate it if any help (or article link). >> >> Thanks, >> Bo >> > > > > > > > -- View this message in context: http://n2.nabble.com/In-controller-using-too-many-models-hit-the-performance--tp1321431p1321630.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to handle multiple submit button in the controller
Use this: //form part controllar/action Sctipt: if($this->params['form']['task] == "task_1") { //Your Task_1 code } if($this->params['form']['task] == "task_2") { //Your Task_2 code } Hope it will help you. If it helps u then don't forget to say me thanks. On Aug 18, 1:26 pm, anus <[EMAIL PROTECTED]> wrote: > Hi all, > > Iam a very new beginner to cakephp. Iam struggling with > multiple submit button in one form(via POST). This is my issue: > > I have .ctp page with two submit button like this, > > create('Task', array('action' => 'home','type' => > 'post')); ?> > submit('tasks.gif',array('name'=>'Task')); ?> > submit('Go',array('name'=>'Go')); ?> > end(); ?> > > I want to identify which button has clicked(Task button or Go button). > How can i identify this?I just tried like this.. > > And in my controller page I have an action "home" like this: > function home() > { > if (isset($this->params['form']['Task'])) > { > echo(" > window.alert(' Task') "); > > } > if (isset($this->params['form']['Go'])) > { > echo(" > window.alert(' Go') "); > > } > > } > > But failed can anyone plz help me. Struggling with this for last > few days! > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
User-generated Access Control (ACL)
Hi guys, I've spent tonight trying to wrap my head around Authentication and Access Control in Cake 1.2. I think I understand it, but I soon realised that I don't think it does what I require, so can anyone help me on this concept? I'm developing an application that requires almost completely user-generated Access Control. For example, one "group" will be able to assign another "group" permissions to access their information. I will be storing these permissions in a lookup table, so an example workflow would be... "If the user belongs to a group which is allowed to access the requested information (i.e. a SPECIFIC database row), let them have it, if not, better luck next time." Unfortunately, this isn't all the AC that I require. I would also need to bind this concept to the standard "logged-in, not logged-in" auth, etc. Even though I've not being looking into this for long, I can already see myself going rapidly insane -- is there anyone out there that can enlighten me? Thanks. -- View this message in context: http://www.nabble.com/User-generated-Access-Control-%28ACL%29-tp19939910p19939910.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM goodness: searching!!
On Oct 11, 11:41 pm, Brenton B <[EMAIL PROTECTED]> wrote: > Out of frustration: hate to say it, but Cake is quickly dropping on my > list of "usable frameworks" due to it's inability to efficiently > handle joins. Oh well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using requestAction() on a hidden method i.e. _navigation()
Cristof's suggestion works as well, and will keep the code clean as well. As an alternative to your question, you can always cache queries in your Categories model, so that the overhead in getting the categories will be negligible. function getCategories() { $categories = Cache::read('categories'); if (empty($categories)) { $categories = $this->find('all'); Cache::write('categories', $categories, '1 hour'); } return $categories; } On Oct 10, 4:24 pm, "Christof Damian" <[EMAIL PROTECTED]> wrote: > 2008/10/10 MikeB <[EMAIL PROTECTED]>: > > > > > Good point. I'm all for following best-practices. However, what if, > > for examples sake, I didn't need to include the navigation in every > > page? I would be wasting time querying/compiling a list of categories > > that wouldn't be accessed in the view. > > Write a CategoryController class and make the classes which need the > categories child classes of this one. There is no need to have it in > AppController. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: In controller using too many models hit the performance?
Isn't it better to user ClassRegistry::init('ModelName') ? ex : $this->ModelName = ClassRegistry::init('ModelName'); And you can put this line on each method require ModelName. Okto.Silaban.Net On Sun, Oct 12, 2008 at 11:21 AM, David C. Zentgraf <[EMAIL PROTECTED]>wrote: > > Yes, the more models you use, the more overhead there is. Not only in > terms of database hits, but simply the fact that an additional class > needs to be included and loaded. So design your database and models > wisely from the start. > > Having said that, this overhead is often negligible, except for truly > performance hungry apps. If you have such a performance hungry app, > think about conditionally loading models with App::import. > Also, as soon as you go to debug mode 0, the models will be cached and > not DESCRIBED every single time. (What Larry said.) > > On 12 Oct 2008, at 11:42, [EMAIL PROTECTED] wrote: > > > > > Hi there, > > > > My controller includes eight models as follows, > > var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'); > > > > When loading a view for the controller, it always DESCRIBE the above > > eight TABLES (models) even the action (view) has nothing to do with > > these tables. From the cakephp log on view, it is a big performance > > hit for me. > > > > Q: > > 1. is this by design? > > 2. how to reduce these queries? > > > > I didn't get much helpful info from internet and cakephp official > > site. I'd appreciate it if any help (or article link). > > > > Thanks, > > Bo > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: In controller using too many models hit the performance?
DESCRIBE happens only in debug>0, when You switch to production mode, describe shouldn't happen. Only overhead may be in those models objects initialization. You may consider lazy initialization of models in controllers methods. On Oct 12, 4:42 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi there, > > My controller includes eight models as follows, > var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'); > > When loading a view for the controller, it always DESCRIBE the above > eight TABLES (models) even the action (view) has nothing to do with > these tables. From the cakephp log on view, it is a big performance > hit for me. > > Q: > 1. is this by design? > 2. how to reduce these queries? > > I didn't get much helpful info from internet and cakephp official > site. I'd appreciate it if any help (or article link). > > Thanks, > Bo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: IP to GEO
Oh, this is a new link. http://bakery.cakephp.org/articles/view/geoip-component Let me try this. Thanks! On Sat, Oct 11, 2008 at 9:32 PM, Pablo Viojo <[EMAIL PROTECTED]> wrote: > I'm using this[1] on 1.2rc3 (and rc2) it looks similar > Regards, > > Pablo Viojo > [EMAIL PROTECTED] > http://needish.com > http://pviojo.net > > [1] http://bakery.cakephp.org/articles/view/geoip-component > > > > On Sat, Oct 11, 2008 at 12:22 PM, Louie Miranda <[EMAIL PROTECTED]>wrote: > >> >> http://bakery.cakephp.org/articles/view/quickly-translate-ip-to-geo-coordinates >> >> Guys, anyone tried to work on this on 1.2.x? >> >> -- >> Louie Miranda ([EMAIL PROTECTED]) >> http://louiemiranda.axishift.com >> >> Security Is A Series Of Well-Defined Steps >> chmod -R 0 / ; and smile :) >> >> >> > > > > -- Louie Miranda ([EMAIL PROTECTED]) http://louiemiranda.axishift.com Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---