Re: Separating user and profile tables
Thanks Dave Maharaj, works like a charm. On Jan 28, 8:46 am, Braindead wrote: > Why do you want to separate login information from other information > about the user? > I cant't think of a good reason to do this. > > Markus If you think system like facebook, you probably understand what I mean. And if not, you could check "Beginning CakePHP: From Novice to Professional" where author explained this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Separating user and profile tables
Why do you want to separate login information from other information about the user? I cant't think of a good reason to do this. Markus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Configure CakePHP not to use Pretty Urls
config.core.php - line 59(ish) 2009/1/28 PaulMan > > Hello everybody, > Is there a way to configure CakePHP NOT to use Pretty Urls? > I'm using the latest version. > > Best Regards > PM > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
On Tue, Jan 27, 2009 at 6:02 PM, brian wrote: > > The API pages were just changed minutes ago (I know, because I was > requesting something as it was changing) and it's a huge improvement, > IMHO. > > Mad props and kudos to whomever worked on this. > > http://api.cakephp.org/ How! Great job! Congrats! But I miss the "members" link with the name of all classes' methods in alphabetic order. :-( Best regards. -- MARCELO DE F. ANDRADE (aka "eleKtron") Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# links http://pa.slackwarebrasil.org/ For Libby's backstory be told on Lost http://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
saveAll() and Auth/Acl - redirecting to login page??
Hello, I have been trying to lock down this problem for the past little while - here is my issue. - I have a form with News Model data, and Link Model data.. - My controller runs $this->News->saveAll($this->data, array ('validate' => 'first')) If one of the validations in the News or Link data-set fails, it all works fine, shows the errors, etc. However, if I try to re-submit, the form with the error, the application freaks out and kills my Authenticated session, prompting me to login again - the AuthMessage I see is that I do not have permission to access this content... what content would that be, I can edit it properly when all fields are entered properly. I am not really sure what is happening, I cannot seem to find a way to log or view anything before the re-direction happens.. my app is not doing anything to the Auth session or anything like that.. What gives? How would I even start to try and track this down? I tried removing Auth and Acl from my components in AppController, and the validation worked multiple times without asking me to login again - so at this point I assume something somewhere is happening to the Auth'd session. Any help on this would be great, I am lost at this point.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
That is one sexy API ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
check it out now. routes have been added. search is working better. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AJAX Validation
How do you go about setting up validation on Ajax.InPlaceEditor? I have the editor working correctly but I cant seem to find anything related to validating before saving the the data from the editor. controller: function ajax_update($id, $sub) { $value = $this->params['form']['value']; $this->User->id = $id; if (!$this->User->saveField($sub, $value, true)) { $this->set('error', true); } $user= $this->User->read(array($sub), $id); if (substr($sub, -3) == '_id') { $new_sub = substr($sub, 0, strlen($sub) - 3); $model_name = Inflector::camelize($new_sub); if (!empty($this->$model_name->display_field)) { $display_field = $this->$model_name->display_field; } else { $display_field = 'name'; } $value = $this->$model_name->field($display_field, array ('id' => $value)); } 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Vote for add Cakephp into Netbeans
Please, vote for cakephp in Netbeans's Framework Support in http://www.netbeans.org/issues/show_bug.cgi?id=140918 Register and vote, please :). -- Diego Caro A. Estudiante Ing. Civil Informática diegocaro | http://diego.bloog.cl "No tengo talentos especiales, pero sí soy profundamente curioso", Albert Einstein. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
access helper from behavior
I'm writing a helper that wraps a bunch of libTidy functionality and will need to use this from a within a behavior's beforeSave(). I thought models could load helpers but see now that this isn't so. Is this new? I guess I've never done that before but I was so sure that this was the case. Is there some way to call a helper from a behavior? I could change this helper to be a component, and call it like $Model->controller->Tidy->whatever(), but that would mean that all of the view usage would then have to go through the controller's component. Rock, meet hard place. btw, I want to call Tidy from the behavior because I really would prefer to avoid having to do it in the controller in this specific instance. The field that holds the content which will require Tidy maintenance may not exist in some circumstances and the behavior takes care of deciding what needs to be done on beforeSave(). I want to leave the controller completely out of the loop on this as it will cause a lot of bloat, given add(), edit(), admin_add(), etc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
Cool. I've submitted a couple of minor tickets already. On Tue, Jan 27, 2009 at 8:09 PM, Gwoo wrote: > > Api Generator is a plugin. Thats why for now we have it in the url. I > will be adding routes so it will be removed. For now we are testing > out in the real world and everyone should expect things to change. So, > don't update your bookmarks just yet, but also do not expect us to > rewrite all the old urls. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: database.php file change to postgresql stops graphics
I have taken off the trailing comma as you suggested and I get the same result; namely, the main cakephp page comes up with no graphics. If I remove the database.php file, I get the graphics OK, but this is not a usable configuration because I need a database connection, of course. Here is essential part of my database.php file. Any ideas would be greatly appreciated. class DATABASE_CONFIG { var $default = array( 'driver' => 'postgres', 'host' => 'localhost', 'login' => 'postgres', 'password' => 'postgres', 'database' => 'postgres', 'prefix' => '' ); } ?> The webpage says this below with no graphics: Release Notes for CakePHP 1.2.1.8004. Read the changelog Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. On Jan 17, 1:01 pm, brian wrote: > You have an extra comma here: 'prefix' => '', > > I can't think of why this is happening, though. Weird > > On Sat, Jan 17, 2009 at 11:50 AM,reidster wrote: > > > Here is the bottom part of my database.php file. I don't think it has > > a syntax error. > > > class DATABASE_CONFIG { > > var $default = array( > > 'driver' => 'postgres', > > 'host' => 'localhost', > > 'login' => 'postgres', > > 'password' => 'postgres', > > 'database' => 'postgres', > > 'prefix' => '', > > ); > > } > > ?> > > > Here is what I see on the cakephp main page when I have this file in > > place. This is listed with just text and no graphics. > > > Release Notes for CakePHP 1.2.1.8004. > > Read the changelog > > > Your tmp directory is writable. > > > The FileEngine is being used for caching. To change the config edit > > APP/config/core.php > > > Your database configuration file is present. > > > On Jan 17, 12:54 am, brian wrote: > >> No graphics? That's because real Postgres users do everything from a > >> terminal window. And LIKE it! > > >> ... > > >> I kid! Long-time pg user here. I've no idea what the problem might be, > >> though. You're not missing a closing brace or something? > > >> On Fri, Jan 16, 2009 at 10:01 PM,reidster wrote: > > >> > This is a new cakephp install. I'm trying to use postgresql 8.3.5. > >> > However, whenever I rename the database.php.default to database.php > >> > and include the following for the postgresql details, the graphics > >> > disappear from my cakephp main page. > > >> > var $default = array( > >> > 'driver' => 'postgres', > >> > 'host' => 'localhost', > >> > 'login' => 'postgres', > >> > 'password' => 'postgres', > >> > 'database' => 'postgres', > >> > 'prefix' => '', > >> > ); > > >> > If I rename the database.php back to database.php.default, then it > >> > works fine, but, of course, the main page says this "Your database > >> > configuration file is NOT present.". > > >> > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
Api Generator is a plugin. Thats why for now we have it in the url. I will be adding routes so it will be removed. For now we are testing out in the real world and everyone should expect things to change. So, don't update your bookmarks just yet, but also do not expect us to rewrite all the old urls. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Configure CakePHP not to use Pretty Urls
Hello everybody, Is there a way to configure CakePHP NOT to use Pretty Urls? I'm using the latest version. Best Regards PM --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
You could use mod_rewrite to alleviate the old bookmarks issue. I don't know how this is all arranged, but the changes don't seem to be too complex. Basically, http://api.cakephp.org/classes.html to http://api.cakephp.org/api_generator/classes http://api.cakephp.org/class_controller.html to http://api.cakephp.org/api_generator/view_class/controller Although: http://api.cakephp.org/class_html_helper.html needs to be http://api.cakephp.org/api_generator/view_class/html-helper But there were a lot more links than just to the classes. Actually, "api_generator" appears to be superfluous, considering this is the "api" subdomain. But, again, I don't know how this is set up. On Tue, Jan 27, 2009 at 5:27 PM, Gwoo wrote: > > Darn you guys are fast :) > > Mark Story and I have been working hard to get a truly functional API > up for everyone. Yes, this means that old bookmarks have moved. > However, we are happy to have working solution written in Cake. > Meaning, you can use this plugin for your own projects too. > > There are still problems (like search (which is actually more of > lighttpd issue)), but we'll be happy to see tickets (http:// > thechaw.com/api_generator/tickets) > > Thanks for the props brian. We certainly appreciate it. Stay tuned for > more. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Upload Limit?
Great support AD7six your response helped me 2x as much as everyone else. I thank you. On Tue, Jan 27, 2009 at 4:36 PM, AD7six wrote: > > > > On Jan 27, 11:29 pm, Lamonte wrote: > > @Smelly_Eddie - waste of vps rofl... please refrain to personal > attacks > > I didn't realize your nickname was vps. > > > -- For all your Programming and Technology Information Visit www.BinaryCrunch.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: behaving the CakePHP 1.2 way
On Tue, Jan 27, 2009 at 8:26 PM, Delirium tremens wrote: > > CakePHP 1.2 is encrypting passwords before validating them. > > CakePHP 1.2 is trying to make us behave in a different way. > > Are you behaving the CakePHP 1.2 way? > > What are you doing now that you are not allowed to validate passwords? I take it you're talking about the AuthComponent? If so, yes it hashes passwords automagically so you basically just store the hashed password in your DB. If you don't want that, you can do something like this: $this->Auth->authenticate = $this->User; // or whatever ... Inside the User model, you could have: function hashPasswords( $data ) { return $data; } Instead of hashing the password, it just returns it unmodified (clear text). - 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Quick help in starting to understand Cake's unit tests?
Does anyone know Cake's unit test structures well enough to help me with this? I feel pathetically helpless, and I absolutely hate feeling this way in regards to programming languages. On Jan 13, 11:53 am, BrendonKoz wrote: > I'm sorry, I guess I wasn't very clear. I'm trying to run the test > case and fixtures that were supplied in a patch that has since been > applied. Since I'm still running RC3 on a virtualhost on my dev > server, I figured it would be good to run the test and look at the > code to see how it worked. > > The test case and fixture code is attached and viewable/downloaded > fromhttps://trac.cakephp.org/ticket/5596. > > Because of the error I received, I think I just don't know where I > should be placing these files to get them to run properly, and was > looking for guidance. > > On Jan 12, 4:46 pm, Gwoo wrote: > > > Probably best to paste your test case. Are you using the ClassRegistry > > to create the instance of your test 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Upload Limit?
On Jan 27, 11:29 pm, Lamonte wrote: > @Smelly_Eddie - waste of vps rofl... please refrain to personal attacks I didn't realize your nickname was vps. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Upload Limit?
@Smelly_Eddie - waste of vps rofl...I only got a vps for my image host that hosts over 40k images. Because I'm not 100% linux literate doesn't mean its a waste please refrain to personal attacks please and thankyou. Anyways I've updated these values on my clients server since thats where the file is located and I think its working fine. On Tue, Jan 27, 2009 at 1:07 PM, Jon Bennett wrote: > > > You don't necessarily need to switch hosts. > > I don't think anyone suggested he did, just that if you have a VPS, > you have the control you need to make these changes already. > > Cheers, > > Jon > > -- > > jon bennett > w: http://www.jben.net/ > iChat (AIM): jbendotnet Skype: jon-bennett > > > > -- For all your Programming and Technology Information Visit www.BinaryCrunch.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
Darn you guys are fast :) Mark Story and I have been working hard to get a truly functional API up for everyone. Yes, this means that old bookmarks have moved. However, we are happy to have working solution written in Cake. Meaning, you can use this plugin for your own projects too. There are still problems (like search (which is actually more of lighttpd issue)), but we'll be happy to see tickets (http:// thechaw.com/api_generator/tickets) Thanks for the props brian. We certainly appreciate it. Stay tuned for more. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
behaving the CakePHP 1.2 way
CakePHP 1.2 is encrypting passwords before validating them. CakePHP 1.2 is trying to make us behave in a different way. Are you behaving the CakePHP 1.2 way? What are you doing now that you are not allowed to validate passwords? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: articles search - by name and by tags
> There were substantial changes between the pre-beta and the stable version. > With the massive app I wrote, I did not have time to create test cases. I > then upgraded to a beta version, an the entire app broke. Most importantly > were the find conditions that used like or !=. That is a good reason to use > pre-beta software: when api changes are so substantial that it will break > your app. test cases aside, most things can be sorted with project wide find and replace, eg: find: "=>"!= replace: !="=>" (off top of head!) etc gotta be done at some point, might as well get it over with before you add even more. I started with 1.2 in pre-beta, but upgraded continually with the nightlies, which meant I had to deal with small but frequent api changes, rather than loads of changes in one hit. j -- 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
Except for the part where all my old bookmarks are broken :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: set(compact('whatever'))
No, wait ... I have no idea at all what you're referring to. I just realised that i had a typo when i ran what you posted. AFAICT, doing this: $foo = $foo; $bar = $bar; $something_else = $something_else; ... has absolutely no effect. I thought you were trying to point out some PHP strangeness even though the lines are completely unnecessary. If, instead you mean the, "Undefined variable: something_else ..." notice, that's Cake doing that. And that's precisely what this is all about. Cake's set() method passes the var name to Inflector, which camelizes it. Again, though, the workaround is to pass false as the second param. On Tue, Jan 27, 2009 at 3:58 PM, brian wrote: > Yeah, I guess that screws with the symbol table. I agree that seems a > bit buggy. But I don't follow your logic here. I'm not doing what you > have in your example. It's Cake, not PHP, that has the unexpected > behavior in my case. > > Anyway, I figured out how to get around it, documentation be damned. > > On Tue, Jan 27, 2009 at 2:15 PM, rtconner wrote: >> >> I think the issue is PHP and not Cake. >> >> To demonstrate the problem, try this... >> >> public function setStuff($foo, $bar, $something_else) { >> $foo = $foo; >> $bar = $bar; >> $something_else = $something_else; >> $this->controller->set(compact('foo', 'bar', 'something_else')); >> } >> >> And I have no idea why PHP behaves that way, but it does. >> >> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
nice new API layout
The API pages were just changed minutes ago (I know, because I was requesting something as it was changing) and it's a huge improvement, IMHO. Mad props and kudos to whomever worked on this. http://api.cakephp.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: set(compact('whatever'))
Yeah, I guess that screws with the symbol table. I agree that seems a bit buggy. But I don't follow your logic here. I'm not doing what you have in your example. It's Cake, not PHP, that has the unexpected behavior in my case. Anyway, I figured out how to get around it, documentation be damned. On Tue, Jan 27, 2009 at 2:15 PM, rtconner wrote: > > I think the issue is PHP and not Cake. > > To demonstrate the problem, try this... > > public function setStuff($foo, $bar, $something_else) { > $foo = $foo; > $bar = $bar; > $something_else = $something_else; > $this->controller->set(compact('foo', 'bar', 'something_else')); > } > > And I have no idea why PHP behaves that way, but it does. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Closing $ajax->form()
$ajax->submit() will create a submit button. However, it will not end your form. You need to also end your form with $form->end(). $ajax->submit() will work, as indicated previously: >> $ajax->form(); >> $form->inputs(); >> $ajax->submit(); >> $form->end(); Cheers, Graham On Tue, 27 Jan 2009 06:21:45 -0800 (PST), Pyrite wrote: > I can't get $ajax->submit() to work, only $form->end('Submit'). > > What's the difference between the two? > > On Jan 26, 7:59 am, Graham Weldon wrote: >> $ajax->submit() creates an ajax submit element. >> $form->end('something') creates a submit button, and ends the form. >> >> $ajax->form() starts a form. >> Your usage will depends very much on your implementation, and >> requirements. >> >> The simple reason for there not being an $ajax->formEnd() is because its >> super easy to do: $form->end(). >> Both output . >> >> here are some options to illustrate usage: >> >> $form->create(); >> $form->inputs(); >> $form->end('submit'); >> >> $ajax->form(); >> $form->inputs(); >> $form->end('submit'); >> >> $ajax->form(); >> $form->inputs(); >> $ajax->submit(); >> $form->end(); >> >> On Mon, 26 Jan 2009 05:55:02 -0800 (PST), Pyrite >> wrote: >> >> >> >> > So what is the point/usage of $ajax->submit() then if it does not >> > actually submit the form created with $ajax->form() ? >> >> > On Jan 23, 8:05 am, Mono wrote: >> >> When u use the ajax->form, the only difference with a normal form is >> >> the first line. >> >> >> Normal Form: >> >> >> $form->create (...) >> >> $form->input () >> >> $form->input () >> >> $form->end ('Send') >> >> >> Ajax Form: >> >> >> $ajax->form (...) >> >> $form->input () >> >> $form->input () >> >> $form->end ('Send') >> >> >> On 22 Jan., 22:47, Pyrite wrote: >> >> >> > How do you put the close tag in a form created by $ajax->form() ?? >> >> > Why >> >> > is there not an $ajax->formEnd() similar to the FormHelper's >> $form->end >> >> > () ? >> >> >> > Also, when I create a form with $ajax->form(), and I add a submit >> >> > with >> >> > $ajax->submit(), it does not submit the form. A usage example would >> >> > be >> >> > great. I can only get it to submit the form if I use $form->end >> >> > ('Submit') instead of $ajax->submit().- Hide quoted text - >> >> >> - Show quoted text -- Hide quoted text - >> >> - Show quoted text - > -- Cheers, Graham Weldon w. http://grahamweldon.com e. gra...@grahamweldon.com p. +61 407 017 293 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP In A Subdirectory?
I've gotten the same problem when I put the entire application into a directory that contain the words: "app" or "cake" If your directory's real name is "myapp" try changing it for "mysoftware" and reload again, there is no necessary to alter .htaccess files. Hope help. On Jan 26, 5:05 am, inVINCable wrote: > Hey all, > > Very simply question but cannot seem to find the answer. I have the > directory structure and everything in tact in the normal way. However, > on my server I put the entire structure in the /myapp folder in the > document root. > > Now, everything is all mest up and there is no CSS and files are > missing and such. Surely cake has a simple variable to reflect these > changes? Any advice? I have already looked at the book and the bakery > and have tried things but they have not worked, such as messing with > the variables in the index.php file. > > I am using version 1.2 > > Thank you for any advice/pointers. > > Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: set(compact('whatever'))
I think the issue is PHP and not Cake. To demonstrate the problem, try this... public function setStuff($foo, $bar, $something_else) { $foo = $foo; $bar = $bar; $something_else = $something_else; $this->controller->set(compact('foo', 'bar', 'something_else')); } And I have no idea why PHP behaves that way, but it does. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Upload Limit?
> You don't necessarily need to switch hosts. I don't think anyone suggested he did, just that if you have a VPS, you have the control you need to make these changes already. 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Shouldn't saveAll remove associated records as well?
On Jan 26, 6:10 am, Jelmer wrote: > Hi all, > > I use saveAll to save a 'wordset' and it's associated words. In fact, > when reading the record (recursively), I create an extra field in the > wordSet model that contains the associated words, seperated by a > newline, for easy editing. When saving the wordSet, I recreate the > [Word] array for the associated words by looking them up (to make sure > they keep their old ids) and putting them in the $data['Word'] array. > > Then I call saveAll, using atomic = true and validate = first. All > works fine. New words are added, existing words are saved under the > same id (some other stuff can change at that time). But... words that > are *removed* from the wordset are not deleted in the Word table. Yes because its saveAll() not makeIdenticalToPostedData() If you want to delete everything first. Use deleteAll() inside a transaction. > I think that there should be an option in saveAll that would do just > this: remove any associated records in the associated hasMany table > that (1) have the same foreign key value as the edited main record and > (2) do not exist in the array for the associated sub records. Patches are always welcomed :) Write a patch and some test cases and it has a much better chance of being added. But personally I don't have a need for this so I'm not going to build it. -Mark > I even think that if the relation is defined as 'exclusive' AND > 'dependent', this should be done automatically, to avoid orphan > records... > > My relationships are defined as follows: > > Class WordSet extends AppModel { > var $transactional = true; > var $cacheQueries = true; > var $order = 'WordSet.modified desc'; > > var $hasMany = array( > 'Word' => array( > 'exclusive' => true, > 'dependent' => true) > ); > ... > > } > > class Word extends AppModel { > var $cacheQueries = true; > var $belongsTo = 'WordSet'; > var $order = 'Word.word_set_id asc, Word.woord asc'; > ... > > } > > Any thoughts? > > Jelmer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with routing using Javascript's location.href
On Jan 27, 12:27 pm, MichTex wrote: > I had run across several mentions in this forum of the Security.level > value affecting the authentication part of CakePHP's behavior, BTW, I should point out that I certainly would have expected Security.level to affect authentication. ;-) What I meant to say was that I had run across several mentions in the forum of how Security.level apparently affected other behaviors in *unexpected and unwanted ways*. --Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Ajax layout problem
Some one help me too. On Jan 27, 10:08 am, Mahesh Sutar wrote: > Hi All, > > I am very new to CakePHP, I used default layout which is under folder > views\layouts\ > > In once .ctp file I have used Ajax code. Which populates new table. > but that new table is overlapping on footer which is present in > default layout(default.ctp). > > Any body has solution to use Ajax layout. > > Thanks, > --Mahesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Access a database to read and another database for writing
GREAT!!! now it's working fine!!! thanks Sandro!! On 27 jan, 15:30, Sandro Dinnebier wrote: > The solutions is: > > class DATABASE_CONFIG { > > var $default = array( > 'driver' => 'mysql', > 'host' => 'slave.host.ip', > 'login' => '', > 'password' => '.', > 'database' => 'my_db' > ); > > var $master = array( > 'driver' => 'mysql', > 'host' => 'master.host.ip', > 'login' => '', > 'password' => '.', > 'database' => 'my_db' > ); > > } > > class AppModel extends Model { > > function save($data = null, $validate = true, $fieldList = array()) { > > $this->useDbConfig = 'master'; > $result = parent::save($data, $validate, $fieldList); > $this->useDbConfig = 'default'; > return $result; > > } > > function beforeDelete( $cascade=true ) { > $this->useDbConfig = 'master'; > return parent::beforeDelete( $cascade ); > } > > function afterDelete() { > $this->useDbConfig = 'default'; > return parent::afterDelete(); > } > > } > > On 27 jan, 15:05, Eduardo Carvalho wrote: > > > this would be very nice if worked correctly. It happens that the > > connection is made before the beforeSave > > So ... IS NOT SO SIMPLE! > > > On 27 jan, 13:56, Eduardo Carvalho wrote: > > > > I found the answer to this question in: > > > >http://groups.google.com/group/cake-php/browse_thread/thread/58ea010f... > > > > On 27 jan, 10:18, Eduardo Carvalho wrote: > > > > > I would like to configure my application made in CAKE > > > > toaccessadatabasetoreadandanotherdatabasefor writing. > > > > The framework allows me to do this? > > > > > Thanks a lot! > > > > > Eduardo Carvalho --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Displaying validation methos before call Save operation.
o'right, "access" is correct. Found it. $this->Model->invalidfields() thanks On Tue, Jan 27, 2009 at 3:30 PM, brian wrote: > > What do you mean by "display"? You can access the model's $validate > array from the controller: > > $this->Model->validate > > Or have a look at the controller's validate() and validateErrors() > methods. Perhaps that's what you're looking for. > > > http://api.cakephp.org/class_controller.html#0383f0f3d193fcaaaf132b30ccef4604 > > On Tue, Jan 27, 2009 at 11:46 AM, Marcelo Iwata > wrote: > > Is there a way to display validation methods before call the Save > > operation? > > Thanks in advance. > > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Ajax layout problem
Hi All, I am very new to CakePHP, I used default layout which is under folder views\layouts\ In once .ctp file I have used Ajax code. Which populates new table. but that new table is overlapping on footer which is present in default layout(default.ctp). Any body has solution to use Ajax layout. Thanks, --Mahesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Passing an email address as param with a plus(+) sign
What does $email look like before you use set()? I don't think the problem's there but you'll need to backtrack. I just did a test and didn't see any change in the value between controller and view when I used '@' or '%2B'. I'm sure the issue lies before your confirm() method. On Tue, Jan 27, 2009 at 11:57 AM, Jon Molesa wrote: > > Tried that too. Same results. I tried various encodings. Even tired > making it a hashed string. But every time I output it the view, the + > symbol gets converted to a space. I resolved it by doing a str_replace. > That takes care of it, but I'm still curious why it is happening. I'm > curious if CakePHP is sanitizing the string prior to output and if > there's a way to prevent that from happening. > > *On Tue, Jan 27, 2009 at 11:48:15AM -0500 brian wrote: > >> Date: Tue, 27 Jan 2009 11:48:15 -0500 >> From: brian >> Subject: Re: Passing an email address as param with a plus(+) sign >> To: cake-php@googlegroups.com >> >> >> Try with rawurlencode() >> >> On Tue, Jan 27, 2009 at 9:55 AM, Jon Molesa wrote: >> > >> > No, that still didn't get it. If I urlencode the string and pass it as >> > a param /users/confirm/foo%2Bbar%40example.com >> > >> > then in users_controller.php >> > >> > function confirm($email){ >> > $email = urldecode($email); >> > $this->set('email',$email); >> > } >> > >> > confirm.ctp >> > >> > >> > >> > still outputs >> > >> > foo b...@example.com >> > >> > In fact if I leave out the $email = urldecode($email) altogether >> > confirm.ctp still outputs foo b...@example.com. >> > >> > *On Tue, Jan 27, 2009 at 04:23:15AM + schrec...@gmail.com >> > wrote: >> > >> >> Date: Tue, 27 Jan 2009 04:23:15 + >> >> From: schrec...@gmail.com >> >> Subject: Re: Passing an email address as param with a plus(+) sign >> >> To: cake-php@googlegroups.com >> >> >> >> The plus sign needs to be url encoded. The plus sign translates to a >> >> space when used in the url >> >> Schreck >> >> >> >> -Original Message- >> >> From: Jon Molesa >> >> >> >> Date: Mon, 26 Jan 2009 23:19:01 >> >> To: CakePHP >> >> Subject: Passing an email address as param with a plus(+) sign >> >> >> >> >> >> >> >> I'm trying to pass a valid email address as a parameter in the url. >> >> >> >> foo+...@example.com >> >> >> >> in my model it strips the + sign. >> >> >> >> function confirm($email){ >> >> $this->set('email',$email); >> >> } >> >> >> >> confirm.ctp >> >> >> >> >> >> >> >> outputs >> >> >> >> foo b...@example.com >> >> >> >> I believe this is happening prior to the controller function getting >> >> ahold of the string as I've tried various encoding functions including >> >> Security::cipher() at the beginning of the function upon decoding I >> >> still get the above output. Can anyone suggest how I might be able to >> >> retain the + sign in my controller logic and back out to the view? >> >> >> >> -- >> >> Jon Molesa >> >> rjmol...@gmail.com >> >> if you're bored or curious >> >> http://rjmolesa.com >> >> >> >> >> >> >> >> > >> > >> > -- >> > Jon Molesa >> > rjmol...@consoltec.net >> > if you're bored or curious >> > http://rjmolesa.com >> > >> > > >> > >> >> > -- > Jon Molesa > rjmol...@consoltec.net > if you're bored or curious > http://rjmolesa.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: File Upload Limit?
You don't necessarily need to switch hosts. First find out if your host allows you to change these values through .htaccess files. Check out this thread: http://groups.google.com/group/cake-php/browse_thread/thread/a1b2eba7fd4652a5/7661232cbcb1ed82?lnk=gst&q=htaccess+upload_max_filesize#7661232cbcb1ed82 On Jan 26, 11:05 pm, Lamonte wrote: > yeah I own a vps > > > > On Mon, Jan 26, 2009 at 3:23 PM, Jon Bennett wrote: > > > > upload_max_filesize2M2M > > > there's ya problem then! can't upload a 9mb file if the limit is set > > at 2M. Do you have permission to change it? if not, looks like a > > switch of host is required. > > > j > > > -- > > > jon bennett > > w:http://www.jben.net/ > > iChat (AIM): jbendotnet Skype: jon-bennett > > -- > For all your Programming and Technology Information Visitwww.BinaryCrunch.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Access a database to read and another database for writing
The solutions is: class DATABASE_CONFIG { var $default = array( 'driver'=> 'mysql', 'host' => 'slave.host.ip', 'login' => '', 'password' => '.', 'database' => 'my_db' ); var $master = array( 'driver'=> 'mysql', 'host' => 'master.host.ip', 'login' => '', 'password' => '.', 'database' => 'my_db' ); } class AppModel extends Model { function save($data = null, $validate = true, $fieldList = array()) { $this->useDbConfig = 'master'; $result = parent::save($data, $validate, $fieldList); $this->useDbConfig = 'default'; return $result; } function beforeDelete( $cascade=true ) { $this->useDbConfig = 'master'; return parent::beforeDelete( $cascade ); } function afterDelete() { $this->useDbConfig = 'default'; return parent::afterDelete(); } } On 27 jan, 15:05, Eduardo Carvalho wrote: > this would be very nice if worked correctly. It happens that the > connection is made before the beforeSave > So ... IS NOT SO SIMPLE! > > On 27 jan, 13:56, Eduardo Carvalho wrote: > > > I found the answer to this question in: > > >http://groups.google.com/group/cake-php/browse_thread/thread/58ea010f... > > > On 27 jan, 10:18, Eduardo Carvalho wrote: > > > > I would like to configure my application made in CAKE > > > toaccessadatabasetoreadandanotherdatabasefor writing. > > > The framework allows me to do this? > > > > Thanks a lot! > > > > Eduardo Carvalho --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Displaying validation methos before call Save operation.
What do you mean by "display"? You can access the model's $validate array from the controller: $this->Model->validate Or have a look at the controller's validate() and validateErrors() methods. Perhaps that's what you're looking for. http://api.cakephp.org/class_controller.html#0383f0f3d193fcaaaf132b30ccef4604 On Tue, Jan 27, 2009 at 11:46 AM, Marcelo Iwata wrote: > Is there a way to display validation methods before call the Save > operation? > Thanks in advance. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with routing using Javascript's location.href
RichardAtHome-- I had run across several mentions in this forum of the Security.level value affecting the authentication part of CakePHP's behavior, so late last week I tried lowering it to 'medium'. That appeared to slightly improve things, in that the product director began to get correct hotkey behavior at least occasionally (roughly 10% of the time). So, on Saturday I tried lowering it to 'low', as you had suggested, but we saw no further improvement. For all I know, the apparent improvement when I lowered the Security.level the first time may have been entirely coincidental. Anyway, thanks for the suggestion -- it was certainly worth trying. --Bill On Jan 27, 2:41 am, RichardAtHome wrote: > I'd wager its not your code, but CakePHP's security settings. In app/ > config/core.php change > > Configure::write('Security.level', 'high'); > > To > > Configure::write('Security.level', 'low'); > > and see if that clears up the problem. > > On Jan 27, 2:14 am, MichTex wrote: > > > I have been working for a number of months on an application using > > CakePHP, and have for the most part found it to be a very congenial > > development environment. However, for the last few weeks I've been > > struggling with what looks to be some peculiar CakePHP behavior. > > Basically, I am trying to implement keyboard shortcuts (hotkeys) using > > simple Javascript event handling to capture keycodes, and then, via > > the browser's location.href property, route the user to the > > appropriate page. This approach works great most of the time. However, > > there are a couple of users for whom this approach causes the browser > > to route them to the login page rather than the desired page. I have > > rummaged through hundreds of postings here in the CakePHP Google > > group, and done dozens of Google searches through CakePHP > > documentation and numerous relevant blogs, but so far have turned up > > no clues to what the problem is. > > > Let me expand on the details a little bit: > > > -The application I am working on mostly provides a few basic screens > > which present blocks of text followed either by simple forms, or by > > sets of link-type or button-type navigation choices. This part of the > > system works very well. > > > -Recently, the product director wanted me to add hotkeys to speed up > > navigation. For example, in cases where the navigation consists of a > > short list of choices, he wants the user to be able to type a single > > digit associated with each choice. Thus, if there were 5 navigation > > choices, numbered 1 to 5, the user could either use the mouse to click > > on any of the 5 links for those choices, or type the individual digits > > 1 to 5 on the keyboard to select the corresponding link. In another > > case, there is an informational screen with a big Next button at the > > bottom. The product director wants the user to be able to go to the > > next page either by clicking on the Next button with the mouse, or by > > typing either the letter 'n' or a carriage return. > > > -In order to implement the hotkey idea, I wrote some CakePHP code to > > generate simple Javascript to capture keycodes from keypress events, > > and then execute for particular characters a Javascript line of the > > form > > > location.href = 'http://mysite.com/controller/action/arg'; > > > which would cause the browser to switch to the specified page. [I used > > the Event class from the Prototype Javascript library together with > > CakePHP's Javascript Helper. I've attached an example of the kind of > > Javascript that gets generated to the end of this posting.] > > > -When I wrote the hotkey-handling code several weeks ago, it appeared > > to work fine. In fact, it continues to work perfectly for me. Here's > > where it gets weird, though. About 90% of the time, when the product > > director himself tries a hotkey, he ends up on a login screen, as if > > he had been logged out. However, if he hits the back button, and then > > uses the mouse to make a choice on the screen he had been on, that > > works fine. So, he had not in fact been logged out. > > > -The product director has so far tried this with 3 different browsers > > (IE, Firefox and Chrome) on 5 different machines in 2 different > > locations, and gotten the same bad behavior in roughly the same 90/10 > > bad/good behavior split. There are two other people involved with this > > project, as well. For one of them, like me, the hotkeys have never > > failed, while for the other user hotkey navigation has almost always > > worked, but has in fact failed a few times. > > > So, can anyone provide some insight into this situation? Is there any > > reason why routing to a CakePHP page using Javascript's location.href > > should always work for some users, most of the time for other users, > > and rarely for yet others? Is there an alternative way to route to a > > CakePHP page from Javascript? Or is there some other way to implement > > a hotkey capability? > > > T
Re: Adding saveField after $this->Auth->login
I suppose, if Auth->authorize = 'controller', you could put this in your UserController::isAuthorized() method. Just be sure to return true. Alternatively, I guess you could put it in afterFilter() and do this only when the action is login. Or, you could just add it into the existing login() method, as I did. It's not like this logic will be needed anywhere else. On Tue, Jan 27, 2009 at 4:18 AM, thebeardman wrote: > > Hello everyone, > > Do you know how I can add a saveField action right after a succesful > login using Auth? > I would like to update the User.last_visit with the current date just > after the user is logged in. Do I have to rewrite the login function > in the users_controller or is there another way? > > 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake tmp files and subversion
I suggest that everyone starts using git, file ignoring is s much simpler with git, and so is just about everything else about it. Trust me git is where it is at now. On Jan 27, 11:03 am, Tonio wrote: > I just started with cakephp and I also stumbled into this problem, the > solution I did was move the tmp path outside of app. Here's how I did > it:http://singletonio.blogspot.com/2009/01/changing-tmp-directory-of-cak... > It's the simplest solution I can think of. I'm not sure if it has side > effects, but so far it's working fine for me. > Did anyone try this already? If so, did you encounter any problems? > Thanks! > > On Nov 29 2008, 5:37 am, "php.baker" wrote: > > > > > This post really belongs on the subversion group, but I can't seem to > > get any useful answers there (though not for a lack of trying). > > > For any of you who use Subversion (specifically TortoiseSVN on > > windows) with your cake apps. Can u tell me how to prevent tmp files > > (app/tmp/*) from being put into the repository while still preserving > > the tmp directory structure? > > > I have tried setting the global ignore pattern to all of the following > > without success: > > *\tmp\* > > *tmp\* > > tmp\* > > */tmp/cache/models *tmp/cache/persistent *tmp/cache/views/* *tmp/logs* > > *tmp/sessions *tmp/tests* > > \cache\models* \cache\persistent* \cache\views* \logs* \sessions* > > \tests* empty > > None of those patterns have any affect on my tmp files. (Yes I tried > > backslashes and forward slashes) > > > The only pattern that works is \tmp*, but that excludes the tmp > > directory altogether, so I have to create the tmp folders after I do > > the initial import. > > > Near as I can tell this is what the global ignore pattern if for, > > but i just cant get it to work correctly. > > > Thank you- 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP / MIT License - Cake free for bundling with my application?
My understand is that is fine as long as you leave all copyrights in place for the cakephp library portion (the stuff in the cake directory). Gwoo or phpnut might be able to provide further insight. -Erik On Jan 27, 10:36 am, Arne-Kolja Bachstein wrote: > Hi, > > I really appreciate that CakePHP is licensed under the MIT license, as > it offers a wide range of freedom. But nevertheless, before using it > for commercial use, I would like to clear out one big question for me: > Is it allowed, regarding to this license, to deliver a copy of CakePHP > with my commercial app, so I don't have to write out instructions for > obtaining it or something? > > I am planning to write an application on a "product" base, so I could > sell it, but I'm unsure if I had to leave out cake itself in my > applications retail package. > > Thanks in advance, > > Arne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with routing using Javascript's location.href
To all-- In case you didn't see it, down in the quoted text below Alfredo's comment was a brief email exchange I had with him. He had asked me if I had tried the HTML accesskey attribute to set up my keyboard shortcuts. I had replied to him that I had tried these, but found that shortcuts set up that way required additional keys. For example, on Windows one had to hold down the Alt key, while on the Mac one had to hold down the control key, while on yet other platforms one had to do other things. I never found a way to use the accesskey mechanism to create true single key shortcuts (i.e., being able to type a single character, unshifted or otherwise modified). I would be *very* glad to learn that I am wrong about this! I was interested to learn from Alfredo that the accesskey mechanism apparently did work for creating true hotkeys for the cellphone application he had worked on. At any rate, the product director I am working for had specified the use of single key shortcuts, such as are used in various existing web applications (notably Gmail and Google Reader). The accesskey mechanism, as far as I have so far found, does not help with this. --Bill On Jan 26, 10:31 pm, Alfredo Quiroga-Villamil wrote: > Ummm, yeah fortunately in my case the cell phone browsers seem to have > fairly good support for access keys because I don't recall ever > running into any major issues. I remember very clearly that all we had > to do was just to use the regular accesskey for the links we wanted > the users to access. > > Good luck and please post your findings if you come up with a good solution. > > Regards, > > Alfredo > > On Mon, Jan 26, 2009 at 10:24 PM, Bill Cavnar wrote: > > Hi, Alfredo. Thanks for replying. > > BTW, did you reply through the CakePHP Group? If you did, I am not seeing > > your post there yet. > > To answer your question, yes I actually did use the HTML accesskey attribute > > at first. However, it required that the user use either use the Alt key (on > > Windows) or the Control key (on the Mac) or Shift-Esc on Opera, etc. My > > product director wanted it to work like Gmail and other Web 2.0-type apps > > which implement true single-key hotkeys. It really was very disappointed to > > learn about the somewhat hideous complexity that the current accesskey > > implementations all have (look at the first couple of paragraphs from the > > Wikipedia article on access keys to see what I mean). Perhaps it all works > > in a more civilized fashion for cellphone/WAP-style applications. > > Anyway, let me know if you ever come up with some sort of way to do > > single-key accesskeys. > > Thanks again. > > --Bill > > On Mon, Jan 26, 2009 at 9:50 PM, Alfredo Quiroga-Villamil > > wrote: > > >> Hello Bill: > > >> Is there a reason why you are not able to use accesskey (html)? > > >> I had a similar project for cell phone (web) development and > >> accesskey's should do the trick here, also very simple to use. > > >> Example: > > >> http://location";>Display Link > > >> Alfredo > > >> On Mon, Jan 26, 2009 at 9:14 PM, MichTex wrote: > > >> > I have been working for a number of months on an application using > >> > CakePHP, and have for the most part found it to be a very congenial > >> > development environment. However, for the last few weeks I've been > >> > struggling with what looks to be some peculiar CakePHP behavior. > >> > Basically, I am trying to implement keyboard shortcuts (hotkeys) using > >> > simple Javascript event handling to capture keycodes, and then, via > >> > the browser's location.href property, route the user to the > >> > appropriate page. This approach works great most of the time. However, > >> > there are a couple of users for whom this approach causes the browser > >> > to route them to the login page rather than the desired page. I have > >> > rummaged through hundreds of postings here in the CakePHP Google > >> > group, and done dozens of Google searches through CakePHP > >> > documentation and numerous relevant blogs, but so far have turned up > >> > no clues to what the problem is. > > >> > Let me expand on the details a little bit: > > >> > -The application I am working on mostly provides a few basic screens > >> > which present blocks of text followed either by simple forms, or by > >> > sets of link-type or button-type navigation choices. This part of the > >> > system works very well. > > >> > -Recently, the product director wanted me to add hotkeys to speed up > >> > navigation. For example, in cases where the navigation consists of a > >> > short list of choices, he wants the user to be able to type a single > >> > digit associated with each choice. Thus, if there were 5 navigation > >> > choices, numbered 1 to 5, the user could either use the mouse to click > >> > on any of the 5 links for those choices, or type the individual digits > >> > 1 to 5 on the keyboard to select the corresponding link. In another > >> > case, there is an informational screen with a big Next butto
Re: File Upload Limit?
seems like a waste of a vps Three people told you to check the php settings. edit your php.ini to read upload_max_filesize 16M or whatever you want the max to be. You'll also need to adjust max_execution_time<- max time the parser will deal with a script max_input_time <- max time a script may deal with POST, GET or file uploads. since larger uploads will take longer than 30 seconds typically. On Jan 26, 5:05 pm, Lamonte wrote: > yeah I own a vps > > > > On Mon, Jan 26, 2009 at 3:23 PM, Jon Bennett wrote: > > > > upload_max_filesize2M2M > > > there's ya problem then! can't upload a 9mb file if the limit is set > > at 2M. Do you have permission to change it? if not, looks like a > > switch of host is required. > > > j > > > -- > > > jon bennett > > w:http://www.jben.net/ > > iChat (AIM): jbendotnet Skype: jon-bennett > > -- > For all your Programming and Technology Information Visitwww.BinaryCrunch.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component not hashing password
Why not validate before hashing the password? The article below outlines how to handle validation and comparing two password fields. Also handles things like unique username and email addresses. http://edwardawebb.com/programming/php-programming/cakephp/complex-validation-cakephp-12 On Jan 26, 11:52 am, Ivan wrote: > Is there any way to get the Auth component to hash the "confirm > password" input as well? I think that if the password's being hashed > for security reasons, then it's inconsistent not to be able to set the > option of hashing some other password type input. (I know it can > always be hashed with $this->Auth->password(), but I wonder if it > could be set to have it done "automagically", in cakephp terms). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Access a database to read and another database for writing
this would be very nice if worked correctly. It happens that the connection is made before the beforeSave So ... IS NOT SO SIMPLE! On 27 jan, 13:56, Eduardo Carvalho wrote: > I found the answer to this question in: > > http://groups.google.com/group/cake-php/browse_thread/thread/58ea010f... > > On 27 jan, 10:18, Eduardo Carvalho wrote: > > > I would like to configure my application made in CAKE > > toaccessadatabasetoreadandanotherdatabasefor writing. > > The framework allows me to do this? > > > Thanks a lot! > > > Eduardo Carvalho --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Access a database to read and another database for writing
this would be very nice if worked correctly. It happens that the connection is made before the first save. So ... is not as simple as that! On 27 jan, 13:56, Eduardo Carvalho wrote: > I found the answer to this question in: > > http://groups.google.com/group/cake-php/browse_thread/thread/58ea010f... > > On 27 jan, 10:18, Eduardo Carvalho wrote: > > > I would like to configure my application made in CAKE > > toaccessadatabasetoreadandanotherdatabasefor writing. > > The framework allows me to do this? > > > Thanks a lot! > > > Eduardo Carvalho --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Passing an email address as param with a plus(+) sign
Tried that too. Same results. I tried various encodings. Even tired making it a hashed string. But every time I output it the view, the + symbol gets converted to a space. I resolved it by doing a str_replace. That takes care of it, but I'm still curious why it is happening. I'm curious if CakePHP is sanitizing the string prior to output and if there's a way to prevent that from happening. *On Tue, Jan 27, 2009 at 11:48:15AM -0500 brian wrote: > Date: Tue, 27 Jan 2009 11:48:15 -0500 > From: brian > Subject: Re: Passing an email address as param with a plus(+) sign > To: cake-php@googlegroups.com > > > Try with rawurlencode() > > On Tue, Jan 27, 2009 at 9:55 AM, Jon Molesa wrote: > > > > No, that still didn't get it. If I urlencode the string and pass it as > > a param /users/confirm/foo%2Bbar%40example.com > > > > then in users_controller.php > > > > function confirm($email){ > > $email = urldecode($email); > > $this->set('email',$email); > > } > > > > confirm.ctp > > > > > > > > still outputs > > > > foo b...@example.com > > > > In fact if I leave out the $email = urldecode($email) altogether > > confirm.ctp still outputs foo b...@example.com. > > > > *On Tue, Jan 27, 2009 at 04:23:15AM + schrec...@gmail.com > > wrote: > > > >> Date: Tue, 27 Jan 2009 04:23:15 + > >> From: schrec...@gmail.com > >> Subject: Re: Passing an email address as param with a plus(+) sign > >> To: cake-php@googlegroups.com > >> > >> The plus sign needs to be url encoded. The plus sign translates to a space > >> when used in the url > >> Schreck > >> > >> -Original Message- > >> From: Jon Molesa > >> > >> Date: Mon, 26 Jan 2009 23:19:01 > >> To: CakePHP > >> Subject: Passing an email address as param with a plus(+) sign > >> > >> > >> > >> I'm trying to pass a valid email address as a parameter in the url. > >> > >> foo+...@example.com > >> > >> in my model it strips the + sign. > >> > >> function confirm($email){ > >> $this->set('email',$email); > >> } > >> > >> confirm.ctp > >> > >> > >> > >> outputs > >> > >> foo b...@example.com > >> > >> I believe this is happening prior to the controller function getting > >> ahold of the string as I've tried various encoding functions including > >> Security::cipher() at the beginning of the function upon decoding I > >> still get the above output. Can anyone suggest how I might be able to > >> retain the + sign in my controller logic and back out to the view? > >> > >> -- > >> Jon Molesa > >> rjmol...@gmail.com > >> if you're bored or curious > >> http://rjmolesa.com > >> > >> > >> > >> > > > > > -- > > Jon Molesa > > rjmol...@consoltec.net > > if you're bored or curious > > http://rjmolesa.com > > > > > > > > > -- Jon Molesa rjmol...@consoltec.net if you're bored or curious http://rjmolesa.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Passing an email address as param with a plus(+) sign
Try with rawurlencode() On Tue, Jan 27, 2009 at 9:55 AM, Jon Molesa wrote: > > No, that still didn't get it. If I urlencode the string and pass it as > a param /users/confirm/foo%2Bbar%40example.com > > then in users_controller.php > > function confirm($email){ > $email = urldecode($email); > $this->set('email',$email); > } > > confirm.ctp > > > > still outputs > > foo b...@example.com > > In fact if I leave out the $email = urldecode($email) altogether > confirm.ctp still outputs foo b...@example.com. > > *On Tue, Jan 27, 2009 at 04:23:15AM + schrec...@gmail.com > wrote: > >> Date: Tue, 27 Jan 2009 04:23:15 + >> From: schrec...@gmail.com >> Subject: Re: Passing an email address as param with a plus(+) sign >> To: cake-php@googlegroups.com >> >> The plus sign needs to be url encoded. The plus sign translates to a space >> when used in the url >> Schreck >> >> -Original Message- >> From: Jon Molesa >> >> Date: Mon, 26 Jan 2009 23:19:01 >> To: CakePHP >> Subject: Passing an email address as param with a plus(+) sign >> >> >> >> I'm trying to pass a valid email address as a parameter in the url. >> >> foo+...@example.com >> >> in my model it strips the + sign. >> >> function confirm($email){ >> $this->set('email',$email); >> } >> >> confirm.ctp >> >> >> >> outputs >> >> foo b...@example.com >> >> I believe this is happening prior to the controller function getting >> ahold of the string as I've tried various encoding functions including >> Security::cipher() at the beginning of the function upon decoding I >> still get the above output. Can anyone suggest how I might be able to >> retain the + sign in my controller logic and back out to the view? >> >> -- >> Jon Molesa >> rjmol...@gmail.com >> if you're bored or curious >> http://rjmolesa.com >> >> >> >> > > > -- > Jon Molesa > rjmol...@consoltec.net > if you're bored or curious > http://rjmolesa.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Displaying validation methos before call Save operation.
Is there a way to display validation methods before call the Save operation? Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Separating user and profile tables
I use this in my set up and what it does it registers a USER and Creates the PROFILE at the same time. I cleaned it out and left the parts you need to accomplish the same thing. function register() { if (!empty($this->data)) { if (isset($this->data['User']['password2'])) $this->data['User']['password2hashed'] = $this->Auth->password($this->data['User']['password2']); $user = $this->User->save($this->data); // If the user was saved, Now we add this information to the data and save the Profile. if (!empty($user)) { // The ID of the newly created user has been set as $this->User->id. $this->data['User']['user_id'] = $this->User->id; $this->User->Profile->save($this->data); $this->redirect(array('controller' => 'users', 'action' => 'index')); } else { $this->Session->setFlash(__('The User could not be saved. Please, try again.', true)); $this->data = null; } } } And in the register form: div class="users form"> create('User', array('action' => 'register'));?> input('Profile.firstname'); echo $form->input('Profile.lastname'); echo $form->input('User.username'); echo $form->input('User.password'); echo $form->input('User.password2'); echo $form->input('User.email'); ?> end('Submit');?> Dave -Original Message- From: Janne [mailto:janne.yli...@gmail.com] Sent: January-27-09 12:41 PM To: CakePHP Subject: Separating user and profile tables Hi, I´m doing a pretty simple test project with Cake and having some serious problems. I think the solution may be really simple, but I just cant solve it by myself. What I want is simple one-to-one relation between user and profile tables. When user registers to system, his/hers username and password are saved in user table and some profile related stuff to the profile table. So I want to separate example phone number and email address to different table. And of course this profile record should be created automatically with user_id when registered. So obviosly it is easy to create this action and view to create user, which is saved to user-table. I also know how to define this one-to- one relation, that profile belongs to user and profile really has this user_id field. But how can I create this profile row and save example email address there in this same action. I think I should add email field to the view and then somehow add that to profile table with user id. Btw, I´m trying this with freshly baked default controllers and views. Models are working like they should be. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake tmp files and subversion
I just started with cakephp and I also stumbled into this problem, the solution I did was move the tmp path outside of app. Here's how I did it: http://singletonio.blogspot.com/2009/01/changing-tmp-directory-of-cakephp-so-it.html It's the simplest solution I can think of. I'm not sure if it has side effects, but so far it's working fine for me. Did anyone try this already? If so, did you encounter any problems? Thanks! On Nov 29 2008, 5:37 am, "php.baker" wrote: > This post really belongs on the subversion group, but I can't seem to > get any useful answers there (though not for a lack of trying). > > For any of you who use Subversion (specifically TortoiseSVN on > windows) with your cake apps. Can u tell me how to prevent tmp files > (app/tmp/*) from being put into the repository while still preserving > the tmp directory structure? > > I have tried setting the global ignore pattern to all of the following > without success: > *\tmp\* > *tmp\* > tmp\* > */tmp/cache/models *tmp/cache/persistent *tmp/cache/views/* *tmp/logs* > *tmp/sessions *tmp/tests* > \cache\models* \cache\persistent* \cache\views* \logs* \sessions* > \tests* empty > None of those patterns have any affect on my tmp files. (Yes I tried > backslashes and forward slashes) > > The only pattern that works is \tmp*, but that excludes the tmp > directory altogether, so I have to create the tmp folders after I do > the initial import. > > Near as I can tell this is what the global ignore pattern if for, > but i just cant get it to work correctly. > > Thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Separating user and profile tables
Hi, I´m doing a pretty simple test project with Cake and having some serious problems. I think the solution may be really simple, but I just cant solve it by myself. What I want is simple one-to-one relation between user and profile tables. When user registers to system, his/hers username and password are saved in user table and some profile related stuff to the profile table. So I want to separate example phone number and email address to different table. And of course this profile record should be created automatically with user_id when registered. So obviosly it is easy to create this action and view to create user, which is saved to user-table. I also know how to define this one-to- one relation, that profile belongs to user and profile really has this user_id field. But how can I create this profile row and save example email address there in this same action. I think I should add email field to the view and then somehow add that to profile table with user id. Btw, I´m trying this with freshly baked default controllers and views. Models are working like they should be. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cms madesimple
try a cms made simple forum. here be cakephp On Jan 27, 11:18 am, "apurb(php developer)" wrote: > hi!, > > i am new to cms made simple. > i want to upload image/photo/pdf file from frontend user after a user > logged in the frontend side.can any one help me step by step how i can > do this in cms ms. > > anyhelp would be appreciated > hoping for your kind reply > thankyou --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AJAX views help.
I have an idea I want to create but before i start I was wondering how to go about it the correct way. Basic set up: TABLES: USERS GENRES USERS_GENRES So the user can select the genres with the HABTM. On the users page it shows all the genres that they have selected using checkboxes (I am fine up to this point) What i want it to have an edit button where the Genres Section is on the User page so just that section of code for genres can be edited. So when the user clicks edit, the genres becomes all checkboxes to change their selections, click save then the page is returned to the selections. All of this would be on the same page with AJAX. Thanks in advance for ideas, suggestions. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Access a database to read and another database for writing
I found the answer to this question in: http://groups.google.com/group/cake-php/browse_thread/thread/58ea010f930fab6c/fdff3040db8f9cf6 On 27 jan, 10:18, Eduardo Carvalho wrote: > I would like to configure my application made in CAKE > toaccessadatabasetoreadandanotherdatabasefor writing. > The framework allows me to do this? > > Thanks a lot! > > Eduardo Carvalho --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Access a database to read and another database for writing
I would like to configure my application made in CAKE to access a database to read and another database for writing. The framework allows me to do this? Thanks a lot! Eduardo Carvalho --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to bake a difficult db model
Thank you very much! I think it will work that way. Otherwise I will post here again. :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cms madesimple
hi!, i am new to cms made simple. i want to upload image/photo/pdf file from frontend user after a user logged in the frontend side.can any one help me step by step how i can do this in cms ms. anyhelp would be appreciated hoping for your kind reply thankyou --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Adding saveField after $this->Auth->login
Hello everyone, Do you know how I can add a saveField action right after a succesful login using Auth? I would like to update the User.last_visit with the current date just after the user is logged in. Do I have to rewrite the login function in the users_controller or is there another way? 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: To bug or not to bug that is the question!
Thank you for this answer. I uderstand better :-) On 26 jan, 05:06, "Dr. Loboto" wrote: > It is just $components = array ('Session', 'Acl' => false, 'Auth' => > false) > Cake 1.2 allow components include with params (Acl and Auth form in > this example, but no params actually) and without in "old style". > It is just 2 styles of components include. > > On Jan 24, 3:34 pm,br1dil wrote: > > > Hello everyone, > > > I'm posting here because I couldn't find any answers anywhere (I tried > > to search on google but I probably didn't put the accurate words). I > > don't know if it's an important bug or just a debug error. Here is the > > problem with the latest 1.2 release but not with 1.1.x > > > When I turn the debug mode on the stage 3, I have all the Objects > > displayed. All the helpers are displayed like this : > > > [helpers] => Array > > ( > > [0] => Html > > [1] => Form > > ) > > But for the components, if I have more than the Session one, I get > > this : > > > [components] => Array > > ( > > [0] => Session > > [Acl] => > > [Auth] => > > ) > > > I don't know if this could have an impact on the system so I'm > > reporting it. What do you think? Do yoou have the same issue? I don't > > have this bug on another app which runs with cake1.1 > > > Have a good day and let me know your thoughts about it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CakePHP / MIT License - Cake free for bundling with my application?
Hi, I really appreciate that CakePHP is licensed under the MIT license, as it offers a wide range of freedom. But nevertheless, before using it for commercial use, I would like to clear out one big question for me: Is it allowed, regarding to this license, to deliver a copy of CakePHP with my commercial app, so I don't have to write out instructions for obtaining it or something? I am planning to write an application on a "product" base, so I could sell it, but I'm unsure if I had to leave out cake itself in my applications retail package. Thanks in advance, Arne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Shouldn't saveAll remove associated records as well?
Hi There, Thanks for the discussion. I understand the HABTM situation, using a join table. But in my original setup, there is this WordSet and a Words table. No join, repeating words are just repeated. So this is a WordSet hasmany Word WordSet: id, name etc. Word: id, word_set_id, word etc. setup. In the usual blog example, this would be an article with a comment article hasMany comment comment belongsTo article. I created this page for my Wordsets where all words are joined in a big textarea. When the user submits the form, I check which words are gone, which are still there and which are new. So I recreate the $this- >data->['Word'] array. Then I do a $this->WordSet->saveAll($this->data). Why would the Word records with word_set_id = (the one that is saved), that are not in $this->data be kept in the database. I understand this is a special case. It is far more usual to have HABTM-associations added to a 'main' form. One usualy uses subforms, ajax etc for hasMany associations. But not in my case, in which speed of input is important, as well as atomic saves. Back to the blog example, this would be a setup where one could add and remove comments on the page containing the (editable) article as well. It is not uncommon using dhtml or prototype to add or remove a textarea to change the comment collection. On submit, one would check which of the original comments are gone, and change the $data accordingly, then call saveAll on the article. I fixed it now figuring out myself which records should go, and this within a transaction. But because of the relational structure I really think when the user says saveAll (i.e. save my record and all the associations), the result should be relationally correct. b.t.w I think I am using the cake model as it is intended: this is a hasMany case. Sorry for the confusion started by me adding 'tags' to the example. Tags carry the habtm tag.. Jelmer On 27 jan, 16:13, Esoteric wrote: > Negative, once again you are not using cake model as it is intended, > if you really truely want to have this behavior ... you need to have > the following setup ... > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Shouldn't saveAll remove associated records as well?
Negative, once again you are not using cake model as it is intended, if you really truely want to have this behavior ... you need to have the following setup ... tables --- articles tags articles_tags associations article HABTM tag tags HABTM article set the unique variable to true in the association now when you do a saveAll, any current tags associated with the article will be deleted first, then the ones you have selected before the saveAll will be inserted into the articles_tags table, thus effectively deleting any tags you odn't want anymore .. -Erik On Jan 27, 6:22 am, Jelmer wrote: > > Isn't an alarm bell ringing that you're calling a method called > > saveAll and wanting it to delete? > > Well yes and no. When you are saving say an article, you use saveAll > to save the article with all its tags, comments and all. These are not > HABTM, but simple 1:n hasMany relationships. So when a user has > deleted a tag with the article, saving of the changes actually means > deleting the tag (that is, the record that says that tag X belongs to > articly Y). > > This is what the normal forms imply. The tag-to-article table in this > example is fully dependent on the article record. When I save the > article together with all its tags (saveAll), there should be no tags > in the database that are not in this save, but still connected to the > article. > > Maybe a better name for the function should be "replaceAll" or > "saveFull" or something, but it really is what one expects to happen. > Right? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is the advised way to call a function from another controller?
What about making the method static? Otherwise you can just instantiate the object, and use its methods. On Jan 27, 8:59 am, leo wrote: > On Jan 27, 3:26 pm, RichardAtHome wrote: > > > or you could put the function in your AppController > > Surely then you would either have non-generic methods relating to > models that don't exist at that point or models included unnecessarily > in all controllers? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is the advised way to call a function from another controller?
On Jan 27, 3:26 pm, RichardAtHome wrote: > or you could put the function in your AppController Surely then you would either have non-generic methods relating to models that don't exist at that point or models included unnecessarily in all controllers? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Calling $html->css() from inside an element
On Tue, Jan 27, 2009 at 12:51 PM, RichardAtHome wrote: > > Try it from a layout. > > ...but your question is about calling it from inside an element :-S > > ... or do you mean an element that's linked from a layout and not a > view? Right! An element called from a layout that has a call to $html->css() in it (with inline set to false). Like I said, the way I fixed it was by creating a helper which I call from the element to add the custom CSS file and called from the layout inside the section to print it out. - 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Passing an email address as param with a plus(+) sign
No, that still didn't get it. If I urlencode the string and pass it as a param /users/confirm/foo%2Bbar%40example.com then in users_controller.php function confirm($email){ $email = urldecode($email); $this->set('email',$email); } confirm.ctp still outputs foo b...@example.com In fact if I leave out the $email = urldecode($email) altogether confirm.ctp still outputs foo b...@example.com. *On Tue, Jan 27, 2009 at 04:23:15AM + schrec...@gmail.com wrote: > Date: Tue, 27 Jan 2009 04:23:15 + > From: schrec...@gmail.com > Subject: Re: Passing an email address as param with a plus(+) sign > To: cake-php@googlegroups.com > > The plus sign needs to be url encoded. The plus sign translates to a space > when used in the url > Schreck > > -Original Message- > From: Jon Molesa > > Date: Mon, 26 Jan 2009 23:19:01 > To: CakePHP > Subject: Passing an email address as param with a plus(+) sign > > > > I'm trying to pass a valid email address as a parameter in the url. > > foo+...@example.com > > in my model it strips the + sign. > > function confirm($email){ > $this->set('email',$email); > } > > confirm.ctp > > > > outputs > > foo b...@example.com > > I believe this is happening prior to the controller function getting > ahold of the string as I've tried various encoding functions including > Security::cipher() at the beginning of the function upon decoding I > still get the above output. Can anyone suggest how I might be able to > retain the + sign in my controller logic and back out to the view? > > -- > Jon Molesa > rjmol...@gmail.com > if you're bored or curious > http://rjmolesa.com > > > > > -- Jon Molesa rjmol...@consoltec.net if you're bored or curious http://rjmolesa.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Calling $html->css() from inside an element
Try it from a layout. ...but your question is about calling it from inside an element :-S ... or do you mean an element that's linked from a layout and not a view? On Jan 26, 2:19 pm, Gonzalo Servat wrote: > On Mon, Jan 26, 2009 at 12:17 PM, RichardAtHome > wrote: > > > > > Sorry AD7six, just tried it in an element and the code IS injected > > into the header: > > > view.ctp > > element("test") ?> > > > elements\test.ctp > > css("test", array(), null, false) ?> > > > I'm using the latest stable build of Cake > > Try it from a layout. > > - 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with website architecture...
Pete, I never really thought about this. I am going to have to look at this more. My initial example doesn't work as expected. I didn't realize that when you use .htaccess to link outside of your site it actually changes the URL in the address bar. Example: RewriteRule ^onsale http://cake.example.dev/onsale [NC] It then changes the URL to http://cake.example.dev/onsale, instead of just running the script with the example.com/onsale. I guess this makes sense, but I was hoping for a workaround on this since both sites are on the same server (with Virtual Hosting). It's looking like Pete's suggestion is the only option here. Anyone else? I'm sure other people have had to integrate cakePHP into small parts of their website without messing with the existing structure -Jesse On Jan 24, 5:18 am, "p...@otaqui.com" wrote: > Hi Jesse, > > If you look at the .htaccess file in the webroot you'll notice that > the rules check the existence of a file before rerouting to the > index.php file and letting it manage things. > > I think you could try applying the same kind of thing in the root > directory's htaccess ... that is: only use cake if the file doesn't > already exist. > > I'm not sure what extra overhead this would have, so serious load > testing and keeping an eye on server would be a must here. Probably > your first thought - specifically routing to cake with a fixed set of > url's, or at least fixed rules based on controller names - would be > less trouble for your server to handle. > > On Jan 23, 9:01 pm, Jesse wrote: > > > I need some advice on somearchitecturefor a website. > > > I am in charge of running a pretty significantly high traffic sites (3 > > sites that get around 400+ req. per sec at peek hours). The site was > > started a long time and and thearchitecturewas not maintained very > > well throughout the years. There is no framework in place as of now. > > It's all static. > > > We have decided to try out using a cake framework for a couple project > > to see if this will provide the speed we are looking for. > > > The problem develops when trying to "integrate" cake with the current > > website. The website as of now is static.http://www.example.com/story > > - There is a folder "story" in the root of htdocs. There is a lot of > > dynamic database calls with parameters, but the entire site (thousands > > and thousands of pages) is developed this way. > > > I would like to start integrating cake in, but I don't see a way of > > doing this without causing a problem with the current site > >architecture. > > > All of our servers are in house so having a "custom" install of cake > > is not a big deal. Basically I'm looking for a way to have > > http:/www.example.com/onsaleusecake, without touching the root, or other > > directories (http://www.example.com/story) that are not written in > > cake. > > > One idea I had was creating a new user and setting up a subdomain > > (http://cake.example.com). Then using .htaccess to rewrite > > (http://www.example.com/onsale) to (http://cake.example.com/onsale). If this > > was all done through mod_rewrite I could keep the (http:// > > cake.example.com) url's private... but I'm not sure. > > > Any other suggestions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with website architecture...
The reason I was hoping to go with http://cake.example.com is there are several cake projects we are working on and I didn't want to create a new subdomain for each one. Your example would work, but it wouldn't give us the URL structure we are looking for. On Jan 23, 6:39 pm, Brenda wrote: > How abouthttp://onsale.example.comrather thanhttp://cake.example.com/onsale > ? Would seem to make more sense. > > I'm working on a new version of a site in cake, and I've put the new > cake stuff ofhttp://beta.mysite.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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is the advised way to call a function from another controller?
or you could put the function in your AppController On Jan 27, 2:17 pm, leo wrote: > I'm not suggesting this is the correct way to do it, but I would put > those methods in the model definitions to which they relate. Then they > are accessible from any controller that 'uses' that model in addition > to its own. Then you can say something like: > > $organisations= $this->Person->Organisation->formData(); > $genders = $this->Person->Gender->formData(); > ...and so on... > > On Jan 27, 2:07 pm, WebbedIT wrote: > > > Are you sure a component would be correct for this as again the > > CookBook states "To access/use a model in a component is not generally > > recommended" and my __formData() functions are made to access models: > > > function formData() { > > $organisations= $this->Person->Organisation->find('list', array( > > 'order'=>'Organisation.name ASC' > > )); > > $this->set(compact('organisations')); > > > $users = $this->Person->User->find('list', array > > ('fields'=>'User.username')); > > $this->set(compact('users')); > > $ethnicities = $this->Person->Ethnicity->find('list', array( > > 'conditions'=>array('Ethnicity.option_list_id'=>'13'), > > 'fields'=>array('Ethnicity.value'), > > 'order'=>'Ethnicity.value ASC' > > )); > > $this->set(compact('ethnicities')); > > > $sexualities = $this->Person->Sexuality->find('list', array( > > 'conditions'=>array('Sexuality.option_list_id'=>'18'), > > 'fields'=>array('Sexuality.value'), > > 'order'=>'Sexuality.value ASC' > > )); > > $this->set(compact('sexualities')); > > > $religions = $this->Person->Religion->find('list', array( > > 'conditions'=>array('Religion.option_list_id'=>'30'), > > 'fields'=>array('Religion.value'), > > 'order'=>'Religion.value ASC' > > )); > > $this->set(compact('religions')); > > > $genders = $this->Person->Gender->find('list', array( > > 'conditions'=>array('Gender.option_list_id'=>'12'), > > 'fields'=>array('Gender.value'), > > 'order'=>'Gender.value ASC' > > )); > > $this->set(compact('genders')); > > > } > > > Also I would still have to create a lot of logic or duplicate > > functions within the component so that the find calls were made via > > the right associations, i.e. the above function would work fine when > > the referencing controller was PeopleController but when called from > > ClientController the find calls would have to start $this->Client- > > > >Person... and from Staff $this->Staff->Person... etc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Closing $ajax->form()
I can't get $ajax->submit() to work, only $form->end('Submit'). What's the difference between the two? On Jan 26, 7:59 am, Graham Weldon wrote: > $ajax->submit() creates an ajax submit element. > $form->end('something') creates a submit button, and ends the form. > > $ajax->form() starts a form. > Your usage will depends very much on your implementation, and requirements. > > The simple reason for there not being an $ajax->formEnd() is because its > super easy to do: $form->end(). > Both output . > > here are some options to illustrate usage: > > $form->create(); > $form->inputs(); > $form->end('submit'); > > $ajax->form(); > $form->inputs(); > $form->end('submit'); > > $ajax->form(); > $form->inputs(); > $ajax->submit(); > $form->end(); > > On Mon, 26 Jan 2009 05:55:02 -0800 (PST), Pyrite > wrote: > > > > > So what is the point/usage of $ajax->submit() then if it does not > > actually submit the form created with $ajax->form() ? > > > On Jan 23, 8:05 am, Mono wrote: > >> When u use the ajax->form, the only difference with a normal form is > >> the first line. > > >> Normal Form: > > >> $form->create (...) > >> $form->input () > >> $form->input () > >> $form->end ('Send') > > >> Ajax Form: > > >> $ajax->form (...) > >> $form->input () > >> $form->input () > >> $form->end ('Send') > > >> On 22 Jan., 22:47, Pyrite wrote: > > >> > How do you put the close tag in a form created by $ajax->form() ?? Why > >> > is there not an $ajax->formEnd() similar to the FormHelper's > $form->end > >> > () ? > > >> > Also, when I create a form with $ajax->form(), and I add a submit with > >> > $ajax->submit(), it does not submit the form. A usage example would be > >> > great. I can only get it to submit the form if I use $form->end > >> > ('Submit') instead of $ajax->submit().- Hide quoted text - > > >> - Show quoted text -- 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Call Ajax from Javascript Function
Instead of observing a select field to make an ajax request to a controller action onchange, I want the onchange to call a custom javascript function that will do some logic and then make the ajax request to the controller and update a div afterwards. So .. how would I do that? Or, I guess i could just use $ajax->observeField if I can grab the contents of the select i am observing and pass it to the 'url'=> of the observeField param? Eg. $ajax->observeField('someSelect', array('url'=>'myControllerAction/ someSelectContentsHere')); I need to grab the selected value of the select and pass it to the URL param of observeField, any way to do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is the advised way to call a function from another controller?
I'm not suggesting this is the correct way to do it, but I would put those methods in the model definitions to which they relate. Then they are accessible from any controller that 'uses' that model in addition to its own. Then you can say something like: $organisations= $this->Person->Organisation->formData(); $genders = $this->Person->Gender->formData(); ...and so on... On Jan 27, 2:07 pm, WebbedIT wrote: > Are you sure a component would be correct for this as again the > CookBook states "To access/use a model in a component is not generally > recommended" and my __formData() functions are made to access models: > > function formData() { > $organisations= $this->Person->Organisation->find('list', array( > 'order'=>'Organisation.name ASC' > )); > $this->set(compact('organisations')); > > $users = $this->Person->User->find('list', array > ('fields'=>'User.username')); > $this->set(compact('users')); > $ethnicities = $this->Person->Ethnicity->find('list', array( > 'conditions'=>array('Ethnicity.option_list_id'=>'13'), > 'fields'=>array('Ethnicity.value'), > 'order'=>'Ethnicity.value ASC' > )); > $this->set(compact('ethnicities')); > > $sexualities = $this->Person->Sexuality->find('list', array( > 'conditions'=>array('Sexuality.option_list_id'=>'18'), > 'fields'=>array('Sexuality.value'), > 'order'=>'Sexuality.value ASC' > )); > $this->set(compact('sexualities')); > > $religions = $this->Person->Religion->find('list', array( > 'conditions'=>array('Religion.option_list_id'=>'30'), > 'fields'=>array('Religion.value'), > 'order'=>'Religion.value ASC' > )); > $this->set(compact('religions')); > > $genders = $this->Person->Gender->find('list', array( > 'conditions'=>array('Gender.option_list_id'=>'12'), > 'fields'=>array('Gender.value'), > 'order'=>'Gender.value ASC' > )); > $this->set(compact('genders')); > > } > > Also I would still have to create a lot of logic or duplicate > functions within the component so that the find calls were made via > the right associations, i.e. the above function would work fine when > the referencing controller was PeopleController but when called from > ClientController the find calls would have to start $this->Client- > > >Person... and from Staff $this->Staff->Person... etc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: articles search - by name and by tags
There were substantial changes between the pre-beta and the stable version. With the massive app I wrote, I did not have time to create test cases. I then upgraded to a beta version, an the entire app broke. Most importantly were the find conditions that used like or !=. That is a good reason to use pre-beta software: when api changes are so substantial that it will break your app. Schreck -Original Message- From: Paamayim Date: Tue, 27 Jan 2009 05:17:40 To: CakePHP Subject: Re: articles search - by name and by tags > time to upgrade then surely? why use pre-beta software when there's a > stable release out now! I know! But The software wasn't written by me in first place and it was passed to me to do some modifications :( If I'd to start a project from scratch I'd use the latest release of Cake for sure. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help w/ DebugKit - no toolbar
That's strange, debug kit should add its own CSS into the of the document. And it should be capturing the sql log as well. Not sure why this is happening. I haven't been able to get that to occur for me, so I don't really know what is wrong. -Mark On Jan 26, 9:04 pm, Ben wrote: > I've found if I explicitly include the debug_toolbar CSS to views/ > layouts/default.ctp, and make a symlink from webroot/css/ > debug_toolbar.css to > ../../plugins/debug_kit/vendors/css/debug_toolbar.css, the toolbar is > rendered as a toolbar at the top of the page. i.e. > > > > My App > css('cake.generic');?> > css('debug_toolbar');?> > > ... > > Are those two steps as expected? > > Now on to getting FireCake working :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: articles search - by name and by tags
> I know! But The software wasn't written by me in first place and it > was passed to me to do some modifications :( > > If I'd to start a project from scratch I'd use the latest release of > Cake for sure. it shouldn't take much to upgrade from 1.2 beta to 1.2 stable, it doesn't take much from 1.1 to 1.2 fork the project and try it, you might be surprised - gotta be easier than not being able to use Containable etc - plus all the docs will make sense! j -- 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: articles search - by name and by tags
> time to upgrade then surely? why use pre-beta software when there's a > stable release out now! I know! But The software wasn't written by me in first place and it was passed to me to do some modifications :( If I'd to start a project from scratch I'd use the latest release of Cake for sure. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is the advised way to call a function from another controller?
Looks like you need to re factor a bit more Thumb rules - #1 sharing controller code - components #2 sharing model code - behaviour #3 sharing view code - elements HTH Tarique On Tue, Jan 27, 2009 at 6:37 PM, WebbedIT wrote: > > Are you sure a component would be correct for this as again the > CookBook states "To access/use a model in a component is not generally > recommended" and my __formData() functions are made to access models: > -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is the advised way to call a function from another controller?
Are you sure a component would be correct for this as again the CookBook states "To access/use a model in a component is not generally recommended" and my __formData() functions are made to access models: function formData() { $organisations= $this->Person->Organisation->find('list', array( 'order'=>'Organisation.name ASC' )); $this->set(compact('organisations')); $users = $this->Person->User->find('list', array ('fields'=>'User.username')); $this->set(compact('users')); $ethnicities = $this->Person->Ethnicity->find('list', array( 'conditions'=>array('Ethnicity.option_list_id'=>'13'), 'fields'=>array('Ethnicity.value'), 'order'=>'Ethnicity.value ASC' )); $this->set(compact('ethnicities')); $sexualities = $this->Person->Sexuality->find('list', array( 'conditions'=>array('Sexuality.option_list_id'=>'18'), 'fields'=>array('Sexuality.value'), 'order'=>'Sexuality.value ASC' )); $this->set(compact('sexualities')); $religions = $this->Person->Religion->find('list', array( 'conditions'=>array('Religion.option_list_id'=>'30'), 'fields'=>array('Religion.value'), 'order'=>'Religion.value ASC' )); $this->set(compact('religions')); $genders = $this->Person->Gender->find('list', array( 'conditions'=>array('Gender.option_list_id'=>'12'), 'fields'=>array('Gender.value'), 'order'=>'Gender.value ASC' )); $this->set(compact('genders')); } Also I would still have to create a lot of logic or duplicate functions within the component so that the find calls were made via the right associations, i.e. the above function would work fine when the referencing controller was PeopleController but when called from ClientController the find calls would have to start $this->Client- >Person... and from Staff $this->Staff->Person... etc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are we using the slowest PHP framework there is?
Those benchmarks are flawed and unreliable because I think that the author do not know know to set up benchmarks correctly. He even doesn't care about framework life cycle. Moreover, IMO, Yii is hard to extend. http://www.thedeveloperday.com/framework-battles-yii-vs-zend-framework/ On Sun, Jan 25, 2009 at 12:44 PM, chanon wrote: > > I know there has been another thread about this, but I want to say > that newcomers looking at http://www.yiiframework.com/performance > might be afraid of investing into using CakePHP 1.2. > > From those numbers, Yii with APC on is about 10x faster than CakePHP > (!?) > > Even compared to CakePHP 1.1, CakePHP 1.2 with APC on is 5 times > slower. > > I feel that maybe before the CakePHP developers rush to add even more > features into 1.3, they might want to take a step back and look into > improving the performance in 1.2. > > As someone said even though faster to develop with is good, but in the > current economy people might be interested in saving on server costs > too. > > The benchmark on that site doesn't include any database access, which > is something I'd like to see. Maybe CakePHP would make it up when > working with a large database? > > > -- -- http://groups.google.com/group/phpvietnam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Group By in Pagination
Hello All, I want to create a pagination in which the data is grouped using group by clause. I think cake php pagination do not support group by directly and instead we need to do it using custom pagination method. I saw the documentation for it in the book, but the issue is that I only want the group by in one action and lot of other actions depend on the same model. So my doubt is if I override paginate() and paginateCount() wont that affect all the other pagination which depends on the same action. If yes is there any other methods to use group by clause with pagination? 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Forms to create Users from another controller
I would do this using the saveAll() function as it saves a good few lines of code, but I believe your issue is that you're not calling $this->User->Employer->create(); before saving your Employer record. However it also seems as though you're doing this back to front?!? If you have created two models, Employer and Contractor, which belong to User then surely you should be using the Employer and Contractor controllers (/employers/register and contractors/register) to manage those objects and save a User at the same time otherwise you would have to add extra logic into the User/register action and view to know which model to associate the new user with? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is the advised way to call a function from another controller?
Consider re-factoring your fromData() into a component Tarique On Tue, Jan 27, 2009 at 5:55 PM, WebbedIT wrote: > > In most of my controllers I have a __formData() function which creates > any arrays for select lists, radio buttons, check-boxes etc. I can > then call this from the add() and edit() actions and save some lines > of code etc. -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
What is the advised way to call a function from another controller?
In most of my controllers I have a __formData() function which creates any arrays for select lists, radio buttons, check-boxes etc. I can then call this from the add() and edit() actions and save some lines of code etc. However I would also like to call this function from another controller when I am displaying a form which manages data across multiple models. I believe I could use requestAction(), but the CookBook states "It is rarely appropriate to use in a controller or model" so how do I go about this in the most efficient manner? Thanks, Paul. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AuthComponent not functioning correctly
I'm using AuthComponent in my app to validate user logins. I'm not using a user model as there are 2 sections to my site (which is a football site): players and teams. By default the login form is supposed to use the player model to login, so the usermodel is set to player in the app controller. The login works fine and the user is authenticated if you're inside the players controller when logging in; if you're outside the players controller (for example on the home page) it will simply refresh the page with no debug output. Any ideas why? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Shouldn't saveAll remove associated records as well?
> Isn't an alarm bell ringing that you're calling a method called > saveAll and wanting it to delete? Well yes and no. When you are saving say an article, you use saveAll to save the article with all its tags, comments and all. These are not HABTM, but simple 1:n hasMany relationships. So when a user has deleted a tag with the article, saving of the changes actually means deleting the tag (that is, the record that says that tag X belongs to articly Y). This is what the normal forms imply. The tag-to-article table in this example is fully dependent on the article record. When I save the article together with all its tags (saveAll), there should be no tags in the database that are not in this save, but still connected to the article. Maybe a better name for the function should be "replaceAll" or "saveFull" or something, but it really is what one expects to happen. Right? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Method for access combined field in view file
Hi Chris, may be, this is one possible solution... my projects-table kooks like this: CREATE TABLE IF NOT EXISTS `projects` ( `id` int(10) unsigned NOT NULL auto_increment, `year` int(10) unsigned NOT NULL default '0', `code` int(10) unsigned NOT NULL default '0', `fullcode` varchar(8) default NULL, `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`), KEY `fullcode` (`fullcode`) ) I bake m, v and c and then put this beforeSave-function into the project-model: function beforeSave() { foreach ($this->_schema as $name=>$field) { if ($name=='year') { //set year, if empty if (empty($this->data[$this->name]['year'])) { $this->data[$this->name]['year'] = (int)date('Y'); } } if ($name=='code') { //set new "code of the year", if empty if (empty($this->data[$this->name]['code'])) { $tmp = $this->find('first', array( 'conditions'=>array('year'=>$this->data[$this- >name]['year']), 'order'=>'code DESC' ) ); if (isset($tmp['Project']['code'])) { $new_code = $tmp['Project']['code'] +1; } else { $new_code = 1; } $this->data[$this->name]['code'] = $new_code; } } if ($name=='fullcode') { //generate fullcode $this->data[$this->name]['fullcode'] = sprintf("%s-%03u", substr((string)$this->data[$this->name]['year'], -2), $this->data [$this->name]['code']); } } return true; } (tested on 1.2.1.8004) If the year-field is empty, it uses the current year. If the code- field is empty, it gets the next free "number of the year". Then it generates your fullcode. Now the search is simple. I would add some validations, but I think, it's a good base. Hope that helps RoVo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: articles search - by name and by tags
Hi Paamayim, > > you need to use Containablehttp://book.cakephp.org/view/474/Containable > > Unfortunately I'm working on a software who's based on an old versione > of Cake (1.2.0.5875 pre-beta), and I couldn't find any "Containable" > in it, so I suppose is a later addiction. time to upgrade then surely? why use pre-beta software when there's a stable release out now! hth j -- 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: articles search - by name and by tags
> you need to use Containablehttp://book.cakephp.org/view/474/Containable Unfortunately I'm working on a software who's based on an old versione of Cake (1.2.0.5875 pre-beta), and I couldn't find any "Containable" in it, so I suppose is a later addiction. I had to find a workaround/hack to add Tag search and here it is: $this->paginate('Article', array( 'Article.name LIKE \'%foo%\' or Article.id IN ( select articles_tags.article_id from tags left join articles_tags on articles_tags.tag_id = tags.id where tags.name LIKE \'%foo%\' ) )); Strict to the framework rules? Not so much Does it work? Like a charm but requires MySQL 5+ to support subqueries like ... IN (subquery) ... Cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: twitter users?
I've found Hastags.org to be quite unreliable (going offline regularly, missing tagged posts, that kind of thing). Another option is just to search twitter itself: http://search.twitter.com/search?q=%23cakephp On Jan 27, 8:23 am, RichardAtHome wrote: > There's also a #cakephp hashtag: > > http://hashtags.org/search?query=cakephp&submit=Search > > On Jan 26, 5:42 pm, gerhardsletten wrote: > > >http://www.twitter.com/gerhardsletten > > > A salty mix of cake, ez publish, triathlon, food and live. Code stuff > > mostly in english, but some norwegian now and than > > > On Jan 25, 5:33 pm, Marcelo Andrade wrote: > > > >http://twitter.com/mfandrade > > > > Mainly in portuguese. > > > > -- > > > MARCELO DE F. ANDRADE (aka "eleKtron") > > > Belem, PA, Amazonia, Brazil > > > Linux User #221105 > > > > [...@pará ~]# linkshttp://pa.slackwarebrasil.org/ > > > > For Libby's backstory be told on > > > Losthttp://www.petitiononline.com/libby423/petition.html > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: twitter users?
There's also a #cakephp hashtag: http://hashtags.org/search?query=cakephp&submit=Search On Jan 26, 5:42 pm, gerhardsletten wrote: > http://www.twitter.com/gerhardsletten > > A salty mix of cake, ez publish, triathlon, food and live. Code stuff > mostly in english, but some norwegian now and than > > On Jan 25, 5:33 pm, Marcelo Andrade wrote: > > >http://twitter.com/mfandrade > > > Mainly in portuguese. > > > -- > > MARCELO DE F. ANDRADE (aka "eleKtron") > > Belem, PA, Amazonia, Brazil > > Linux User #221105 > > > [...@pará ~]# linkshttp://pa.slackwarebrasil.org/ > > > For Libby's backstory be told on > > Losthttp://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP In A Subdirectory?
Did you reboot the web server yet. This sounds exactly like the issue I was having. Also, check your web server error log files just in case. On Jan 27, 7:56 am, leo wrote: > > I tried doing phpinfo() from the index.php file and nothing was > > displayed > > Doesn't this ring any alarm bells? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---