Re: Dynamic form creation?
On Jan 19, 2008 1:01 PM, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: >I'm not sure, if you have understand my question. RoR based > frameworks allow easy creation/use of form when DB table is created. > But, I'm looking for a solution to create forms dynamically--something > as in LimeSurvey. I *think* I may have run into what you're talking about here. I'm building a section of a web site for voting on things (the simulation baseball league I am in has a vote during the off-season for changing league rules and rules for the game we use), and there can be any number of items on the ballot. So, while googling around looking for some help on this I found that you can use the following notation to create multiple instances of the same field: $form->input("{$x}.Model.field") In my case, I loop through each item in the ballot and present a radio button to allow me to vote on it. 1, 'No' => 0, 'Abstain' => 2); foreach ($ballotItems as $ballotItem) { echo $form->radio("{$x}.Vote.answer", $answerOptions) $x++; } ?> Then, when you submit the form to be processed, you should see something like this in $this->data $this->data[1]['Vote']['answer'] = ... $this->data[2]['Vote']['answer'] = ... Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component encrypting password before validation.
On Jan 18, 2008 10:56 PM, aranworld <[EMAIL PROTECTED]> wrote: > > But is nate also suggesting that CakePHP developers think it is E-vil > for us to want to have access to the plaintext version of the password > during a Model save? Or are we all in agreement that you need to send > a plaintext version of the desired password to the model, so that we > can actually validate it prior to saving ... to prevent the empty > password problem franky061 mentions above? > I do exactly that: pass a plaintext version of the password to the model in another field that is NOT part of the model itself, then hash it using the same method that the Auth component uses in order to verify that they have entered the same password in the confirm field. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Paginate an array thats not from a model
On Jan 18, 2008 1:54 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Why are you using MVC if you aren't making models? It's not about not using models, it's about using non-database powered models. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component encrypting password before validation.
On Jan 18, 2008 3:43 PM, rtconner <[EMAIL PROTECTED]> wrote: > > Ya I had this out with nate already. I've given up. I think my > solution was to set the hash type to none. > https://trac.cakephp.org/ticket/3364 Aha! So you did follow through. My most humble appologies. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component encrypting password before validation.
On Jan 18, 2008 3:32 PM, rtconner <[EMAIL PROTECTED]> wrote: > > This particular issue is the framework trying to baby it's users. > Telling us that we can't implement our own security practices. It's > not even that you can turn it off if you don't want it, you just can't > turn it off. You literally have to "deal with it" with a little > workaround of some sort. Not that it's super hard to work around, but > it is a work around. It's just annoying, and silly.. like I said. Okay, here's a "put up or shut up" challenge for you. Add a 'autohash' variable to the Auth component, and when it's set to false tell the Auth component to not automatically hash the password. i.e. $this->Auth->autohash = false; In fact, file a ticket on trac suggesting this. If you do that, then I promise to not mercilessly mock you in other threads. ;) But if you won't do it, then it's the equivalent of complaining about the government when you don't vote in any elections. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component encrypting password before validation.
On Jan 18, 2008 2:31 PM, rtconner <[EMAIL PROTECTED]> wrote: > > I'll just say, I love any and all complaints about that auto hashing > thing. I think it's silly and annoying and shouldnt be part of cake. > I think it's silly that people can't figure out how to deal with it. The point of hashing the password is to provide security. If you can reproduce a password given the hash, well, that sounds like a big security hole. Perhaps I'm misunderstanding the problem. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Saving model without saving associated models
On Jan 17, 2008 6:36 PM, Tim W <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm doing a save of a model, it has an association and the key is > being used in a join during the update, so that field isn't being > saved. I need to disable the join for the save so I can update the > field. Can anyone tell me how to do this? Have you tried removing the associated data from $this->data? That seems to me to be the easiest way to solve the problem, unless I am misunderstanding it. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: No Debugging chapter!
On Jan 17, 2008 6:37 PM, Raistlin Majere <[EMAIL PROTECTED]> wrote: > > I wrote the first question wrong. I can not edit it. I will try > telling what I want again, but differently and completely. > > If I write a code to save a form data with CakePHP like "save($this- > >data)", I will base on the codes written to create CakePHP like the > ones in "app\config\acl.ini.php". > > I know the code I wrote, but I do not know the codes written to create > CakePHP. > > If I commit a mistake, will the error message be talking about the > code I wrote only and be understanble or the code written to create > CakePHP only and not be understandable? > You will see two types of errors: 1) Warnings generated by CakePHP that actually tell you what to do. These can be fixed by following the instructions in the error message 2) Errors and/or warnings generated by PHP itself. These can be fixed by having a good understanding of PHP itself. Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Scriptaucolous effect.fade wont work
On Jan 17, 2008 4:47 PM, Novice Programmer <[EMAIL PROTECTED]> wrote: > Thanks for the inputs guys... Coupling both of these resolves the issues. > I am having another AJAX problem.. with the below said string when i click > some other tab, the images on the foucsed tab fade but the images for the > new tab start appearing one by one. I want that they dont appear one by one > rather i want to load them at once using some Scriptaucolous effect(An > effect similar to the dynamic update on youtube home page). Any ideas on how > this can be done? > > Thanks. > Don't you think you're venturing from "please help me with Cake" to "please help me with Ajax effects"? I'm sure a quick trip to either the Scriptaculous web site or, if I may be so bold to suggest, Google will surely tell you how to get that stuff done. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Bug in cake beta 1.2 model
On Jan 16, 2008 10:56 AM, Nina <[EMAIL PROTECTED]> wrote: > > Hi All > > I found (and fixed) a bug in the model.php file, and I can't report it > in the trac system, so I thought I'd report it here in case someone > sees it and can fix it. Nina, Is that "can't" or "won't" report the bug? It takes no more than 5 minutes to sign up for an account on trac in order to report a bug. I tell you this because I can say with great certainty that patches posted on the mailing list are extremely unlikely to be noticed. It's great that you might have found a bug, but PLEASE take the time to report it properly through trac. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: No Debugging chapter!
On Jan 17, 2008 2:05 PM, Raistlin Majere <[EMAIL PROTECTED]> wrote: > > If I write some lines of code with a bug, will the error message about > the bug ever contain the many lines of code used to create CakePHP? > Why is there no Debugging chapter with error messages and their > meanings??? That would be because the error messages are usually ones generated by PHP itself, not CakePHP. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component encrypting password before validation.
On Jan 17, 2008 10:31 AM, dizz <[EMAIL PROTECTED]> wrote: > > Hello, > > I am using the auth component and before my model can validate the > password the auth component already encrypts the password so making it > impossible to use the between built in valid method. > > Is there any work around for this? Well, you can always create another field called 'password_confirm' or something, and then validate against that. Then you can compare the encrypted password to the encrypted version of the password_confirm field to make sure that they are equal. I've even posted an example of how to do it on my blog (link is below) before. Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with Postgresql 8.2 on Windows XP
On Jan 17, 2008 2:13 AM, williamn <[EMAIL PROTECTED]> wrote: > > Yes I did the extension=php_pgsql.dll in my php.ini. My other web app > (not using cakephp) can connect to postgresql with no problem. > > I use cakephp 1.1.19.6305 > > Thank you. > --William The problem isn't Cake, the problem is that you need to make sure that the CLI version of PHP you have installed also has support for Postgres. Check to see if you have two different php.ini files, one for web and one for CLI. Some PHP installs do that. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, Webserivce and Ajax
On Jan 17, 2008 6:37 AM, lordG <[EMAIL PROTECTED]> wrote: > > Hi Guys, > > Does anyone know why the webservices or ajax calls have not been > maintained across sessions? Will they be, or am I missing something? I believe this is related to previous discussions about the user agent being different for the Ajax calls. Try changing the following in in your config/core.php Configure::write('Session.checkAgent', true); to Configure::write('Session.checkAgent', false); and see if that helps your webservice and Ajax calls. Hope that helps, and I'm sure others will correct me if I'm wrong. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth in 1.2
On Jan 15, 2008 7:05 AM, martinp <[EMAIL PROTECTED]> wrote: > > I've tried commenting out my userScope variable and removing > if(isset($this->Auth)), but still no joy. As all I get is the login > page with no error messages perhaps it is your first suggestion of a > config setting? Martin, Like I mentioned before I would try removing 'Acl' from the list of components and make sure it worked just fine with only the 'Auth' component. Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: v1.2 $beforeFilter property warning
On Jan 14, 2008 10:42 PM, Jeremi <[EMAIL PROTECTED]> wrote: > > I am receiving the warning: > > Warning (512): Dispatcher::start - Controller::$beforeFilter property > usage is deprecated and will no longer be supported. Use > Controller::beforeFilter(). [CORE/cake/dispatcher.php, line 298] > > But I cannot figure out the proper way to use the method, can someone > please help? > Well... beforeFilter is actually a method for a controller class FooController extends AppController { function beforeFilter() { // do all you beforeFiltery stuff here } } In what context were you using $beforeFilter, as that is something that I have not seen before. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth in 1.2
On Jan 14, 2008 9:18 PM, martinp <[EMAIL PROTECTED]> wrote: > > Hello > > I appreciate there's a lot of discussion and a few tutorials on Auth > in 1.2, but for some reason I can't get it to work at all - even at a > basic level. I'm probably doing something noobtastically wrong, so I > apologise in advance for my stupidity if so, but I wonder if someone > wouldn't mind giving me some pointers on this. Hey Martin, I've put some of my comments inline here, hopefully they can help. > I've set up my login page, my users controller and app_controller, but > when I attempt to login, nothing happens. Nothing. No error message, > no redirection, no cakephp error, just nothing. Do you keep getting redirected to the login form? This kept happening to me...until I updated my app/core/config.php file to the newest version. I was running quite a few revisions behind and once I updated stuff, it went just fine. > Here's my login.ctp: > echo $form->create('User', array('controller' => 'users', 'action' => > 'login'))."\n"; > echo $form->input('email')."\n"; > echo $form->input('password')."\n"; > echo $form->checkbox('remember_me')."\n"; > echo $form->label('remember_me', 'Stay logged in?')."\n"; > echo $form->end('Login')."\n"; Login form looks okay to me. > My app_controller.php: > var $helpers = array('Html','Javascript','Form'); > var $components = array('Acl','Auth','Cookie','Security'); > var $publicControllers = array('pages'); > > function beforeFilter() { > if (isset($this->Auth)) { > $this->Auth->fields = array('username' => 'email', > 'password' => > 'password'); > $this->Auth->loginAction = array('controller' => > 'users', 'action' > => 'login'); > $this->Auth->loginRedirect = array('controller' => > 'users', > 'action' => 'index'); > $this->Auth->logoutRedirect = '/'; > $this->Auth->userModel = 'User'; > $this->Auth->userScope = array('User.status' => > 'Activated'); > $this->Auth->loginError = 'Invalid email / password > combination. > Please try again'; I've never used isset($this->Auth) before, and that might be causing part of the problem. Is there an example out there that uses this, as I've never seen that. Not saying that it's wrong, just that I haven't seen it before. Otherwise, things look okay to me here. One thing that sticks out is to make sure that the status field for your model is, in fact, set to 'Activated'. Silly, I know, but worth looking at. > if (in_array(low($this->params['controller']), $this- > >publicControllers)) { > $this->Auth->allow(); > } Hrm, that's a neat little construct. Haven't seen that before either. Again, I'd love to see the link to that example. > } > } > > I know I've got to implement ACL, but surely I should be getting error > messages for incorrect passwords even now? Grateful for anyone's > input! I'd suggest that you remove ACL from the equation for now and make sure that you can get Auth working first. Remember the motto: make it work, then make it work better. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: trouble with routes
On Jan 14, 2008 4:22 PM, b logica <[EMAIL PROTECTED]> wrote: > > Here's one: > > http://bakery.cakephp.org/articles/view/taking-advantage-of-the-pages-controller > > -- snip -- > Route placement > Just for reference, you should place the /* route LAST in your routes file > or it will override all of the other routes. posted Sun, Oct 22nd 2006, > 18:44 by Luke Sheridan > -- snip -- Hrm, I hadn't seen that before. Thanks for pointing it out. I know that some other frameworks do that sort of thing, where URL's filter down through a chain of custom routes. > Should I be using a "/*" route? Do I need to specify "/about/*" goes to > pages? If so, is there some way that I can keep those views nested like > this: > > views > pages > about > something > something deeper > > With the structure like this, if I try a route like "/about/*" I run into > problems because Cake no longer sees the view inside the about dir. I have a > lot of static pages and I'd really like to be able to keep them organised, > rather than dumping everything in the /app/views/pages/ dir. Hrm...sounds like you will need a lot of custom routes to make it happen, but that's because I've never done what you're trying to do (with respect to having a huge collection of static pages). -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: trouble with routes
On Jan 14, 2008 3:53 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I was under the impression that putting a route last would act as a > default and that the particular one I mentioned *must* be last or it > will override all others. It appears to me that the opposite is in > fact happening. Where am I going wrong here? Where did you get that impression, as I do not remember seeing any documentation to that effect. Perhaps that's something that other frameworks do, but not Cake. Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sessions, redirects and setFlash
On Jan 13, 2008 6:24 PM, lordG <[EMAIL PROTECTED]> wrote: > > Hi guys, > > I'm experiencing a problem with the redirects when I destroy the > session, set a flash message and then redirect. > > When it gets to the redirect page, the flash no longer exists and the > session is clean of any custom session data they may have been set > after the destroy call. > > Does the redirect do anything with regards to the Sessions if they > have been just been destroy'd and renew'd? > > I noticed the session_write_close call, but that just locks the > session and shouldn't affect the session data. > > Very weird. > G First thing to check when sessions go haywire is your security level in config/copre.php. Make sure it's set to low, as on high it regenerates the session on every refresh (or so I remember being told). Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need ideas on using cake in a tabbed design.
On Jan 13, 2008 1:06 PM, Novice Programmer <[EMAIL PROTECTED]> wrote: > Hello Kevin, > > Thanks for the help. but i probably did not explain the problem properly. > The problem is that view changes on clicking the tab. So I want to replace > the existing view with the new one when the tab is clicked. i hope this > clears the issue. That's some Ajax work, sort of out of the scope of Cake. Since the built-in helper uses Scriptaculous / Prototype I suggest you read up on them. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: saveAll function not saving
On Jan 12, 2008 3:07 PM, lordG <[EMAIL PROTECTED]> wrote: > > My suggestion would be at least to assign a variable to the model like > $assignDefaults = true/false, which can control if the save grabs the > defaults or not. > Edge case. Move on. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how display result in view with $this->$Modelname->Query("")
On Jan 10, 2008 11:13 PM, Dr. Tarique Sani <[EMAIL PROTECTED]> wrote: > > On Jan 11, 2008 8:26 AM, Made Aditiya Jaya <[EMAIL PROTECTED]> wrote: > > hi all i need help.. > > how display result in view with $this->$Modelname->Query("select > > count(Customer.id) from customers as Customer"); ??? > > i can't display the field that i count.. > > Try giving an alias for the counted field and then do a print_r in > your view to figure out what is the structure of the array Or, you could always do this to figure out what field it's coming back as, assuming you haven't done this already. $result = $this->$Modelname->Query("select count(Customer.id) from customers as Customer"); print_r($result); I'm pretty sure you can do this same query using a find(), but the syntax escapes me this early in the morning. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Populating the index page on fly
On Jan 10, 2008 5:04 PM, Novice Programmer <[EMAIL PROTECTED]> wrote: > Hello Chris, > > I think i should clear the problem further... I am having a home page which > has five tabs. Every tab will shoot a different query to database to load > the images. Now my client wants that the tab which comes when the page loads > should be random. So lets say that the tabs are featured, popular and > recent.. I dont know which one would load when the page is loading. So i > can't define a hard coded controller in the routes to route my request to. > > I hope it clears my problem. > > Thanks. Geez, good luck with that. :) You are thinking about this wrong though. You can do this with a one controller, and code inside that controller determines what tabs get pulled up, then you pass that info to the view and treat all those tabs as elements. I think. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Populating the index page on fly
On Jan 10, 2008 4:42 PM, Novice Programmer <[EMAIL PROTECTED]> wrote: > I think i was not clear enough.. Actually waht i am thinking is installing a > view in the layout which would be populated by the controller. I was not > very sure which controller is the entry point of the cake application. by > app controller i think you mean app_controller.php. > Pardon my ignorance but why can't you just create a controller and a view for the main page of your app? In order to populate a page with all sorts of random images, well, you're gonna need a controller no matter what. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to set up PEAR and MDB2 for Cake Migrations?
On Jan 10, 2008 2:05 PM, Cristiano <[EMAIL PROTECTED]> wrote: > > I would like to setup Cake Migrations 3.4 for my app, but it requires > PEAR.php and MDB2.php. Problem is: I have NO idea how to do this and > it doesn't seem to be documented anywhere. > Go to http://pear.php.net for info on how to install PEAR packages (which is what those two things are). Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: PHP has encountered a Stack overflow
On Jan 10, 2008 10:37 AM, lordG <[EMAIL PROTECTED]> wrote: > > Hi Guys, > > I just updated my core site to the latest 1.2.0.6311 release and I > keep getting this error on every second or third request: > > "PHP has encountered a Stack overflow" > Imagine my shock when Google pointed out what the problem is. Try increasing the amount of memory that PHP is using in your php.ini. Look for 'memory_limit' in there. Sounds like you need to increase it. Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Rendering a different main page
On Jan 9, 2008 3:24 PM, Greg Baker <[EMAIL PROTECTED]> wrote: > > How can I get the root of my site to display a different page, without > using a redirect? > > For example.. www.example.com/registration should in fact actually > render www.example.com/registrant/add but the URL should not change. Have you tried using custom routes? -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Do I develop user authentication or the site itself first?
On Jan 9, 2008 3:28 PM, 703designs <[EMAIL PROTECTED]> wrote: > > I'm building my first site in CakePHP. It will involve a few different > sections that users will need to log in to post on, and I'm uncertain > about in which order I should be developing the site. This is the > first large-scale web app I've ever built; all prior PHP experience > has been for brief tasks on clients' sites. > > Should I make the user authentication (users, login, etc.) first, and > then add the site's features? Or build out the site skeleton first, > allowing anonymous users to do as they wish (with only me and a couple > others testing), and then patch on user authentication? Well, given how easy the CakePHP 1.2 Auth component is to use, you don't have to worry about building your own authentication system. I'd say do the work first and then bolt on authentication afterwords. I know it's self-promotion, but I have several links at my blog (address below) that cover using the Auth component. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need some help with advanced pagination
On Jan 8, 2008 2:06 PM, francky06l <[EMAIL PROTECTED]> wrote: > > I suppose your model is Game, and your action is"score": > > function score() > { > $pageparam = array('controller' => 'Games', >'action' => $this->action); > > $this->paginate['Game'] = array('fields' => array('DISTINCT > week'), > 'limit' => 10, > 'order' => > array('Game.week' => 'ASC'), > 'url'=> array('url' => > $pageparam)); > > $cond = null > > /* optionnaly you can set the cond ie : $cond = > array('league_id' => $id) */ > $this->set('games', $this->paginate('Game', $cond)) > } > > There is not warranty that will work, and it might contain some > typo :-) Thanks so much for the help. I'll try it out and lay blame where appropriate. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Environment settings
On Jan 8, 2008 1:39 PM, Alfredo <[EMAIL PROTECTED]> wrote: > Hi, I need to handle multiple environments (dev, qa, production...) > and for each I need a set of values, diffrent api keys, base urls > resource locations etc. Is there a way to define an array for each > environment and have an global environment_config array that can be > accessed from controllers/models/views? Is there a default technique > for this? > While this is not a Cake-specific thing, I have done similar stuff by defining an Apache environment variable for each environment, then in my "load values depending on environment" section I would check the value of that variable. In Cake-1.2-specific terms, I imagine you'd need some code that would look at that environment variable and then load things into the Configure object: http://tempdocs.cakephp.org/#TOC33079 Where that code should go, I don't know. Perhaps in the beforeFilter() for AppController? Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need some help with advanced pagination
On Jan 8, 2008 1:41 PM, francky06l <[EMAIL PROTECTED]> wrote: > > Well, without much thinking I would say that your "series" are given > by a SELECT DISTINCT WEEK ORDER by WEEK ASC in your db, then > pagination is quite straight forward (I will try to write some code > sample, if you wish). > If you use a row per serie, then adding an ajax call triggered by > "click" on the , could populate a lower div with the game of this > week.. A small code sample would be great. All the Ajax stuff I can handle myself I think. My problem was figuring out how to get the pagination helper to do the type of query you mention. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need some help with advanced pagination
On Jan 8, 2008 1:29 PM, francky06l <[EMAIL PROTECTED]> wrote: > > Hi Chris, > > I am not sure to get what you want to do .. Do you want to show all > series Meaning all games following each other or (what I undestood), > having a "2 parts" screen when above displays all series (basically > all weeks), (you can paginate them) and then a second part that will > show (with pagination) all games of the "selected" serie ? > Yeah, that's exactly what I'd like to have. One screen that allows you to paginate through the "series" I have in the database. There are never more than 6 games in a particular series (makeups due to rainouts etc) so I don't think I need to paginate through individual games. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need some help with advanced pagination
On Jan 8, 2008 12:31 PM, Robby Anderson <[EMAIL PROTECTED]> wrote: > > > I don't know how sophisticated you plan for your sim to be, but the > inferred series method can fall down if you use a schedule generator > that creates a more "real-world" schedule where series can be spread > over two weeks, or where there are make up games (that could get > wrapped into a series if it takes place in the same week as another > series, even if there are games for one of the two teams in between > the makeup and original series), etc. Robby, Actually, the stuff I'm talking about is admin stuff for an already existing league. I'm not that ambitious that I would create a baseball sim using Cake. Check out the site at http://www.ibl.org to get a feel for what we're doing. My team is the Monrovia Madness. > > > Two more random, unsolicited notes: > > IME, doing winner_team_id/winner_score vs. home_score makes it a lot > easier to run various queries later for reporting records and > correlating stats to wins/losses. Already use that info to generate standings, so I've got it covered. > > Out of curiosity, have you looked at the Lahman database and/or > retrosheet.org? > We (meaning the league) use data from Retrosheet to create the card game our league uses. As a further aside, my current employers are a stats data company, and one of our projects is to provide info from Retrosheet to some of our clients. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Need some help with advanced pagination
Normally I don't post questions to the list, just snarky responses. I will expect no less in return. :) I'm working on an admin area for my simulation baseball league site. I have a Game model that contains games. Now, I've used the views created by bake and need to do some funky pagination with them. Normally games are grouped by series. A typical game record is id week home_team away_team home_score away_score So a 'series' would be all the records that have the same week + home_team + away_team + home_score + away_score What I *want* to do is display series and then be able to paginate through them. Not being a big pagination guy, I'd appreciate being pointed in the right direction. Is it possible that I need a Series model to make this happen? -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Formhelper error
On Jan 6, 2008 10:10 PM, ProFire <[EMAIL PROTECTED]> wrote: > > > In my view, this is how I use my form: > echo $form->input("Account.username", array()); > Why are you passing an empty array as the second parameter? It's not needed. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: {n} in generateList : What does that mean ?
On Jan 7, 2008 12:44 PM, metalseb <[EMAIL PROTECTED]> wrote: > > Hi there bakers ! > > I had to generate code for a select tag this afternoon and I did it > with the generateList/tagSelect method. In the generateList, I had to > specify key and label with the "{n}" thing before referencing the > model fields. I do not understand what the "{n}" means. I cannot find > any tip in the API doc. Anybody could teach me a bit ? > Try checking out this link, it might explain it better: http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/ -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: scripts for layout in cake 1.2
On Jan 7, 2008 11:06 AM, Guillaume <[EMAIL PROTECTED]> wrote: > Well, it may be to wait for all the DOM components to be loaded (it > could be a way to achieve that not depending on browsers' various > implementation on .onload. > Moreover, it seems a good practice to load javascript last : > http://developer.yahoo.com/performance/rules.html#js_bottom Cool. Thanks for the link. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using model objects in the controllers
On Jan 7, 2008 10:29 AM, Deane <[EMAIL PROTECTED]> wrote: > > If I can't get clean access to model objects in my controllers, how am > I to do this? > > Deane I don't understand why it's so hard to accept that a call to a CakePHP DB model returns an array of results? I may have taken computer science at college a long time ago, but I don't remember there being a rule that a model can only return a model. In cake, you usually get results from your models in your controller like this: $results = $this->ModelName->findAllByFoo($foo); And now $results contains a nice nested array. I might not be sharing the same definition as you, but that looks like "clean access to model objects" to me. Perhaps if you were to give a coding example it would help us to understand the problem you are facing. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: scripts for layout in cake 1.2
On Jan 7, 2008 10:27 AM, cmbg <[EMAIL PROTECTED]> wrote: > I have a large javascript (maybe 30KB) files and one of things that I > want the browser to execute these files last so I put the > $scripts_for_layout at the bottom of my default layout. The problem > I've run into is I also have custom css for certain views, now the css > also prints outside of the head tag, which then causes the styles to > be applied last. Why do you want the javascript to be executed last? -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Getting Data from 2 tables
On Jan 6, 2008 11:31 PM, Travis <[EMAIL PROTECTED]> wrote: > > Hey everyone, > > I'm trying to generate a list of employees and in that list I want to > show the customer which that employee belongs to. In my db I have an > employees table and a customers table and each employee has a > customer_id field. The problem is, I want to show the customer.name > field, not the customer_id. You could do this another way by doing a find() for the data set that you are looking for, and then use Set::extract to pull out just want you want. Check out this link: http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/ Hope that points you in the right direction. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Custom URL format
On Jan 7, 2008 6:09 AM, bob <[EMAIL PROTECTED]> wrote: > > I am trying to develop a site with user membership. In cakePHP 1.2, is > it possible to set up the URL so that it is in the following format: > > http://localhost/ or /app/ > > For example, i could have http://localhost/user1 > > Or does it have to be strictly in this format: /app/controller/action/ > ? > > Thanks in advance You can use custom routes to do this. Check out the section on 'routes' at http://tempdocs.cakephp.org -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: bakery hates me
their own things in. As I see it, this ability already exists through the helper / behaviour / component architecture that is in place. Let me ask this question, which I think is probably the most important one: If you were a developer wanting to use CakePHP, what branch would you want to use: 1) 1.1.x stable, which has fallen far behind in features and has no new code being contributed as far as I can tell 2) 1.2.x beta, all sorts of new features and quite stable for production use 3) cakephp-open, which is your proposed open svn branch full of all sorts of unvetted code -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Updating a Record with an auto increment id
On Jan 5, 2008 6:51 PM, Travis <[EMAIL PROTECTED]> wrote: > When I use $this->Customer->Save() this is the message I recieve ... > > Query: INSERT INTO `customers` > (`name`,`street`,`city`,`state`,`zip`,`phone`,`id`,`modified`,`created`) > VALUES > ('thomas','','Lafayette','LA','70517','337-555-','0','2008-01-05 > 17:48:02','2008-01-05') > > Warning (512): SQL Error: 1062: Duplicate entry '0' for key 1 [CORE/ > cake/libs/model/datasources/dbo_source.php, line 440] > Well, what jumped out at me right away was the fact that your 'id' field is set to 0 in the statement above. So, because 'id' is 0, it keeps trying to insert a record with an 'id' of 0, which I am assuming is the primary key for that field. I'd also bet there is one record in there with an 'id' of 0, hence SQL complaints about duplicate entries. Now, bear with me here and please remember I am trying to help... You mention above that you have a field called 'id_number' that is supposed to be the primary key for the table. Well, in the above query I don't see any field called 'id_number'. So, that leads me to think that the primary key for the table must be 'id'. In order for the update to work, you need to make sure that $this->data['Customer']['id'] is set to some value because if it is missing, then it looks like (to me anyway) that it is defaulting to 0. Tell me if that makes sense. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: bakery hates me
On Jan 4, 2008 2:02 AM, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > http://groups.google.com/group/cake-php/msg/300bec44c5902198 I read the post above, so let me see if I understand this correctly. 1) People should be allowed to commit whatever code they like to some branch of CakePHP, only for the reason that some people feel it unnecessary to use things like tickets, patch submissions, and peer code review 2) Filing tickets, bad! Unrestricted access to fuck up someone elses code, good! 3) Merging code from from some random, open branch is an easy thing First of all, this has nothing to do with there being a CakePHP wiki. The last time there was a wiki, it was apparently a huge disaster. I was not there during that time period, so I have no idea. However, feel free to knock yourself out and set one up. Secondly, the process that exists for CakePHP seems to be as follows: 1) create a ticket 2) submit a patch if one is needed with ticket 3) ticket is evaluated by someone on whether or not it's worth doing 4) If it's worth doing, the problem is addressed, patches are written, tests are updated, code is committed See, I think it's at point 3 where people get their panties in a knot. Look, not every bug or enhancement request is going to be addressed. It's that simple. Also, something that you feel is super-important might not be super-important to the core dev team. The hardest thing to do when someone asks you to add or fix something is to say "No, I don't think that is worth doing." Rajesh complains "Having fully moved to branch version, I have noted even for adding some quotes in cake/console/libs/templates/views/view.ctp, someone has to open tickets and wait for core developers." Have you EVER worked on an open source project where there was unfettered access for committing changes to the main development branches? I have yet to see one, and the reason for that is people write shitty code and make mistakes. I don't know about you, but whenever I would commit stuff to the main CakePHP dev branch I would always triple-check things before I did it. And most of the time I was content to simply add a patch to the ticket and let someone else handle merging the code in, because I can't always be 100% certain that my code won't break something that someone else, unbeknownst to me, has been working on. Seriously, did you (a) file a ticket and (b) submit a patch to fix the problem? If you didn't, then I don't think you have any right to complain about it not being done. If you did, did you follow up with the ticket itself to see if there were any comments on it? Every single ticket *is* read by someone on the core dev team, but people seem to take it personally whenever their ticket isn't immediately acted upon. Human nature, I guess. You can argue with how long it takes to get a bug or enhancement taken care of. What you can't argue is that the code being created by the core team is not of a very high quality. That is what really matters, not turnaround time for bugs. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Upgrade problems
On Jan 3, 2008 3:52 PM, Mech7 <[EMAIL PROTECTED]> wrote: > > Ok i was using the latest nightly from a few weeks ago.. but i saw the > new beta was released so i updated it.. but with the new beta or > latest nightly my pages don't output anything anymore.. just blank > does anybody know what is going on here :| > > Apache Version : > 2.2.6 > PHP Version : > 5.2.5 Have you looked at the error logs for your web server? Stupid question, sure, but it's always a good place to look when your application starts outputting blank pages. This happened to me the other day and while the problem did not show up in the error logs, it did at least force me to make a checklist of things that could go wrong. As an aside, back when I used to work at a place where I had some power to interview people "what do you do when your PHP application outputs nothing but blank screens" was a question I used to ask just to get an idea of how they approach solving problems. Hope that helps. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: bakery hates me
On Jan 2, 2008 12:27 PM, dr. Hannibal Lecter <[EMAIL PROTECTED]> wrote: > > I don't think posting links to Trac solves anything, it is a fact that > bakery has many issues (some minor and some..not so minor). > > Some things should be seriously reconsidered and rewritten. But that's > just my 2c. > I agree, but unless people post tickets to trac specifically outlining the problems they were having, it remains unlikely that the problem will be addressed. That's just the reality of how bugs are handled for this project. -- Chris Hartjes My motto for 2007: "Moving from herding elephants to handling snakes." @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Require SSL for entire site?
On Dec 31, 2007 11:48 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > Well, if you did want to do that sort of thing you could put it in a > beforeFilter() method in app_controller, but can you really trust the > contents of $_SERVER['HTTPS'] to be correct? If I understand > correctly, that info can be spoofed along with lots of other $_SERVER > values. > I know some people felt weird about what I said here, so I did a little digging around and it turns out that $_SERVER['HTTPS'] cannot be spoofed. Good to know, because I got an IM from nate saying "because if that's possible, I need to change some stuff up". I think using Robby's suggestion of requireSecure() and the blackHoleCallback is the best way to go. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Require SSL for entire site?
On Dec 31, 2007 11:39 AM, Bryan Encina <[EMAIL PROTECTED]> wrote: > > Is there anything within the cakephp framework to insure viewers are > using https vs normal http? What would be the best way of > implementing this? Would modifying the app_controller class with a > check for $_SERVER['HTTPS'] and then redirecting based on that be the > best solution? > Well, if you did want to do that sort of thing you could put it in a beforeFilter() method in app_controller, but can you really trust the contents of $_SERVER['HTTPS'] to be correct? If I understand correctly, that info can be spoofed along with lots of other $_SERVER values. Also, can't you limit access to stuff via the web server itself? I may be ignorant about setting up https in Apache, but it seems to make sense that you could say 'https uses code sitting over here while http uses stuff over there'. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $this->User->save() skips validation?
On Dec 30, 2007 6:40 PM, webjay <[EMAIL PROTECTED]> wrote: > > > _snippet from controller_ > $password = $sanitize->escape($this->data['User']['password']); > $this->User->id = $this->Session->read('userid'); > $this->User->password = $password; > $this->User->save(); > You're doing the saving stuff just a little bit wrong I think. Try this: $password = $sanitize->escape($this->data['User']['password']; $this->User->id = $this->Session->read('userid'); $this->User->save($this->data); Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Memcache and CakePHP
On Dec 30, 2007 4:34 PM, Mike Lewis <[EMAIL PROTECTED]> wrote: > > Is there anyway to check if something is being cached or not? > > Thanks for the reply btw, > > Mike > Hey Mike, Check out this page from the online PHP manual: http://ca3.php.net/memcache You might be able to use something like Memcache::ExtendedStats to create your own memcache-monitoring script. Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Memcache and CakePHP
On Dec 30, 2007 2:02 PM, Mike Lewis <[EMAIL PROTECTED]> wrote: > > So I installed memcache + added the code to core.php: > > Cache::config('default', array('engine' => 'Memcache', > 'duration' => 3600, //[optional] > 'probability' => 100, //[optional] > 'servers' => array( >'memcache.ip.address' > ), //[optional] >'compress' => true, >) >); > > > CakePHP said it detected memcache -- so whats next? > > Does it just run on its own, or do I have to add some more code to the > actual application. If so, what is it? As far as I know, your app *should* start using memcache for all the caching. Nothing else for you to do. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: New To Cake PHP
On Dec 28, 2007 1:23 PM, gourab singha <[EMAIL PROTECTED]> wrote: > Is ther any reference for cakephp job for freasher as like me. http://tempdoc.cakephp.org -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 questions
On Dec 28, 2007 4:49 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Yeah true, I guess that's what I'll have to do. If I write my own > queries though, none of the data validation that I have defined in the > model is applied correct? > Hrmyou *can* run validation on data without saving it, so your algorithm might be 1) Run $this->Model->validates($data) 2) If valid, then run custom method that does the update Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 2 questions
On Dec 28, 2007 4:37 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I guess I could do a findall with the conditions I am looking for, do > a foreach on the results, set each result to the current record and > update each record individually, but this seems very inefficient. Is > there no way to update a bunch of records unrelated to the current > record based on conditions (like "UPDATE table SET field=value WHERE > any_field_other_than_id="some_value")? Well, you could always just write some custom SQL to do it. There are times where the CakePHP DB model stuff just won't do what you need. No shame in writing custom model functions that use hand-built SQL. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: constructng result array when using findall
On Dec 27, 2007 7:44 PM, bpscrugs <[EMAIL PROTECTED]> wrote: > Is there a predefined way to nest the [ServiceTime] array into the > [ServiceDay] array, so that on all findall queries i can have a > logically structured data model array? Thank you in advance -b You might want to take a look at the Set::extract methods, which you could use to take that result set and reorganize things. Check out this link for some more info: http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/ That might be the best way to do what you're after. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP on a Apache alias, example.com/cakewww/ - HELP!
On Dec 28, 2007 12:03 AM, Louie Miranda <[EMAIL PROTECTED]> wrote: > Any ideas how to make cakephp work on a subfolder/apache alias? > > Louie > Louie, I found the following link that might be helpful: http://www.chriscassell.net/log/2006/07/27/how_to_install_.html It covers exactly what you are trying to: installing CakePHP in a subdirectory using an Apache alias. Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: share views between actions?
On Dec 27, 2007 7:45 PM, subtropolis zijn <[EMAIL PROTECTED]> wrote: > Now please, if you really must continue acting like an ass, take it to your > crappy blog where ~7200 developers don't have to watch if they don't want > to. As you wish. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: share views between actions?
> > The Cake documentation is rather limited, IMHO. In any case, if you'd paid > more attention to what I was asking you'd immediately understand why these > replies of yours are off-base. I have been paying attention and still couldn't figure out what you are trying to do. But that's probably because I would never try to do it the way you've been trying. Which makes me dumb I guess. > I'm guessing you haven't read my posts here very carefully at all. To > review: I was calling the view() method from index(). (Yeah, that's pretty > magical, I know, but these are crazy times we live in.) My question was how > to get the controller to use the view for the action I was telling it to use > instead. Perhaps you've been too busy thinking up these zingers to actually > pay attention to what it was I was asking. I don't really waste too much time thinking up zingers. Comes pretty naturally. > > No, that's not at all what I was trying to do. I was, however, trying to use > set() for something it wasn't meant for. Well, I could've told you that as well. At least you figured out the problem in a later post. And that's what really counts. > Again, please pay more attention to the questions being asked before going > off half-cocked. It makes you look like a dick, you know. HAHAHAHAHAHAHAHAHA I never worry about looking like a dick. To sum up: 1) the code you submitted did not make sense to me, which means I am dumb 2) my responses are not always meant to be helpfull, sometimes they are pointing out things that people should know already 3) saying that the CakePHP documentation is lacking is a slap in the face to all the people who have contributed things on their blogs and this mailing list, and as someone who has done quite a bit of posting to my blog about CakePHP I'm one of those people. If you can't use a search engine, I don't know what to say 4) I now understand that the view() function was not a meant to be an action but a supporting function 5) I'm glad it was something as simple as remembering that the publish_date variable was being passed in via routes 6) I never worry about being a dick Glad it was a simple solution to a problem I was too dumb to understand. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: share views between actions?
On Dec 27, 2007 3:07 PM, subtropolis zijn <[EMAIL PROTECTED]> wrote: > > My controller: > > function index() > { > $this->autoRender=false; > $this->set('publish_date', date('Y-M')); > $this->render('view'); > } > > function view() > { > $this->pageTitle = 'The Archive: ' . $this->publish_date; > $this->set('newsletter', > $this->Newsletter->findByPublishDate("{$this->publish_date}-01")); > } > > This is failing miserably because, no matter how I approach it, the > $publish_date var is not set. So it seems that I have a fundamental > misunderstanding about setting class vars in Cake. > Given that there are lots examples of how to pass data from controller to views, it leads me to wonder if you have actually read the manual for CakePHP or followed along with some examples because if you saw those examples you would immediately understand why what you are trying to do will not work. If you have read them, my apologies because we must've read two totally different sets of documentation. Also feel free to check out http://tempdocs.cakephp.org for some Cake 1.2 documentation. As nice as it would be, telling the index() action to use a view called 'view' does not mean that the action called 'view' is magically run as well. If you want $publish_date to show up in a view (wherever that view might be) you need to make sure you do a $this->set('publish_date', date('Y-m-d')) in the same action where you are doing $this->view('view'); Why? Because that's the way CakePHP needs you to do it. To do anything else is banging your head against the framework in a most uncomfortable way. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: share views between actions?
On Dec 27, 2007 2:45 PM, subtropolis zijn <[EMAIL PROTECTED]> wrote: > Let me be the first to respond that that does not work. In any case, no, I > do not have a foo class. See the "Missing View" error part of my query. > *sigh* It was simply an example of how to output something in an action in a controller if you do not wish to create a view. That's all. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: share views between actions?
On Dec 27, 2007 1:41 PM, subtropolis <[EMAIL PROTECTED]> wrote: > > CakePHP 1.2.x, PHP 5.1.4, Postgres8.1 > > I've a controller for an archive for which i need to make the default > view display the data for the present month. The "view" action > displays certain data given a date (for clarity's sake, i'll call my > "view" action "foo" here): > > Everything aside from the displayed data is the same whether > requesting a particular month or the default. The archive navigation > is provided by an element included into the view. Consequently, I > thought that I should simply call foo() from the index action in the > controller: > > function foo($publish_date = null) > { > $publish_date = !is_null($publish_date) > ? $publish_date : > (isset($this->params['publish_date']) > ? $this->params['publish_date'] : date('Y-M')); > } > > function index() > { > $this->foo(date('Y-M')); > } > > Unfortunately, it seems that the view is chosen immediately upon > making the controller request. Because there is no index.ctp I'm > getting the "Missing View" error. > > I found some advice online to add the following to my index action: > > $this->view = 'foo'; > > But this just results in an error because cake cannot find the fooView > class, so I think this not what I'm searching for. > > Is there any way I can do this without copying foo.ctp to index.ctp? > This isn't a question of making this an element, nor a layout (neither > of those options seems at all correct). If I have to make a copy then > so be it but it seems a poor solution. Is there another way to deal > with this? Let be the first person to say to you... huh?!? I'm assuming you want to get the output of your foo() class into a view? You need this in your index() action if you are determined to not use a view: function index() { echo $this->foo(); } Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake is overwriting a record instead of adding a new record
On Dec 26, 2007 10:07 AM, Robert Sosinski <[EMAIL PROTECTED]> wrote: > > Hello again, > > I am having this problem. I have a Thread model and a Post model. > What is interesting is whenever I have a post that has the same id as > the thread_id (so, id = 4 and thread_id = 4), cake will no longer add > new records. It will only overwrite the same record over and over > again (like it is editing it). > > Anyone else have this problem? > > Thanks. I would suggest looking at two things: 1) make sure your associations are set properly 2) make sure you do $this->ModelNameHere->create() before you do a save. That way you can insure a new record is supposed to be created. I also agree with davidgregan's suggestion about making sure you have the id field for your tables either an auto-increment field or generate your own unique ID's Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: routes.php and the root directory
On Dec 24, 2007 1:35 PM, boris <[EMAIL PROTECTED]> wrote: > > Hi. I'm trying to make the URL http://localhost/cake/ point to the > 'welcome' action in controller 'PagesController'. To achieve this, I > add... $Route->connect('/', array('controller' => 'pages', 'action' => > 'welcome')); ... to app/config/routes.php. However, when I got to > http://localhost/cake/, the browser displays a listing of the contents > in app/webroot. Any light you can shed on this will be much > appreciated! Check your web server configuration. Sounds like you might not have set the Index property (or whatever the equivalent in IIS) so that it looks for webroot/index.php. Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: "User Routing" -- or user account urls -- or multiple instances of cake?
On Dec 24, 2007 1:02 PM, Tom.Maiaroto <[EMAIL PROTECTED]> wrote: > > I think now I HAVE to separate them because I also want friendly urls. > > So: abc.com/tom/posts/about-me > can exist along with : abc.com/jerry/posts/about-me I think you should take a look at using custom routing to make this happen. Probably the easiest way to do it. http://tempdocs.cakephp.org/#TOC35993 Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems going to production with CakePHP
On Dec 21, 2007 12:14 PM, mbavio <[EMAIL PROTECTED]> wrote: > > Hi, I´m having some troubles moving my app from local to a production > enviroment. I´ve mod_rewrite ON and tmp with 777, but when I put > www.jdpropiedades.com.ar, a blank page appears. I dont know what to > do, I´ve configured all as the manual says. Oh, my VPS uses > virtualhost, by the way. Anybody has experienced the same problem? Can > you help me please? > > Thank you very much. > > Martin Have you looked at your web server error logs? They might provide some useful information. I also suggest deleting anything that is in tmp/cache/ in case that is causing problems. Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: PHP Version 6 compatibilty
On Dec 21, 2007 11:14 AM, bingomanatee <[EMAIL PROTECTED]> wrote: > > It better; PHP already doesn't "Support" PHP 4 so when 6 comes out, > 5's days are numbered. > > Unless we just do an end zone and all revert to PHP 3 ... :D > I follow the weekly PHP summaries via Zend Developer Zone and I get the impression that the following is true: PHP 6 = PHP 5.3+ with full native unicode support So it's anyone's guess as to when the end of support for PHP 5.3 will be. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: New To Cake PHP
On Dec 21, 2007 10:10 AM, Gourab singha <[EMAIL PROTECTED]> wrote: > > I am new To Cake PHP .It is very difficult to me that communicate > Module,Controller,View To Each Other,Please Send me a simple coded > project that help me to understand the communication between > Module,Controller,View .Please Don't attach and Mysql database > table .Then it is hard to me to understand. > > > also send a code that display Name, Age of the user from the database > that is in table User Of Mysql Database. > > > > Please Help Me Bose.. > > Thanks You All Member of The Cake PHP Comunity. I suggest you look at the example in the manual on building a blog using CakePHP. While the code isn't 100% perfect, it is a great introduction to some key features of CakePHP. Hope that helps. Also, don't forget to use Google. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: include everywhere | app_controller.php
On Dec 21, 2007 10:33 AM, carSign <[EMAIL PROTECTED]> wrote: > > Hi - > > So I am trying to include a small snippet of code in each page of my > site. Is there a way to do this without modifying each controller? > > For example - I want to log visitors to my site. Each page visited > would have some information put into the database. > > URL > User info > tiestamp > browser info > > Can I do this using the app_controller? Can it be done without the > need to modify all of my existing controllers? > If I include it in the app_controller do I name that action 'index'? > do I then create a app_model? > Best spot for that, in my opinion, would be in a beforeFilter() method in app_controller. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: image link dorks up my session
On Dec 20, 2007 4:50 PM, hmpierson <[EMAIL PROTECTED]> wrote: > > You should have quit while you were behind with your wise mouth. > Very helpful. Thanks! -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Login of different types of users
On Dec 20, 2007 8:55 AM, dandreta <[EMAIL PROTECTED]> wrote: > > Hi!! > I am searching and reading enough things on the users' access and > permissions (OthAuth, ACL ...). The question is that I want to do the > access to my application depending on the type of user. I have 3 types > of users:manager, client, supplier and in the database 3 tables with > their different information. I have a screen of login with fields > password and user. I want that logging someone, depending on the type > of user who is, jumps to a different screen with his corresponding > layout and home page. I do not have clear how to do this with things > that I have read. Do you know any link or anything where is explained > what I want to do? Dandreta, I have done similar things using the Auth component in CakePHP 1.2. Here are some links to my blog where I talk about it: http://www.littlehart.net/atthekeyboard/?s=Auth That will give you all the posts / tutorials where I talked about using Auth. Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: image link dorks up my session
On Dec 19, 2007 2:23 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > "What was the answer you were looking for?" > I am looking for something helpful and you've responded both times > with a whole bunch of nothing, you've spent a lot of time writing when > you should have said to yourself "I don't really know anything that > can help so I'll leave this post to someone that does." Now, now, don't go around saying what I said was a 'whole bunch of nothing'. That would be throwing away the advice of someone who have lots of experience dealing with shitty code, usually of my own creation. In the end, it *was* your code that was broken: you can't manipulate the session like that when you have the Security level set so high. :) Out of habit I always turn down the security level stuff so I never really run into this. Silly me. In the future, I will be quick to point out to people to turn down the security level in their configuration file if similar session problems occur. See, wasn't that easy? Now, if you want r5982 then you need to start using the version from SVN instead of downloading from the web site. I believe you can find the link on trac.cakephp.org. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: image link dorks up my session
On Dec 19, 2007 1:06 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > href tag in the view. I appreciate the reply, but saying "it's the > code" is not very productive, of course something is wrong with the > code, I'm just trying to see if anyone has any ideas about what it > could be (ie if anyone has seen this before, how did they fix it). > Why is it when someone is told that the non-core code they are using or have written isn't working properly, they get all defensive and complain that being told that fact is 'not very productive'? I know this will come as a shock to many people, but I have written both good code and shitty code. Most of the time when a problem with a CakePHP app occurs, it's because of the shitty non-core code that someone has written. What was the answer you were looking for? "Yes, it must be CakePHP's fault that some part of the non-core code is messing with the contents of a session". I will restate what I said before: there is nothing about adding properly-formed href tags or properly formed img-src tags to a page that will cause sessions to not work properly. Therefore, it must be a problem in the code. I will gladly change my mind when presented with evidence to the contrary. Just because you don't like the answer doesn't mean that it isn't helpful or isn't valid. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: image link dorks up my session
On Dec 19, 2007 12:42 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > but whenever I use this in a page it resets my session somehow so that > I fail $this->Session->check('User'). If I leave out the image and > just use: $html->link(' Text ','/smarts/add',null,null,false); then > the session persists. I've also found that putting an normal html > links (such as "a href=" or "img src=") will also cause my session to > fail, but $html->link and $html->image both work fine. I've tried this > on several servers and can't get it to behave. Any ideas? below are my > session store and session check calls: I have never seen such behaviour before either with Cake or any other PHP app I've written. As mean as it sounds, I'm inclined to believe there are other factors at play. Why would putting in image tags or href links cause a session to die? It makes absolutely no sense given my experiences, which leads me to suspect that code is causing the problem not CakePHP. But that's just my opinion. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: PHP Version 6 compatibilty
On Dec 19, 2007 8:38 AM, Stefan <[EMAIL PROTECTED]> wrote: > > I guess the real question was: > > Will CakePHP be compatible with PHP6? > I guess the real answer is until PHP 6 goes stable, how the heck can we possibly know if CakePHP will be compatible with PHP 6? Since it appears that PHP 6 will be PHP 5.3 (and beyond) with native unicode support, my guess is that it will be just fine. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: PHP Version 6 compatibilty
On Dec 18, 2007 3:36 PM, Stefan <[EMAIL PROTECTED]> wrote: > > Having good ol SQL Server character coding problem. Supposedly PHP6 > fixes the problem, Cake compatible with V6 or not? PHP 6 isn't even close to a stable release, so I would have to say no. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem while saving in CakePHP 1.2
On Dec 18, 2007 4:20 PM, Ldg27 <[EMAIL PROTECTED]> wrote: > > > Try sticking $this->User->create() in front of > > $this->User->save($this->data) > > It didn't worked. Could it be achieved with a beforeSave()?? > And could the login() action could also match the password been > entered with the one in the database, with a beforeFind()?? > > Thanks. > 2 more things for you to try: 1) make sure that $this->data actually contains information 2) make sure that your code actually gets to the point where $this->User->save() would get executed The only reason data wouldn't get saved would be if your database isn't working or $this->data is empty. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem while saving in CakePHP 1.2
On Dec 18, 2007 2:07 PM, Ldg27 <[EMAIL PROTECTED]> wrote: > > $this->User->save($this->data); Try sticking $this->User->create() in front of $this->User->save($this->data) -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Will CakePHP be able to survive as the Zend Framework matures?
On Dec 17, 2007 8:17 PM, kiang <[EMAIL PROTECTED]> wrote: > > I think ZF is one flexible framework which you could use it in Cake > style or in PEAR style. I would love to hear core developers intend to > include some resources from ZF(like the java part, because I still > couldn't find better solutions to generate reports without problems in > Chinese.) and ezComponents (like the work-flow engine). :) Why would those components be included in CakePHP when you can easily incorporate them from ZF and ezComponents (although I have not seen an example of doing this) into CakePHP already? -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Stop Users From Going Back After Logout
On Dec 17, 2007 5:33 PM, MrG <[EMAIL PROTECTED]> wrote: > > Hi Chris, I was looking for those two tutorials in your blog but can't > find none. > http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/ http://www.littlehart.net/atthekeyboard/2007/11/20/follow-up-to-a-hopefully-usefull-tutorial-for-using-cakephps-auth-component/ -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Creating a "Site down" error page?
On Dec 17, 2007 12:12 PM, RichardAtHome <[EMAIL PROTECTED]> wrote: > > Yup, true. But, how *would* you configure cake to redirect to a site > down page if the database connection failed? > > Some code in bootstrap.php that checks for a connection and then > redirect to pages/site_down for example? > Yeah, I'd put it in the beforeFilter() of app_controller like some others have suggested. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Creating a "Site down" error page?
On Dec 17, 2007 10:28 AM, squidliberty <[EMAIL PROTECTED]> wrote: > > I have on occasion had problems with my hosting during which MySQL is > not accessible. The result is that CakePHP renders a malformed page > and (if Debug is in use) throws a number of errors (such as "Too many > connections"). In this sort of situation, some CMS (eg. Joomla!) will > automatically throw up a "This site is down" page. Can anyone tell me > how this might be done with CakePHP? I assume that there is some way > to check for a proper database connection and generate an error > message if one cannot be established. Any advice appreciated! It's called 'write code that actually checks for errors'. This is an issue for any application, and I cannot think of any framework that automatically gives you that kind of functionality. What you call 'automatic' is the result of a forward-thinking developer who made a commitment to proper error handling. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Few questions from a Cake newcomer...
On Dec 15, 2007 2:57 AM, Funkdafied <[EMAIL PROTECTED]> wrote: > > > 1. If I go to "http://localhost/users";, it works just fine and the > index page comes up as expected.. but all links seem to have a top- > level directory of "app". eg: > http://localhost/app/users/add > http://localhost/app/users > How can I remove "app" from the URL? Pages work fine without (and > with) it, but all links seem to have it by default even though it's > unnecessary. Make sure you are using URL rewriting. If you're using Apache, there are lots of instructions on Google on how to get it to work with CakePHP. > > 2. I'd like to create a "mobile" version of my website, accessible > from mobile/cell phones.. I want the URL to be something like > "domain.com/mobile", so it would have pages such as "domain.com/mobile/ > users". They would share the same controller and model as the main > page but with a different view. How would I do this? You can use a combination of custom routes and code in your controller that detects if you're using a mobile browser or not, then telling it what view you want to use. > 3. I see that layouts have placeholders for content and the title.. > but what do I do about menus? In particular, I'd like to be able > highlight the current menu item but obviously not put the markup in > all views. Not a Cake issue. Javascript/DHTML issue. > 4. I noticed "bake" can create admin pages, but how can I make them > secure with a password? Well, that's not really a CakePHP issue either. Use standard HTTP Authentication *or* spend some time learning how to use the Auth component in CakePHP 1.2 > 5. I'm sure it's simple but how would I make a page such as > "domain.com/legal" ? There's no model behind it, it doesn't really > need a controller.. and the name is singular. You could use the static 'pages' controller, again with a custom route to make calls to domain.com/legal go to pages/legal Others will correct me I'm sure. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: simple noob question - accessing model functions from bootstrap.php
On Dec 16, 2007 11:21 AM, glastoveteran <[EMAIL PROTECTED]> wrote: > > i.e. I have configuration parameters stored in a db table and I want > to set them as constants at startup time. My model name is Parameter > (parameter.php). Yes, I agree with the other posted suggestions: 1) put in a beforeFilter() method in your app_controller 2) take a look at the Configure class if using 1.2 -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: chaging default model
On Dec 16, 2007 1:18 PM, Jon Miller <[EMAIL PROTECTED]> wrote: > > Can anyone tell me how to achieve this change, as RequestAction > clearly doesn't work. I need to change it so that the form helper > (using the value function in helper.php) will populate, as it takes > its criteria from $this->data[$this->model][$this->field] and if it's > using the wrong model to start with, it's not going to populate the > form correctly. Perhaps I am misunderstanding the problem you are trying to explain here. What you have is one section of your page that contains a form that someone can alter, right? Why not display the info as an element in your page and then use an Ajax submit to process the information? No need to mess around with RequestAction or anything like that as far as I can see. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Shouldn't the Text Helper use multibyte strings instead?
On Dec 15, 2007 3:26 PM, mclee <[EMAIL PROTECTED]> wrote: > > This is wierd, why so harsh? > > Is everybody allowed to commit back to the repository? > I can send in my code on the Text Helper. Not harsh, just asking. I mean, if it's so simple then by all means submit a patch. Best way to do it is by going to trac.cakephp.org and filing a ticket along with your patch. If the core dev team likes it, it will make it's way into the code. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Accelerating cakePHP
On Dec 15, 2007 3:00 PM, Pillow <[EMAIL PROTECTED]> wrote: > > Hi, > I've website which has about 3 uniq visits per day (up to 1500 > online). The problem is that CMS written on CakePHP consumes too much > of CPUs power. > > Almost everything is beeing cached (whole views, sometimes db > results). > > In addition the same site was earlier driven by some poor free system > which hadn't even had cache, and the CPU usage was about 6 times less. > > Do you have any tricks and tips to speed up system based on cake? > Sounds like it was poorly designed, as 3 hits a day isn't what I would consider high traffic. However, I would suggest the following: 1) install a PHP opcode cache like APC 2) make sure you have appropriate database indexes in place 3) spend some time profiling your code using tools like Xdebug and Cachegrind to find out where the slow spots really are. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Extended Validation !?
On Dec 15, 2007 2:34 PM, stefuNz <[EMAIL PROTECTED]> wrote: > > Hi! > > I want to use validation for the following situation: > > I have a select field (field1) with options a,b,c > If field1 is a or b then field2 and field3 may not be empty (text > fields) > if field1 is c then field4 may not be empty ... > > is there a way to use the validation for this or has it to be > "manually" Sounds to me like it is definitely custom validation, which means you'll have to do it "manually". Luckily it's very easy to do it. http://tempdocs.cakephp.org/#TOC121877 Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can CakePHP allow a /users/username/action directory syntax?
On Dec 15, 2007 12:59 PM, Theo Chakkapark <[EMAIL PROTECTED]> wrote: > > I have a website that I'd love to convert to CakePHP, and I was > wondering if there was a means to use a URL syntax that goes like > this: > > /users// You can create custom routes that map URL's to controller/action pairs. Read up in the old manual and the new manual (http://tempdocs.cakephp.org) on how to create routes. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Shouldn't the Text Helper use multibyte strings instead?
On Dec 15, 2007 12:05 PM, mclee <[EMAIL PROTECTED]> wrote: > > Well, we have 'function_exists', don't we? > > Surely we can do a degrade if mb_substr is not installed. > Are you volunteering to do it? -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: form->create() ::: how can use onSubmit in form->create()
On Dec 14, 2007 1:06 PM, WordPress Guru <[EMAIL PROTECTED]> wrote: > > Thanks Chris, and grigri > > I understand the differnce between a manual and I think the purpose of > any good document is to at least inform the reader about the > parameters of any method. The api is so poorly documented that in most > case it does not tell in any detail about the parameters. For example > in one case, it tells that options array is just like form_remote_tag I'm sorry if you think I was implying that you didn't understand the difference between a manual and an API. That wasn't my intent. I agree that parts of the API could be better documented, perhaps with an example of it's use. > > Maybe a user editable wiki will do the job, or something like php.net > which has user contributions as part of the manual. This was done in the past (before I got involved with CakePHP) and apparently it was a huge disaster. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: form->create() ::: how can use onSubmit in form->create()
On Dec 14, 2007 10:35 AM, WordPress Guru <[EMAIL PROTECTED]> wrote: > > Thanks and it works. > > Just one more thing. I am totally frustrated with the documentation > available at api.cakephp.org . Do you guys have some other resource to > look to ? Well, api.cakephp.org is, well, documentation on the API. Not a manual itself. Check out the in-progress documentation for 1.2 at http://tempdocs.cakephp.org. Also check out http://bakery.cakephp.org. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: download file
On Dec 14, 2007 9:37 AM, bingo <[EMAIL PROTECTED]> wrote: > > hi all, > > I don't see this as hilarious. If someone is asking for information, > provide it if you can rather than trying to make fun of something or > someone. It's not funny, it's sad. Sad because someone is not making the proper effort to ask a question that can be actually answered. It's like me saying 'Help, my code won't work' and providing no further information. How can *anyone* be reasonably expected to answer a question like this? 1) Tell us what you are trying to do 2) Show us the code that is not working 3) If your English skills are not good enough for this English-only mailing list, then let us know what languages you are comfortable with and you can be pointed to resources in your own language. If someone is not going to make the effort to ask a question that can be answered, then why should I be bothered making a coherent answer? It's far easier to shake my head in amazement that this person actually expects an answer and delete the message. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake 1.2.x.x console problems
On Dec 13, 2007 2:09 AM, Adam D. <[EMAIL PROTECTED]> wrote: > > I can't run the bake command, or any of the commands from the console. > > I viewed the screencasts, but still, no luck. > > If I execute > > /usr/bin/php cake/console/libs/bake.php > > ...and I get the output from the console, with paths, etc. > You don't run the console utilities that way. If you followed the screencasts and put the cake console script in your path, then you'd access bake by doing this: cake bake That's it. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Limited number of Conditions??
On Dec 12, 2007 8:17 PM, Mr-Yellow <[EMAIL PROTECTED]> wrote: > > Just tried putting them inside an 'AND' and no go > > -Ben > What's the actual error message that's being generated? A blank page happens when you have PHP configured to not show any errors to the user, but errors should be appearing in your web server error logs. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Ajax in an Ajax rendered View
On Dec 12, 2007 4:32 PM, Nina <[EMAIL PROTECTED]> wrote: > > I'd like to bump this problem, because I have exactly the same issue. > > I have attempted to use javascript instead of using the helper, but > somehow the renderer strips the javascript away. I don't know if this > is a feature of some sort, but if it is, I'd like to know how to > disable it. I have never seen the renderer 'strip the javascript away', so this sounds like there is different problem. Why on earth would would a renderer get rid of anything you put in your templates? -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: findAllThreaded Returning Empty
On Dec 12, 2007 4:12 PM, AJ <[EMAIL PROTECTED]> wrote: > > Chris, > > Thanks for the response. Actually that made a lot of sense. > Unfortunately I was already in debug mode 2. > > I tried setting it to every other value and even deleted the cache > file. Same result. And again, I checked the SQL output and it runs > fine by itself. > > Open to other ideas :) I will say this: if CakePHP is generating the proper queries then perhaps you are looking at the wrong array? Try pasting the code in question over at http://bin.cakephp.org and posting the link here. It might be something really silly. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: findAllThreaded Returning Empty
On Dec 11, 2007 9:08 PM, AJ <[EMAIL PROTECTED]> wrote: > > But the array keeps coming back empty. However, if I copy the SQL > query that Cake builds and run it, it returns exactly the records it > should. > Are you by chance developing with debug in config/core.php set to 0? Try setting it to at least 1, removing what is in APP/tmp/cache and see if it makes it go away. If the SQL is correct, then chances are it's CakePHP looking at previously cached data and not knowing what to make of it. Sounds like you can see the SQL (which means you have debug set high enough) but maybe there is data in APP/tmp/cache that is messing things up. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Site remake with big plans - Suggestions?
On Dec 12, 2007 2:21 PM, 703designs <[EMAIL PROTECTED]> wrote: > > One specific question I have: If I go forward with Cake, should I use > the stable 1.18, or go with the PreBeta? PreBeta for sure. Ignore the chicken littles talking about broken functionality. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: findAll, associations, HABTM
On Dec 11, 2007 10:25 PM, Mr-Yellow <[EMAIL PROTECTED]> wrote: > > As for writting CakePHP I think that would be better left to those > with an eye on the direction and conventions of the project, those who > should realise this is a feature at the basis of being able to use > CakePHP for DB access. Without full and proper database support, raw > SQL is much faster and easier to use, so what if a few servers might > not like a query here or there. Kind of defeats the purpose of RAD > when takes 10x as long to write a query in Cake as it does in SQL, > then said query runs twice as slow do to being broken into 50 parts > and looping through everything to construct arrays. Ben, you are absolutely write that there are some situations where doing the SQL yourself is faster than what CakePHP can produce. However, the point is not to create perfectly tuned SQL. The point is to build the application fast by using all sorts of helpers. Luckily you're not locked in to using Cake's DB model if you really don't want to, you just lose all those nicely formatted result sets. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---