Re: Calling core devs for a quick brief on Admin Routing in 1.2
Hi Seb, For reference, the devs don't read every post on this mailing list. If you find an issue like this that you are sure is a bug, post a ticket on trac ( https://trac.cakephp.org ). If you just want to discuss it to find out, there is almost always one of the devs on IRC ( http://irc.cakephp.org/ ). Can certainly be quicker than this google group, where it can be easy to miss the occasional post. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 Router usage as of 5535 $Route->connectNamed()
I deduced from this line that it needs 'sort', 'direction', and 'order' $url = am(array('sort' => $key, 'direction' => $dir), $url, array('order' => null)); On Sep 20, 12:26 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > In light of this, anyone know which named variables (if any) are > required for PaginatorHelper::sort() to work? > > On Sep 13, 5:16 pm, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > On Sep 13, 5:13 pm, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > I still don't really know whether this is all by design, but in order > > > to get PaginatorHelper working I had to add elements for 'page' and > > > also 'step', which Paginator uses, in order for links to form > > > correctly. > > > > Router::connectNamed(array('step', 'page')); > > > > A regex match can be added as the value instead like > > > array('step'=>'[0-9]+', 'page'=>'[0-9]+). I assume it will fail then > > > if there is no match, so passed variables become more secure. > > > > On Sep 10, 3:40 pm, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > > > I have been working all morning on this without any luck. This is on > > > > Cake 1.2 (branch) / 5626. The only nonstandard thing I'm doing is app > > > > and webroot dirs outside the normal locations (and renamed), but that > > > > shouldn't make a difference with this. > > > > >ROUTE > > > > $Route->connect('/:community_id/bulletins/:action/*', > > > > array('controller' => 'bulletins')); > > > > > CONTROLLER/VIEW > > > > echo $html->url(array('community_id'=>203, 'controller'=>'bulletins', > > > > 'action'=>'view', 'bulletin_id'=>23423)); > > > > > EXPECTED URL: > > > > /203/bulletins/view/bulletin_id:23423 > > > > > RETURNED URL: > > > > /bulletins/view > > > > > MODIFICATION (bulletin_id param removed) > > > > echo $html->url(array('community_id'=>203, 'controller'=>'bulletins', > > > > 'action'=>'view')); > > > > > RETURNED URL: > > > > /203/bulletins/view --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 Router usage as of 5535 $Route->connectNamed()
In light of this, anyone know which named variables (if any) are required for PaginatorHelper::sort() to work? On Sep 13, 5:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Sep 13, 5:13 pm, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > I still don't really know whether this is all by design, but in order > > to get PaginatorHelper working I had to add elements for 'page' and > > also 'step', which Paginator uses, in order for links to form > > correctly. > > > Router::connectNamed(array('step', 'page')); > > > A regex match can be added as the value instead like > > array('step'=>'[0-9]+', 'page'=>'[0-9]+). I assume it will fail then > > if there is no match, so passed variables become more secure. > > > On Sep 10, 3:40 pm, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > I have been working all morning on this without any luck. This is on > > > Cake 1.2 (branch) / 5626. The only nonstandard thing I'm doing is app > > > and webroot dirs outside the normal locations (and renamed), but that > > > shouldn't make a difference with this. > > > >ROUTE > > > $Route->connect('/:community_id/bulletins/:action/*', > > > array('controller' => 'bulletins')); > > > > CONTROLLER/VIEW > > > echo $html->url(array('community_id'=>203, 'controller'=>'bulletins', > > > 'action'=>'view', 'bulletin_id'=>23423)); > > > > EXPECTED URL: > > > /203/bulletins/view/bulletin_id:23423 > > > > RETURNED URL: > > > /bulletins/view > > > > MODIFICATION (bulletin_id param removed) > > > echo $html->url(array('community_id'=>203, 'controller'=>'bulletins', > > > 'action'=>'view')); > > > > RETURNED URL: > > > /203/bulletins/view --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email solution for cake 1.1
Hi hondya I use phpmailer happily. I am sure that either that or swiftmailer would do the job fine. Regards, Langdon hondya wrote: > I am using cake 1.1 (since it is the stable release) and would like to > know which is the best email (SMTP emailer) solution for this release. > I see several articles on the wiki page and am confused which one > should I use. Also I don't want anything fancy (no HTML, no > attachments). > Thanks to all you folks. > > - Vishal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 and learning..
Daniel I am using cake as a way to introduce OOP and MVC, some of my students have done Java and so have exposure to OOP, the others I am letting them expose themselves to cake and next term will go over what they have been doing in the 1st week or so as a theoretic summary. I'll have to start writing the experience up anyhow as a case study in education ;-) John The manual is a starter, the IBM tutorials are good for that as well as they get their teeth into a step by step building of a small application. These students are diploma level and should be able to do self directed learning, with me guiding them. Well that the theory anyhow. This is a test semester to see what happens, and see how they cope with the more self directed mode. Ady -Original Message- From: cake-php@googlegroups.com on behalf of DanielSun Sent: Wed 9/19/2007 19:58 To: Cake PHP Subject: Re: CakePHP and learning.. I see the most importance when working in Cake (or any php framework) to really understand the MVC idea and the Object oriented methodology of coding. It is very frustrating and for that matter even unreasonable to learn Cake if one doesn't understand principles of OO. I hope your students don't have issues with that. It is very nice to hear, that you are teaching your students php using Cake. On Sep 19, 4:38 am, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > Is there a way the manual can meet that need? It's currently being re- > vamped and polished for the 1.2 release. > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Complex Ajax question.
DGPhoebus, 1. Use jQuery. If you love CakePHP and write your own JS (not using the cake helpers) then this is the way to go, trust me ; ). 2. Echoing some text in a cake action w/o rendering a view is done using: $this->autoRender = false; echo 'My text'; inside your controller action 3. You may want to use "magic" numbers representing statuses. Neither you nor the poor fellow who may have to make some adjustments 2 years down the road will remember them. 4. Here are some snippets showing how I would implement your problem: controller action (ShowSeatsController::reserve): function reserve($show_id = null, $seat_id = null) { if ($this->RequestHandler->isPost()) { return $this->set('success', $this->ShowSeat->reserve($show_id, $seat_id)); } die('XSRF attacks suck ...'); } model function (ShowSeat::reserve): function reserve($show_id = null, $seat_id = null) { $this->Show->id = $show_id; $this->Seat->id = $seat_id; if (!$this->Show->exists() || !$this->Seat->exists()) { return 'error'; } $showSeat = compact('show_id', 'seat_id'); if ($this->hasAny($showSeat)) { return 'taken'; } $this->create($showSeat); if (!$this->save()) { return 'error' } return 'ok'; } view (reserve.ctp): echo $javascript->object(compact('success')); jquery javascript (reserve.js): function reserveSeat(show_id, seat_id, callback) { $.post('/show_seats/reserve/'+show_id+'/'+seat_id, {}, callback, 'json'); } $(function() { $('table#seats td').click(function() { var data = $(this).attr('id').split('-'); reserveSeat(data[0], data[1], function(response) { if (response.success == 'ok') { // ... } }); }); }); If you wonder why I got so detailed here is b/c I think your example is very nice for showing some of the strength of CakePHP in an easy to understand way, so I hope others will like the above snippets as well. (However, all of this was written off the cuff and not tested ^^). -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de DGPhoebus wrote: > Okay here is the situation, I am working on a "Ticketing" website that > I have already created in the "old" method of making websites (not > CakePHP). I am redoing it now using CakePHP and I love it. Here is > my problem. On the old site, I built out the layout of the theatre > using a table with each seat being represented by a td cell. Each td > cell had an onclick event that called my own code that either > "reserved" or "released" the selected seat by an AJAX call. My AJAX > call would return a value, '1','2', or '0' denoting "success", > "failure", or "arleady taken" to my javascript function. I would then > move on based on that response: > > var response = oXmlHttp.responseText; > switch (response.charAt(0)) { > case '0': >// Alert that seat was already taken > break; > case '1': > // Success > break; > case '2': > // Alert Error > break; > } > > I have re-written this code using Prototype and can make the call to > Controller/reserve . BUT 1. I have to create a useless "view" for > this controller action and 2. I can't return a value of either 1,2, or > 0. If I echo any of those characters the response text contains the > entire "view" listing with "headers already sent" error. If I try to > return any of those values it returns the entire view. > > Is there a way to call a controller action without needing a view? Is > there a way to return a value from the controller action like I need > 1,2, or 0? > > There are many actions that need to happen based on which return value > I get from my AJAX call so it has to happen this way. The AJAX helper > only appears to follow the form of SAVE then UPDATE and that is not > enough. > > There has to be a way to do this without doing it the old way of > making a call to a single script sitting in the document root.I am > still very new to Cake so if this could be solved by something like a > Component or something I would greatly appreciate some direction. > Redoing this site with Cake has been fantastic and I have rolled right > along up to this point, but I have stalled out. > > Please help! > >
Re: Complex Ajax question.
Okay... it appears I found my own answer. Not that anyone will be doing what I am doing but for all who do not know you can call a controller by AJAX request without needing a view. Set the layout for that controler = 'ajax'. Now I can echo my litter heart away. Hope my frustration helps someone else. Happy baking. Daniel On Sep 19, 11:12 pm, DGPhoebus <[EMAIL PROTECTED]> wrote: > Okay here is the situation, I am working on a "Ticketing" website that > I have already created in the "old" method of making websites (not > CakePHP). I am redoing it now using CakePHP and I love it. Here is > my problem. On the old site, I built out the layout of the theatre > using a table with each seat being represented by a td cell. Each td > cell had an onclick event that called my own code that either > "reserved" or "released" the selected seat by an AJAX call. My AJAX > call would return a value, '1','2', or '0' denoting "success", > "failure", or "arleady taken" to my javascript function. I would then > move on based on that response: > > var response = oXmlHttp.responseText; > switch (response.charAt(0)) { > case '0': >// Alert that seat was already taken >break; > case '1': > // Success > break; > case '2': > // Alert Error > break; > > } > > I have re-written this code using Prototype and can make the call to > Controller/reserve . BUT 1. I have to create a useless "view" for > this controller action and 2. I can't return a value of either 1,2, or > 0. If I echo any of those characters the response text contains the > entire "view" listing with "headers already sent" error. If I try to > return any of those values it returns the entire view. > > Is there a way to call a controller action without needing a view? Is > there a way to return a value from the controller action like I need > 1,2, or 0? > > There are many actions that need to happen based on which return value > I get from my AJAX call so it has to happen this way. The AJAX helper > only appears to follow the form of SAVE then UPDATE and that is not > enough. > > There has to be a way to do this without doing it the old way of > making a call to a single script sitting in the document root.I am > still very new to Cake so if this could be solved by something like a > Component or something I would greatly appreciate some direction. > Redoing this site with Cake has been fantastic and I have rolled right > along up to this point, but I have stalled out. > > Please help! > > Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Complex Ajax question.
Okay here is the situation, I am working on a "Ticketing" website that I have already created in the "old" method of making websites (not CakePHP). I am redoing it now using CakePHP and I love it. Here is my problem. On the old site, I built out the layout of the theatre using a table with each seat being represented by a td cell. Each td cell had an onclick event that called my own code that either "reserved" or "released" the selected seat by an AJAX call. My AJAX call would return a value, '1','2', or '0' denoting "success", "failure", or "arleady taken" to my javascript function. I would then move on based on that response: var response = oXmlHttp.responseText; switch (response.charAt(0)) { case '0': // Alert that seat was already taken break; case '1': // Success break; case '2': // Alert Error break; } I have re-written this code using Prototype and can make the call to Controller/reserve . BUT 1. I have to create a useless "view" for this controller action and 2. I can't return a value of either 1,2, or 0. If I echo any of those characters the response text contains the entire "view" listing with "headers already sent" error. If I try to return any of those values it returns the entire view. Is there a way to call a controller action without needing a view? Is there a way to return a value from the controller action like I need 1,2, or 0? There are many actions that need to happen based on which return value I get from my AJAX call so it has to happen this way. The AJAX helper only appears to follow the form of SAVE then UPDATE and that is not enough. There has to be a way to do this without doing it the old way of making a call to a single script sitting in the document root.I am still very new to Cake so if this could be solved by something like a Component or something I would greatly appreciate some direction. Redoing this site with Cake has been fantastic and I have rolled right along up to this point, but I have stalled out. Please help! Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: requestAction not doing anything
,array('return') On 9/19/07, hnr.louder <[EMAIL PROTECTED]> wrote: > > I'm trying to use $this->requestAction in a controller to grab an > action that renders a table for a report. Going directly to the URL > works fine, and I'm positive I'm passing the right url to the method. > Any ideas? > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
requestAction not doing anything
I'm trying to use $this->requestAction in a controller to grab an action that renders a table for a report. Going directly to the URL works fine, and I'm positive I'm passing the right url to the method. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Getting started with PHP and Database Driven Sites.
Good evening, everyone: I'm a very recent lurker of the group, and was hoping someone could point me in the direction of resources for a project I have been asked to undertake... As for my background: I'm fairly proficient in HTML, but scripting and databases are entirely new to me, so the crash course begins. One of my clients has asked me to assist in building a support site where her clients can post information by completing online forms. The support site is for a group faced with certain medical conditions relating to military service overseas. Due to the medical information, she would prefer to avoid disclosing e-mail addresses from her visitors, and would rather build a form for visitors to complete, then the information be sent to the original poster via e-mail. The visitor would have the option of disclosing their e-mail address, etc. On top of this, she needs the ability to run queries on the database in order to generate e-mails based on the options checked or the posting dates. Can anyone please point me in the direction of great (relatively easy-to-understand) references that will assist me in completing this task? She's asked if this can be built in a period of two-months, so I need to get started on this immediately. Thank you in advance for any assistance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Calling core devs for a quick brief on Admin Routing in 1.2
Mmmm.. quick enough! fixed in r5672 by phpnut! Thanks heaps! Seb. On Sep 20, 11:28 am, Seb <[EMAIL PROTECTED]> wrote: > Right on! Cake is getting sweeter every day! :) > > Would it help for me to raise a TRAC ticket or is it all under > control? > > Thanks Chris! > > Seb. > > On Sep 19, 10:45 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > On 9/19/07,Seb<[EMAIL PROTECTED]> wrote: > > > > The error is; You are seeing this error because the private class > > > method admin_index should not be accessed directly. > > > and it happens the second we add function admin_index() {} to the > > > AppController. > > > Turns out that a recent commit inadvertently added in a bug that has > > declared all functions in app_controller.php to be considered private. > > I understand that a correction is on the way. > > > -- > > Chris Hartjes > > Senior Developer > > Cake Development Corporation > > > My motto for 2007: "Just build it, damnit!" > > > @TheBallpark -http://www.littlehart.net/attheballpark > > @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: Calling core devs for a quick brief on Admin Routing in 1.2
Right on! Cake is getting sweeter every day! :) Would it help for me to raise a TRAC ticket or is it all under control? Thanks Chris! Seb. On Sep 19, 10:45 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 9/19/07,Seb<[EMAIL PROTECTED]> wrote: > > > > > The error is; You are seeing this error because the private class > > method admin_index should not be accessed directly. > > and it happens the second we add function admin_index() {} to the > > AppController. > > Turns out that a recent commit inadvertently added in a bug that has > declared all functions in app_controller.php to be considered private. > I understand that a correction is on the way. > > -- > Chris Hartjes > Senior Developer > Cake Development Corporation > > My motto for 2007: "Just build it, damnit!" > > @TheBallpark -http://www.littlehart.net/attheballpark > @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->input() syntax for associations not following Cake conventions
On 9/19/07, Martin Schapendonk <[EMAIL PROTECTED]> wrote: > > 2007/9/18, Chris Hartjes <[EMAIL PROTECTED]>: > > > How should I change the call to $form->input() to show a select-list? > > > The list with audiences is available to the view in variable > > > $audiences. > > > > Try this code using 1.2.x.x > > > > $form->input('ade_id', array('values' => $audiences)); > > Thanks for pointing me in the right direction. > > It was array('options'=>$audiences) instead of values, but I found it. > Really? I just did one with $form->input('fieldname', array('values' => $array)) and it worked just fine. Interesting... -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @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 -~--~~~~--~~--~--~---
Individual Radio Buttons in CakePHP 1.2
What if I only want to create one individual radio button? In CakePHP 1.2, $form->radio creates a set of radio widgets. In my case I have 8 radio buttons spread out through a results table that you can only select one. The 'in between text' doesn't cut it. - I will create these radio buttons by hand unless there is a handy way to create an individual radio button instead of a radio group. Thanks for your help on this, ~Marc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: "a divine intervention" (or a Cake variables mess-up?)
wow! never thought of something like that. I have replaced all relative paths with $html & $javascript helpers. It works now. Except sometimes favicon comes back again - and I don't know how to actually use any helper to have included. Thanks alot Grant, anyhow, I was about to go ku-ku on this one. d On 9/20/07, Grant Cox <[EMAIL PROTECTED]> wrote: > > > Your action is creating a file for every request made to that action. > > 1.thtml -> because you requested /test/test/1 > css.thtml -> because your browser is requesting /test/test/css > (probably /test/test/css/cake.default.css or similar) > js.thtml -> because your browser is requesting /test/test/js > favicon.ico.thtml -> because your browser is requesting /test/test/ > favicon.ico > > I don't know why for some request you get the css and js, and some > just the favicon. Check the generated source, it should be pretty > obvious. However, the problem is just that I doubt any of these last > three are what you are expecting - the reason your browser is making > those requests is because you have relative links in your html > source. When your browser views a page at /test/test/1 , and this > links to "css/something.css", then the browser requests /test/test/css/ > something.css . > > So basically, just don't use relative links to your js / css / > favicon. > > > On Sep 20, 6:57 am, "Danijel Kurinčič" <[EMAIL PROTECTED]> > wrote: > > THIS CODE: > > > > class TestController extends AppController { > > var $name = 'Test'; > > > > function test($a=null, $b=null){ > > $path_to_rendered='C:\appname\app\views\novice/'.$a.'.thtml'; > > file_put_contents($path_to_rendered, 'test'); > > $this->render('test'); > > > > } > > > > } > > > > on the url 'http://localhost/appname/test/test/1/1' > > PRODUCES THREE FILES in the folder specified: > > - file 1.thtml > > - file css.thtml > > - and file js.thtml > > it on the other hand produces TWO files if I pass only ' > http://localhost/appname/test/test/1', > > named 1.thtml, and favicon.ico.thtml. > > > > Now someone tell me, this is not a "divine intervention". > > > > :( > > > > note that > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Scriptaculous Fade in / out message
When I implemented this it was referred to as the "Fade Anything Technique", and I downloaded a Javascript file from http://www.axentric.com/aside/fat/ . Unfortunately this seems to 404 now (as does anything from that domain), so I have pasted the JS source to http://bin.cakephp.org/view/1853878506 . Basically put that JS in your /webroot/js folder, and include it in your layout. To get a message to highlight and fade like that, just apply the class "fade" to it. To get the session flashes to do this, just add a span with this "fade" class around where the $session- >flash(); is in your layout. On Sep 20, 2:24 am, jwerd <[EMAIL PROTECTED]> wrote: > When I use programs like Wordpress, when I save my document a message > appears at the top and fades to one color then out to the color of the > page. I really want this in my project but I'm not sure how to > implement it with Cake. What am I missing? I know this is super > simple I just can't put my finger on it. > > Thanks in advance :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using cron_dispatcher
Put your DEBUG to 1 in your /app/config/core.php , it should give you the real error message (ie missing controller / action / view). The only differences I had to make to our application for CLI was to avoid authentication - of course there is no session on CLI. On Sep 20, 6:36 am, keymaster <[EMAIL PROTECTED]> wrote: > I've tried replying to this thread regarding invoking cake through a > cron,http://groups.google.com/group/cake-php/browse_thread/thread/ca93998e... > but Google won't let me, so am starting this new thread, while > referencing the older one. > > If anyone else has encountered the following problem, and was > successful in resolving it, I would appreciate the heads up on what > you did. > > As described in the very clear bakery > articlehttp://bakery.cakephp.org/articles/view/calling-controller-actions-fr..., > I took a copy of app/webroot/index.php, modified it to take command > line arguments of controller/action, then placed it in a file called > cron_dispatcher.php in the app/ directory. > > Here is the problem: > > When I invoke the cron_dispatcher.php as follows: > > php cron_dispatcher.php /orders/my_alert > > It invokes cake fine, extracts the parameters fine, but then cake > gives the following error: > > 404 Not found > The requested address /orders/my_alert was not found on this server. > > However, when I invokehttp://mydomain.com/orders/my_alertthrough the > web, it finds the action and it runs as it should. > > Any idea why through the web cake finds the controller/action, but not > when it is invoked through the cron? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
Maybe you could change the bootstrap file and make the array name dynamic of the controller that is being requested ? $modelPaths = array('full path to models', 'second full path to models', 'etc...'); $viewPaths = array('this path to views', 'second full path to views', 'etc...'); $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: "a divine intervention" (or a Cake variables mess-up?)
Your action is creating a file for every request made to that action. 1.thtml -> because you requested /test/test/1 css.thtml -> because your browser is requesting /test/test/css (probably /test/test/css/cake.default.css or similar) js.thtml -> because your browser is requesting /test/test/js favicon.ico.thtml -> because your browser is requesting /test/test/ favicon.ico I don't know why for some request you get the css and js, and some just the favicon. Check the generated source, it should be pretty obvious. However, the problem is just that I doubt any of these last three are what you are expecting - the reason your browser is making those requests is because you have relative links in your html source. When your browser views a page at /test/test/1 , and this links to "css/something.css", then the browser requests /test/test/css/ something.css . So basically, just don't use relative links to your js / css / favicon. On Sep 20, 6:57 am, "Danijel Kurinčič" <[EMAIL PROTECTED]> wrote: > THIS CODE: > > class TestController extends AppController { > var $name = 'Test'; > > function test($a=null, $b=null){ > $path_to_rendered='C:\appname\app\views\novice/'.$a.'.thtml'; > file_put_contents($path_to_rendered, 'test'); > $this->render('test'); > > } > > } > > on the url 'http://localhost/appname/test/test/1/1' > PRODUCES THREE FILES in the folder specified: > - file 1.thtml > - file css.thtml > - and file js.thtml > it on the other hand produces TWO files if I pass only > 'http://localhost/appname/test/test/1', > named 1.thtml, and favicon.ico.thtml. > > Now someone tell me, this is not a "divine intervention". > > :( > > note that --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
On Sep 19, 2007, at 4:23 PM, [EMAIL PROTECTED] wrote: > > i didn't see your post when i posted mine hehe .. i don't know it's a > bit dirty and not logical. My problematic seems easy but it has been > more than 1 month i'm trying to find a real solution to this with > cakephp ;( Did you read the section on plugins? -- John > > On 20 sep, 00:18, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: >> http://manual.cakephp.org/chapter/plugins >> >> On 9/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >>> yep i confirm. but so how ? :( >> >>> On 20 sep, 00:08, Mech7 <[EMAIL PROTECTED]> wrote: But this is not really about the libs and webroot but about selfcontaining modules. >> On Sep 19, 10:34 pm, "John David Anderson (_psychic_)" >> <[EMAIL PROTECTED]> wrote: > On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: >> >> Hi, >> >> I would like to know if there is the same concept that the >> modules of >> the zend framework on cakephp : >> http://framework.zend.com/manual/en/zend.controller.modular.html >> (it's like a way to make multiple sites with only one zend >> framework) >> > Yep: check outhttp://manual.cakephp.org/chapter/installing, under > the "Advanced Setup: Alternative Installation Options". CakePHP > installs allow your libs and webroots to be quite separate (which > includes the ability to share lib folders). >> > -- John >> >> -- >> (the old fart) the advice is free, the lack of crankiness will >> cost you >> >> - its a fine line between a real question and an idiot >> >> http://blog.samdevore.com/archives/2007/03/05/when-open-source- >> bugs-me/ > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
You might also consider encapsulating shared controller logic into components. -- John On Sep 19, 2007, at 4:18 PM, Samuel DeVore wrote: > > http://manual.cakephp.org/chapter/plugins > > On 9/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> yep i confirm. but so how ? :( >> >> On 20 sep, 00:08, Mech7 <[EMAIL PROTECTED]> wrote: >>> But this is not really about the libs and webroot but about >>> selfcontaining modules. >>> >>> On Sep 19, 10:34 pm, "John David Anderson (_psychic_)" >>> >>> <[EMAIL PROTECTED]> wrote: On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: >>> > Hi, >>> > I would like to know if there is the same concept that the > modules of > the zend framework on cakephp : > http://framework.zend.com/manual/en/zend.controller.modular.html > (it's like a way to make multiple sites with only one zend > framework) >>> Yep: check outhttp://manual.cakephp.org/chapter/installing, under the "Advanced Setup: Alternative Installation Options". CakePHP installs allow your libs and webroots to be quite separate (which includes the ability to share lib folders). >>> -- John >> >> >>> >> > > > -- > (the old fart) the advice is free, the lack of crankiness will cost > you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs- > me/ > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
i didn't see your post when i posted mine hehe .. i don't know it's a bit dirty and not logical. My problematic seems easy but it has been more than 1 month i'm trying to find a real solution to this with cakephp ;( On 20 sep, 00:18, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > http://manual.cakephp.org/chapter/plugins > > On 9/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > yep i confirm. but so how ? :( > > > On 20 sep, 00:08, Mech7 <[EMAIL PROTECTED]> wrote: > > > But this is not really about the libs and webroot but about > > > selfcontaining modules. > > > > On Sep 19, 10:34 pm, "John David Anderson (_psychic_)" > > > > <[EMAIL PROTECTED]> wrote: > > > > On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: > > > > > > Hi, > > > > > > I would like to know if there is the same concept that the modules of > > > > > the zend framework on cakephp : > > > > >http://framework.zend.com/manual/en/zend.controller.modular.html > > > > > (it's like a way to make multiple sites with only one zend framework) > > > > > Yep: check outhttp://manual.cakephp.org/chapter/installing, under > > > > the "Advanced Setup: Alternative Installation Options". CakePHP > > > > installs allow your libs and webroots to be quite separate (which > > > > includes the ability to share lib folders). > > > > > -- John > > -- > (the old fart) the advice is free, the lack of crankiness will cost you > > - its a fine line between a real question and an idiot > > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
http://manual.cakephp.org/chapter/plugins On 9/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > yep i confirm. but so how ? :( > > On 20 sep, 00:08, Mech7 <[EMAIL PROTECTED]> wrote: > > But this is not really about the libs and webroot but about > > selfcontaining modules. > > > > On Sep 19, 10:34 pm, "John David Anderson (_psychic_)" > > > > <[EMAIL PROTECTED]> wrote: > > > On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: > > > > > > Hi, > > > > > > I would like to know if there is the same concept that the modules of > > > > the zend framework on cakephp : > > > >http://framework.zend.com/manual/en/zend.controller.modular.html > > > > (it's like a way to make multiple sites with only one zend framework) > > > > > Yep: check outhttp://manual.cakephp.org/chapter/installing, under > > > the "Advanced Setup: Alternative Installation Options". CakePHP > > > installs allow your libs and webroots to be quite separate (which > > > includes the ability to share lib folders). > > > > > -- John > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
yep i confirm. but so how ? :( On 20 sep, 00:08, Mech7 <[EMAIL PROTECTED]> wrote: > But this is not really about the libs and webroot but about > selfcontaining modules. > > On Sep 19, 10:34 pm, "John David Anderson (_psychic_)" > > <[EMAIL PROTECTED]> wrote: > > On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: > > > > Hi, > > > > I would like to know if there is the same concept that the modules of > > > the zend framework on cakephp : > > >http://framework.zend.com/manual/en/zend.controller.modular.html > > > (it's like a way to make multiple sites with only one zend framework) > > > Yep: check outhttp://manual.cakephp.org/chapter/installing, under > > the "Advanced Setup: Alternative Installation Options". CakePHP > > installs allow your libs and webroots to be quite separate (which > > includes the ability to share lib folders). > > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
maybe you should think about trying to package the common controllers as plugins? On 9/19/07, Mech7 <[EMAIL PROTECTED]> wrote: > > But this is not really about the libs and webroot but about > selfcontaining modules. > > On Sep 19, 10:34 pm, "John David Anderson (_psychic_)" > <[EMAIL PROTECTED]> wrote: > > On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: > > > > > > > > > Hi, > > > > > I would like to know if there is the same concept that the modules of > > > the zend framework on cakephp : > > >http://framework.zend.com/manual/en/zend.controller.modular.html > > > (it's like a way to make multiple sites with only one zend framework) > > > > Yep: check outhttp://manual.cakephp.org/chapter/installing, under > > the "Advanced Setup: Alternative Installation Options". CakePHP > > installs allow your libs and webroots to be quite separate (which > > includes the ability to share lib folders). > > > > -- John > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
But this is not really about the libs and webroot but about selfcontaining modules. On Sep 19, 10:34 pm, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I would like to know if there is the same concept that the modules of > > the zend framework on cakephp : > >http://framework.zend.com/manual/en/zend.controller.modular.html > > (it's like a way to make multiple sites with only one zend framework) > > Yep: check outhttp://manual.cakephp.org/chapter/installing, under > the "Advanced Setup: Alternative Installation Options". CakePHP > installs allow your libs and webroots to be quite separate (which > includes the ability to share lib folders). > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
"a divine intervention" (or a Cake variables mess-up?)
THIS CODE: class TestController extends AppController { var $name = 'Test'; function test($a=null, $b=null){ $path_to_rendered='C:\appname\app\views\novice/'.$a.'.thtml'; file_put_contents($path_to_rendered, 'test'); $this->render('test'); } } on the url 'http://localhost/appname/test/test/1/1' PRODUCES THREE FILES in the folder specified: - file 1.thtml - file css.thtml - and file js.thtml it on the other hand produces TWO files if I pass only ' http://localhost/appname/test/test/1', named 1.thtml, and favicon.ico.thtml. Now someone tell me, this is not a "divine intervention". :( note that --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Way to mimic "modules" of zend framework on cakephp ?
Hi, I would like to know if there is the same concept that the modules of the zend framework on cakephp : http://framework.zend.com/manual/en/zend.controller.modular.html (it's like a way to make multiple sites with only one zend framework) thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
1.2 Auth/ACL resume
Well let's go with Cake 1.2, while the Auth component seems to be pretty stable, the ACL one still gives me some troubles! I found several interesting tutorials (cheers guys!) that I'll list for everybody else: - http://realm3.com/articles/setting_up_users_groups_withacl_and_auth_in_cake_1.2.php - http://lemoncake.wordpress.com/2007/07/19/using-authcomponent-and-acl-in-cakephp-12/ - http://lemoncake.wordpress.com/2007/07/19/using-authcomponent-and-acl-in-cakephp-12/ - http://www.ogrn.com/andy/2007/07/10/auth-changes-in-cakephp-12-and-how-to-use-basic-auth/ - http://blog.jails.fr/cakephp/ + read those in the backery http://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x Nevertheless, I don't get why if I set an ACO Users (namely the controller) I stilll should map all its actions. Namely I should put (via command line) "cake acl create aco Users add" - "cake acl create aco Users edit" etc why should I do that if in the aco-aro table I can grant specific rights to every CRUD operation? Or I am wrong? Cheers dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
Erh, it won't work i need to share some controllers too. basicly my wbesite 'll be divided into 2 parts : www.domain.com that contains all the generic things (like /join/, / login/, /user) and www.domain.com/site1 www.domain.com/site2 etc each "site" has his controllers but can access the controllers of www.domain.com (like the controller to know if you're loggued ..etc) On zend framework, with the modules, you have a default module (www.domain.com for me) that contains his own controllers / views/ models/ and you can add as much modules as you want. module1, module2 default controllers views models module1 controllers views models module2 controllers views models default is used when www.domain.com is called module1 is used when www.domain.com/module1 is called module2 is used when www.domain.com/module2 is called Any idea ? thx Max On 19 sep, 22:34, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I would like to know if there is the same concept that the modules of > > the zend framework on cakephp : > >http://framework.zend.com/manual/en/zend.controller.modular.html > > (it's like a way to make multiple sites with only one zend framework) > > Yep: check outhttp://manual.cakephp.org/chapter/installing, under > the "Advanced Setup: Alternative Installation Options". CakePHP > installs allow your libs and webroots to be quite separate (which > includes the ability to share lib folders). > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $form->input() syntax for associations not following Cake conventions
2007/9/18, Chris Hartjes <[EMAIL PROTECTED]>: > > How should I change the call to $form->input() to show a select-list? > > The list with audiences is available to the view in variable > > $audiences. > > Try this code using 1.2.x.x > > $form->input('ade_id', array('values' => $audiences)); Thanks for pointing me in the right direction. It was array('options'=>$audiences) instead of values, but I found it. Martin -- Martin Schapendonk, [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using cron_dispatcher
I've tried replying to this thread regarding invoking cake through a cron, http://groups.google.com/group/cake-php/browse_thread/thread/ca93998efc8ff040/356b65885defec7c?lnk=gst&q=cron_dispatcher&rnum=1# but Google won't let me, so am starting this new thread, while referencing the older one. If anyone else has encountered the following problem, and was successful in resolving it, I would appreciate the heads up on what you did. As described in the very clear bakery article http://bakery.cakephp.org/articles/view/calling-controller-actions-from-cron-and-the-command-line, I took a copy of app/webroot/index.php, modified it to take command line arguments of controller/action, then placed it in a file called cron_dispatcher.php in the app/ directory. Here is the problem: When I invoke the cron_dispatcher.php as follows: php cron_dispatcher.php /orders/my_alert It invokes cake fine, extracts the parameters fine, but then cake gives the following error: 404 Not found The requested address /orders/my_alert was not found on this server. However, when I invoke http://mydomain.com/orders/my_alert through the web, it finds the action and it runs as it should. Any idea why through the web cake finds the controller/action, but not when it is invoked through the cron? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Way to mimic "modules" of zend framework on cakephp ?
On Sep 19, 2007, at 2:12 PM, [EMAIL PROTECTED] wrote: > > Hi, > > I would like to know if there is the same concept that the modules of > the zend framework on cakephp : > http://framework.zend.com/manual/en/zend.controller.modular.html > (it's like a way to make multiple sites with only one zend framework) Yep: check out http://manual.cakephp.org/chapter/installing, under the "Advanced Setup: Alternative Installation Options". CakePHP installs allow your libs and webroots to be quite separate (which includes the ability to share lib folders). -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP Model Association
Ok that works fine, thank you for your effort, i'll just remember in the future that advanced model integrations with preexisting tables will have to be done manually. --Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 Model Association
On 9/19/07, axpen <[EMAIL PROTECTED]> wrote: > > Ok then in that case what is the equivalent of $this->query from model > in the controller class, or do I have to call $model->query or > something > > Thanks for you help It's usually $this->Model->query(...) from the controller if you've added that model to $uses. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @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 Model Association
Ok then in that case what is the equivalent of $this->query from model in the controller class, or do I have to call $model->query or something Thanks for you help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP Model Association
On 9/19/07, axpen <[EMAIL PROTECTED]> wrote: > > Yeah I know about the foreign key thing, but that would still require > that I add an ID field to the description table, which I want to avoid > mucking with zencarts default database structure. No 'id field', no ability to use the built-in association and other nice built-in CakePHP model helper methods. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @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 Model Association
Yeah I know about the foreign key thing, but that would still require that I add an ID field to the description table, which I want to avoid mucking with zencarts default database structure. I would make a belongsToAndHasMany table, but that would seem silly since all the values would be the same number. I guess it won't be possible to do it from the model side, how would one go about doing it from the controller side? Basically here is what I want the $products array to look like from the views side, $products [0] ( [Product] products_id = x ... (product fields) [Manufacturer] ... (manufacturer fields) [Description] I want to get this row with the same ID as the products_id from Product ... (description fields) ) Again, thanks everyone for your help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Edit-form and
Hi Thanks for your answer, I will take a look at this. Hopefully i can solve the problem with the help your hints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 Model Association
On 9/19/07, axpen <[EMAIL PROTECTED]> wrote: > --- > Basically I want to get the description field from into the products > model from the model component. That way I can work with it from the > controller component. Now if you guys know of a standard way this is > supposed to be done and that standard way is through the controller > then that is fine, i'm just trying to follow standards as much as > possible. Associations require keys, so if there is no key there cannot be an association. You can change the field CakePHP expects to be the primary key for a record ('id' by default). Dig around in the manual to find out how to do it. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @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 -~--~~~~--~~--~--~---
CakePHP Model Association
Ok my question is this. How do you associate a record from a table without an ID tie-in. I.E. i'm developing a zencart add-on and basically there is the following map I want to relate; products ( products_id #main ID field ... #other fields ) products_description ( #i've already used $useTable since description isn't plural like cake expects products_id #main ID field is same as products table, hence the no ID tie-in ... #other fields ) --- Basically I want to get the description field from into the products model from the model component. That way I can work with it from the controller component. Now if you guys know of a standard way this is supposed to be done and that standard way is through the controller then that is fine, i'm just trying to follow standards as much as possible. Thank you very much for your time, --Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 related select / combo boxes
I have the same problem and the solution provided in the comments of tutorial didn't work for me, any one can help?! On Sep 13, 9:17 pm, majna <[EMAIL PROTECTED]> wrote: > http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-usi... > > On Sep 13, 4:19 pm, xevian <[EMAIL PROTECTED]> wrote: > > > I'm trying to get 2 relatedselect/ combo boxes to work together. > > What I want to achieve is when a user picks a city from a dropdown > >selectboxthe city areasboxis populated (similar to if you choose a > > stae another dropdown lists the cities that are in the state). I have > > looked at using the devmoz tutorial and cannot get it to work in IE, > > it works fine in firefox. > > > Tutorial that I > > used:http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-usi... > > > I'm using cake 1.1.16.5421 with wamp. > > > Any help with getting this working with IE would be greatly > > appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Multiple Validation Rules Each with a Unique Message
I found out that this functionality is built into 1.2. Thank you Geoff your articles were very helpful. On Sep 17, 9:09 am, fr3nch13 <[EMAIL PROTECTED]> wrote: > Another way to do it is by triggering a method in your model from your > function, like so: > > Controller > class UsersController extends AppController > { > function join() > { > if(empty($this->data)) > { > } > else > { > $this->cleanUpFields(); > // make sure no one has this email address > $count = $this->User->findCount(array('email' => > $this->data['User'] > ['email'])); > if($count) > { > $this->User->invalidate('emailtaken'); > notice the emailtaken > key ### > $this->Session->setFlash('Um... something > happened. Check > below.'); > } > else > { > ... create the user stuff here > } > } > }} > > ?> > The View > > > > $form->labelTag('User/email', 'Email Address');?> > $html->input('User/email', > array('class'=>'text2'));?> > $html->tagErrorMsg('User/email', 'Please enter your > Email Address.');?> > $html->tagErrorMsg('User/emailtaken', 'This email > address already exists.');?> > > > > The $this->Model->invalidate('field'); will trigger the $html->tagErrorMsg() > with the same name as the 'field' given to the > > invalidate() method. > > Hope this helps. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Wierd beforeFilter behavior in app_controller?
On 9/19/07, MikeK <[EMAIL PROTECTED]> wrote: > > I have a beforeFilter in app_controller and in some other controllers, > but have noticed that the beforeFilter in app_controller does NOT run > when the requested controller has it's own beforeFilter. > > I am running the latest Alpha code for 1.2. I saw from another post > the solution of putting a call to parent::beforeFilter() in the > "child" controller, and while this works, my question is WHY? > > I was hoping/expecting that the beforeFilter in app_controller would > always be called first, then the beforeFilter of the requested action > would be invoked. Any explanation is greatly appreciated. Your beforeFilter() in the child replaces the beforeFilter() in app_controller. It's a basic principle of object oriented programming, where you are "overloading" existing methods inherited by the child from the parent. That's why you have to statically call the app_controller beforeFilter() method from child controller. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @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: jQuery form validation based on model validation
On 9/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > The idea has been floated in a couple of threads, but I'm unable to > reply to those threads. Does anyone have a working solution for > automatically applying javascript validation to a form based on the > validation rules defined in the model? Even if this only worked for There was one in Cheesecake-Photoblog but it works only with CakePHP v1.1 and the error messages have to be defined in the model. T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: newbie baffled by requirePost
Why don't you do your checking at the login action, and then write a session if everything checks out? Off the top of my head I think it's $this -> Session -> write('User', $user['User']); For more information on sessions check out: http://justkez.com/understanding-cakephp-sessions/ Goodluck man. On Sep 19, 11:04 am, bill2520 <[EMAIL PROTECTED]> wrote: > I am trying to follow the CakePHP Manual and use requireAuth and > requirePost. > > I have a Login page consisting of login.thtml template and a login() > action located in users_controller.php. > > When the user submits the login form and login() determines that the > submission is valid, I want to redirect to an Index page. > > To do this I need to call,the index() action and provide it with the > data it needs by POST. It needs the authentication key of course and > I also want to pass $user_id. > > I have NO idea how to do this. The only reasonable way to POST data > is by a form. But I don't have a form. I'm in the middle of the > login() php action. How am I supposed to be doing this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email solution for cake 1.1
There is no - http://bakery.cakephp.org/ - search for 'mail' and take your pick. Swiftmailer component is a preferred one Cheers T On 9/19/07, hondya <[EMAIL PROTECTED]> wrote: > > I am using cake 1.1 (since it is the stable release) and would like to > know which is the best email (SMTP emailer) solution for this release. > I see several articles on the wiki page and am confused which one > should I use. Also I don't want anything fancy (no HTML, no > attachments). > Thanks to all you folks. > > - Vishal > > > > > -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Email solution for cake 1.1
I am using cake 1.1 (since it is the stable release) and would like to know which is the best email (SMTP emailer) solution for this release. I see several articles on the wiki page and am confused which one should I use. Also I don't want anything fancy (no HTML, no attachments). Thanks to all you folks. - Vishal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Edit-form and
this is a shot in the dark but i think this is happening because you are running using $this->cleanUpFields(); in your controller. I'm not sure of a plausible work around and by all means do not get rid of data sanitation, just try that without that to see if that fixes your solution. Then point yourself in the Data Sanitation section or the manual to see if you can override some of the fields but protect others. On Sep 19, 9:59 am, JuergenE <[EMAIL PROTECTED]> wrote: > Hi group > > I have used the search, but could not find a hint to my problem. > I have a standard-edit-form (created with the bake.php-script). This > form is populated with the standard-functions (I didn´t change > anything). When saving the forms, some characters of the formdata are > turned into their html-entities (like "&" -> &). > This does only occur with textfields, not with textareas. > > Can anybody help me, because with every edit the "&" is > "extended" (&) > Thanks in advance > Juergen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
newbie baffled by requirePost
I am trying to follow the CakePHP Manual and use requireAuth and requirePost. I have a Login page consisting of login.thtml template and a login() action located in users_controller.php. When the user submits the login form and login() determines that the submission is valid, I want to redirect to an Index page. To do this I need to call,the index() action and provide it with the data it needs by POST. It needs the authentication key of course and I also want to pass $user_id. I have NO idea how to do this. The only reasonable way to POST data is by a form. But I don't have a form. I'm in the middle of the login() php action. How am I supposed to be doing this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Scriptaculous Fade in / out message
When I use programs like Wordpress, when I save my document a message appears at the top and fades to one color then out to the color of the page. I really want this in my project but I'm not sure how to implement it with Cake. What am I missing? I know this is super simple I just can't put my finger on it. Thanks in advance :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: log php error messages
It's pretty stand to have multiple log levels: DEBUG, INFO, WARN, ERROR AND FATAL. You definitely want to log ERROR and FATAL messages in production environment. WARN and INFO level messages might be optional. You should only log DEBUG level messages in dev or test environment. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Wierd beforeFilter behavior in app_controller?
I have a beforeFilter in app_controller and in some other controllers, but have noticed that the beforeFilter in app_controller does NOT run when the requested controller has it's own beforeFilter. I am running the latest Alpha code for 1.2. I saw from another post the solution of putting a call to parent::beforeFilter() in the "child" controller, and while this works, my question is WHY? I was hoping/expecting that the beforeFilter in app_controller would always be called first, then the beforeFilter of the requested action would be invoked. Any explanation is greatly appreciated. Bake ON! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
PHP session doesn't work outside controller...why?
Hi again. Anyone had this thing? I use PHP sessions and in login() action, when user is authenticated i set: $_SESSION['login']=$this->data['User']['login'] Under this line i use: var_dump($_SESSION) to check if the variable was set. And it is. The problem is, it doesn't exist outside the users controller... in layout I try to var_dump($_SESSION) and it doesn't seem to have set 'login' ... what's the matter? thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Edit-form and
Hi group I have used the search, but could not find a hint to my problem. I have a standard-edit-form (created with the bake.php-script). This form is populated with the standard-functions (I didn´t change anything). When saving the forms, some characters of the formdata are turned into their html-entities (like "&" -> &). This does only occur with textfields, not with textareas. Can anybody help me, because with every edit the "&" is "extended" (&) Thanks in advance Juergen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 Live Broadcast: Be There Or Be Square
awesome :) few ideas to get more interesting: - invite someone from IBM to speak about cakephp since there are those tutorials (which I haven't checked out). Lets have an insight from the view of an application development HOW cake is useful. - the first info the user searches is documentation. A podcast on how to use different sources for a user could be REALLY useful. Tell about manual, api, groups, irc, trac, bin, etc. - have shows not longer than 5-10 mins and get prepared beforehand. people get bored fast. - Shows should be cathegorized: security show, caching show, MVC, ACL, DB, 10 recipes for the fresh bakers. - invite outisders - case studies: "how 'John' made the dating page in x hours". On 19 sep., 16:30, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > I agree. This is great! > > On Sep 19, 7:18 am, tracyfloyd <[EMAIL PROTECTED]> wrote: > > > Awesome! I was thinking just the other day how great a CakePHP podcast > > would be... heading over to subscribe now! > > > On Sep 19, 1:51 am, John David Anderson <[EMAIL PROTECTED]> > > wrote: > > > > On Sep 18, 2007, at 8:51 PM, rtconner wrote: > > > > > Can I be there AND be a square? > > > > No. By being there, you are (by defintion) cool. > > > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Associations and TreeBehaviour
On Sep 19, 4:06 pm, guigouz <[EMAIL PROTECTED]> wrote: > Hi, > I'm playing with the tree behaviour and trying to attach a tree to > another Model. For example, a Post has many Comments, where Comments > is a tree. > When I fetch the Comments with findAllThreaded() the tree comes > fine.. is there any way to attach this to the association ? I'd recommend having a post_id in each comment and define in your Post hasMany Comment association order by lft ASC. Using the tree behavior and findAllThreaded together shouldn't really be necessary. There is a tree helper I wrote floating around (you can get an older version of it from the tree demo source in the noswad cakeforge project) that you can then use to generate your nested output. hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Blank page after form submitting
This is a long shot, but I ran into a similar problem ages ago - and in the end it was down to whitespace at the end of some php file - after the closing ?> tag - which was then output directly, so normal rendering did not occur. Check all non-view files for leading/trailing whitespace! On Sep 19, 3:37 pm, Anna P <[EMAIL PROTECTED]> wrote: > That's what I thought. Oh, and I made a mistake, I use $this->render() > and the end of the code in controller:-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: disable POST from another site
isn't security component requirePost() used for that? http://manual.cakephp.org/chapter/security On Sep 18, 9:32 am, Sergei <[EMAIL PROTECTED]> wrote: > Yes, I forgot about it. > > On 18 сент, 12:48, McFadly <[EMAIL PROTECTED]> wrote: > > > Sergi - > > check out the Request Handler : --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AJAX InPlaceEditor with collection?
maybe try this: editor('edit', '/cars/ajax_update/' . $car['Car'] ['id'], array('update' => 'edit', 'type' => 'synchronous', 'collection' => array('1'=>'Ferrari', '2'=>'Lamborghini'))); ?> where you define the keys in your collection array. not tested but it may work for you. On Sep 19, 9:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm using an AJAX in-place-editor inside my project; it's the standard > one provided by Cake and Scriptacolous; I have a problem: I have to > use a collection of elements inside a SelectBox. Here's the code: > > td> > editor('edit', '/cars/ajax_update/' . $car['Car'] > ['id'], array('update' => 'edit', 'type' => 'synchronous', > 'collection' => array('Ferrari', 'Lamborghini'))); ?> > > Where I have the "array('Ferrari','Lamborghini')" I need to have the > value associated with the ID, not only the value; I looked @ > Scriptacolous Wiki and it says that the collection should be like > this: > > [[1, Ferrari], [2, Lamborghini]] > > but how can I do this in Cake? > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake (and Bake) error in cake/libs/model/dbo/dbo_mysql.php in function describe
Right. After more searching I found the problem, and it's not part of cake or bake, or even the mysql. But instead a problem with PHP version 4.3.10 with mysql version 5.0.22, this combination breaks the mysql_fetch_field() function because results include a value of 'table' that contains the name of the field, and not the table. My two earlier work-arounds don't cover the problem, and there's not a non-drastic way of passing table information down to the mysql level without drastic modifications of code. Our hosting provider will be upgrading our php in the near term, and luckily our server allows us to use php5 as cgi, and I've started using it for my cake installation... so far so good. Jeff On 9/18/07, Jeff Brown <[EMAIL PROTECTED]> wrote: > > Hi again, > > I hadn't mentioned before but my change was done in file: > /* SVN FILE: $Id: dbo_mysql.php 5612 2007-08-30 01:49:55Z phpnut $ */ > > Anyway, another problem I discovered, trying to move my database into cake > with bake, As I'd mentioned earlier, it was strange that bake wasn't quite > working right. > > So I found that bake wasn't getting the names from the model. But then it > doesn't really use the model then > > bake.php:430 -> $modelFields = $db->describe($tempModel); > > Probably the right fix would be to modify $db->describe() to add the > 'name' field to the array even though it's already indexed by name. This > would probably need to be done (or checked) in all the dbo files, but I only > have mysql handy, so that's all you get. > > as in: > > (from my previous fix, just inside the end of the if block I proposed, add > the following: > > 192 /* > 193 ** to make name of column available > 194 */ > 195 $column[0]['Field'] = > $column['COLUMN_NAME']['Field']; > > > > Then we need that value shoved into the $fields array, (happens right > after the if block closes 197 if you're following along. I placed last > in the construction of the fields array. > > 202 /* > 203 ** jefkin, adding the name > value... > 204 */ > 205 'name' => > $column[0]['Field'] > > > > So that make the name go through. > > Jeff > > On 9/18/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > > > Hi group. > > > > New to cake, but I like the concept, installed, and tried bake.php on > > a table in a database, it kept giving me very strange results. > > > > Finally I just went with it to see if I could get things working. > > > > after some other configuration issues, I pointed at my 'questions' > > table page. http://myserver/questions/ > > > > I received a whole slew of errors, like 'undefined index 'Type'... in > > cake/libs/model/dbo/dbo_mysql.php > > also an error for 'Null', 'Default', (each multiple times) and one > > time for 'Key'. for each column in the table. > > > > So being a decent debuger, I printed out the data in the database. > > > > mysql> describe questions; > > +-+-+--+-+-++ > > | Field | Type| Null | Key | Default | Extra | > > +-+-+--+-+-++ > > | id | int(11) | NO | PRI | NULL| auto_increment | > > | desc_id | int(11) | NO | MUL | 0 || > > +-+-+--+-+-++ > > > > database: mysql 5.0.22 > > > > so as I said, I'm used to debuging, I printed out what the cake file > > was seeing: > > > > describe `questions` > > > > Array > > ( > > [0] => Array > > ( > > [COLUMN_NAME] => Array > > ( > > [Field] => id > > ) > > > > [COLUMN_TYPE] => Array > > ( > > [Type] => int(11) > > ) > > > > [IS_NULLABLE] => Array > > ( > > [Null] => NO > > ) > > > > [COLUMN_KEY] => Array > > ( > > [Key] => PRI > > ) > > > > [COLUMN_DEFAULT] => Array > > ( > > [Default] => > > ) > > > > [EXTRA] => Array > > ( > > [Extra] => auto_increment > > ) > > > > ) > > > > [1] => Array > > ( > > [COLUMN_NAME] => Array > > ( > > [Field] => desc_id > > ) > > > > [COLUMN_TYPE] => Array > > ( > > [Type] => int(11) > > ) > > > > [IS_NULLABLE] => Array > > ( > > [
Re: Blank page after form submitting
That's what I thought. Oh, and I made a mistake, I use $this->render() and the end of the code in controller:-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 Live Broadcast: Be There Or Be Square
I agree. This is great! On Sep 19, 7:18 am, tracyfloyd <[EMAIL PROTECTED]> wrote: > Awesome! I was thinking just the other day how great a CakePHP podcast > would be... heading over to subscribe now! > > On Sep 19, 1:51 am, John David Anderson <[EMAIL PROTECTED]> > wrote: > > > On Sep 18, 2007, at 8:51 PM, rtconner wrote: > > > > Can I be there AND be a square? > > > No. By being there, you are (by defintion) cool. > > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Associations and TreeBehaviour
Hi, I'm playing with the tree behaviour and trying to attach a tree to another Model. For example, a Post has many Comments, where Comments is a tree. When I fetch the Comments with findAllThreaded() the tree comes fine.. is there any way to attach this to the association ? Thanks gui --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AJAX InPlaceEditor with collection?
Hi all, I'm using an AJAX in-place-editor inside my project; it's the standard one provided by Cake and Scriptacolous; I have a problem: I have to use a collection of elements inside a SelectBox. Here's the code: editor('edit', '/cars/ajax_update/' . $car['Car'] ['id'], array('update' => 'edit', 'type' => 'synchronous', 'collection' => array('Ferrari', 'Lamborghini'))); ?> Where I have the "array('Ferrari','Lamborghini')" I need to have the value associated with the ID, not only the value; I looked @ Scriptacolous Wiki and it says that the collection should be like this: [[1, Ferrari], [2, Lamborghini]] but how can I do this in Cake? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $html->file drops off the face of the planet
is your form set to handle multipart data? cake 1.1 cake 1.2 create('ModelName', array('type'=>'file'));?> Sam D On 9/18/07, 2dee <[EMAIL PROTECTED]> wrote: > > Version 1.1.17.5612 > > I baked the MCVs for my "Bios" model with bake. I am using a varchar > 200 field to store the url to the image (image_url) so cake spits out > an $html->input for the image_url field. I have a component handling > file sanitization and upload before save. Basically, all I do is > change the $html->input to $html->file and then pass the resulting > array off to the component. This works perfectly fine for another > model I have, but I cannot for the life of me get this to work on my > bios model. The file field does not show up in the data array as it > does in my other model, but it shows up again when switched back to a > standard input field. > > I have played around for a while and I just can't figure it out as my > controllers and views are quite similar across the 2 different > models. Any ideas? > > file('Bio/image_url');?> > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Calling core devs for a quick brief on Admin Routing in 1.2
On 9/19/07, Seb <[EMAIL PROTECTED]> wrote: > > The error is; You are seeing this error because the private class > method admin_index should not be accessed directly. > and it happens the second we add function admin_index() {} to the > AppController. Turns out that a recent commit inadvertently added in a bug that has declared all functions in app_controller.php to be considered private. I understand that a correction is on the way. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @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 Live Broadcast: Be There Or Be Square
Awesome! I was thinking just the other day how great a CakePHP podcast would be... heading over to subscribe now! On Sep 19, 1:51 am, John David Anderson <[EMAIL PROTECTED]> wrote: > On Sep 18, 2007, at 8:51 PM, rtconner wrote: > > > > > Can I be there AND be a square? > > No. By being there, you are (by defintion) cool. > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unexpected behaviour in 'required' validation rule (v 1.2)
thanks grigri. seems to be working fine for me without 'allowEmpty'. but the 'required' rule is still a mystery to me. On Sep 19, 9:40 am, grigri <[EMAIL PROTECTED]> wrote: > I ran into this too - you need to add the 'allowEmpty' attribute too: > > 'email' => array('rule'=>VALID_NOT_EMPTY, 'allowEmpty' => true) > > On Sep 18, 1:51 pm, Farez <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm wondering if I'm doing something wrong here (have searched docs, > > sources and archives and can't find an answer). > > > The 'required' rule seems to be broken as it still reports an error > > even when the field is not empty. The rule I have is: > > > 'email' => array('rule'=>'required') > > > I traced this to this part of the code in Model:invalidFields(): > > > if (method_exists($this, $rule)) { > > $ruleParams[] = array_diff_key($validator, $default); > > $valid = call_user_func_array(array(&$this, $rule), $ruleParams);} > > elseif (method_exists($Validation, $rule)) { > > > $valid = call_user_func_array(array(&$Validation, $rule), > > $ruleParams);} elseif (!is_array($validator['rule'])) { > > > $valid = preg_match($rule, $data[$fieldName]); > > > } > > > where it always lands on the preg_match(...) line in the last > > condition, where it tries to preg_match() $rule which has a value of > > 'required', against the data field. > > > Anyway, I tried using a pattern instead of 'required' and it works, > > like this: > > > 'email' => array('rule'=>VALID_NOT_EMPTY) > > > ... but I'm wondering if the 'required' rule is working in 1.2? > > > Cheers, > > Farez --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Blank page after form submitting
On 9/19/07, Anna P <[EMAIL PROTECTED]> wrote: > > Thank you for answer:) I solved my problem by putting into controller > $this->render();: > > function register() { > $this->render(); > //.code...; > } > > Don't know why it didn't render the page correctly.. That is weird...you normally don't have to use $this->render(). -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @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: Blank page after form submitting
Thank you for answer:) I solved my problem by putting into controller $this->render();: function register() { $this->render(); //.code...; } Don't know why it didn't render the page correctly.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Blank page after form submitting
On 9/19/07, Anna P <[EMAIL PROTECTED]> wrote: > > Hi, as in the topic - when I submit form (customer registration for > example), cake php displays me blank page (without title and any > content at all), although the form action, routes, URL - are good. > My DEBUG is 3. > Anyone please help cause it's driving me crazy:-/ Anna, I would suggest you make sure that your tmp/cache directory is empty. If you did any work with debug set to 0 before, you probably have cached data in there. Also, it would be good if you have access to your web server error logs as it might be spitting something out there as well. Hope that helps. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @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 -~--~~~~--~~--~--~---
Blank page after form submitting
Hi, as in the topic - when I submit form (customer registration for example), cake php displays me blank page (without title and any content at all), although the form action, routes, URL - are good. My DEBUG is 3. Anyone please help cause it's driving me crazy:-/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
jQuery form validation based on model validation
The idea has been floated in a couple of threads, but I'm unable to reply to those threads. Does anyone have a working solution for automatically applying javascript validation to a form based on the validation rules defined in the model? Even if this only worked for the basic validation types that CakePHP and the jQuery plugin have in common, it would be very nice. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 and learning..
I see the most importance when working in Cake (or any php framework) to really understand the MVC idea and the Object oriented methodology of coding. It is very frustrating and for that matter even unreasonable to learn Cake if one doesn't understand principles of OO. I hope your students don't have issues with that. It is very nice to hear, that you are teaching your students php using Cake. On Sep 19, 4:38 am, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On Sep 18, 2007, at 7:57 PM, Gould, Adrian wrote: > > > > > > > Hi everyone > > > Just to let you know I am using CakePHP as a teaching tool this > > semester > > here in Western Australia. > > > I first gave the students some foundation PHP skills, and that > > included > > database operations, but no OOPS at the beginning. > > > Since then they have been doing the IBM tutorials on Cake. > > > I would really like to have a good CakePHP book that took them from > > 1st > > principles on, explaining what is happening along the way. > > Is there a way the manual can meet that need? It's currently being re- > vamped and polished for the 1.2 release. > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Inject PHP code into another PHP file.
i don't understand the question really... you ARE doing this in CakePHP? if you want to include third party php code just put it in vendors dir and use it with vendors() method. On Sep 17, 6:35 pm, Unite <[EMAIL PROTECTED]> wrote: > Thanks a bunch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$html->file drops off the face of the planet
Version 1.1.17.5612 I baked the MCVs for my "Bios" model with bake. I am using a varchar 200 field to store the url to the image (image_url) so cake spits out an $html->input for the image_url field. I have a component handling file sanitization and upload before save. Basically, all I do is change the $html->input to $html->file and then pass the resulting array off to the component. This works perfectly fine for another model I have, but I cannot for the life of me get this to work on my bios model. The file field does not show up in the data array as it does in my other model, but it shows up again when switched back to a standard input field. I have played around for a while and I just can't figure it out as my controllers and views are quite similar across the 2 different models. Any ideas? file('Bio/image_url');?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Where i can find rossoft blog tutorial
Hi to all bakers Where i can find rossoft blog tutorial. i visited the rossoft site but the download link not working anymore can any post the tutorial files "Gz" file with code and tutorial thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unexpected behaviour in 'required' validation rule (v 1.2)
I ran into this too - you need to add the 'allowEmpty' attribute too: 'email' => array('rule'=>VALID_NOT_EMPTY, 'allowEmpty' => true) On Sep 18, 1:51 pm, Farez <[EMAIL PROTECTED]> wrote: > Hi, > > I'm wondering if I'm doing something wrong here (have searched docs, > sources and archives and can't find an answer). > > The 'required' rule seems to be broken as it still reports an error > even when the field is not empty. The rule I have is: > > 'email' => array('rule'=>'required') > > I traced this to this part of the code in Model:invalidFields(): > > if (method_exists($this, $rule)) { > $ruleParams[] = array_diff_key($validator, $default); > $valid = call_user_func_array(array(&$this, $rule), $ruleParams);} > elseif (method_exists($Validation, $rule)) { > > $valid = call_user_func_array(array(&$Validation, $rule), > $ruleParams);} elseif (!is_array($validator['rule'])) { > > $valid = preg_match($rule, $data[$fieldName]); > > } > > where it always lands on the preg_match(...) line in the last > condition, where it tries to preg_match() $rule which has a value of > 'required', against the data field. > > Anyway, I tried using a pattern instead of 'required' and it works, > like this: > > 'email' => array('rule'=>VALID_NOT_EMPTY) > > ... but I'm wondering if the 'required' rule is working in 1.2? > > Cheers, > Farez --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---