Re: Good coding
Hi Federico, > Hi all, I'm working in a helper that has to output lot of JS code. The thing > is that I really dislike coding JS as string (ie "alert('whatever')") > becouse I'm loosing all the code completition that modern IDE's do for me. > So I'm actually doing something like this: > > (inside a helper class) > > function getSomeHtml(){ > $output = ob_get_clean(); > ob_start(); > ?> > > HTML and JS here > > $returnValue = ob_get_clean(); > ob_start(); > echo $output; > return $returnValue; > > } > > But I noticed that most helpers (even Cake core ones) use the other way of > coding (creating JS as a PHP string). So I guess what I'm doing isn't good > at all. Any sugestions? I usually use the string approach. Another idea is to put the HTML and JS code into a separate file which is then loaded from your helper. Maybe that's something you could use? -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
Hi John, > How are we doing? What is the most confusing? What's most needed and > missing? I have a punchlist of my own, but I'm looking for input from > you guys, especially the new ones. A better search function for the cookbook would be nice. -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: exception handling in phpcake
You should use the vendors dir then just use App::import('Vendor', 'YourCustomExceptionClass'); For more information on PHP Exception you can check out: http://www.php.net/exceptions** http://www.devshed.com/c/a/PHP/Error-Handling-in-PHP-Introducing-Exceptions-in-PHP-5/ http://www.w3schools.com/php/php_exception.asp On Tue, Jun 24, 2008 at 7:12 PM, SajjadRaza <[EMAIL PROTECTED]> wrote: > > so if i made the custom exception classes where i have to keep them > and how can i access them > > > On Jun 23, 6:56 pm, leo <[EMAIL PROTECTED]> wrote: > > As Peter Chng says in his blog ( > http://unitstep.net/blog/2008/05/11/cakephp-and-errorexception-handling/ > > ): > > "One thing I'd like to see, however, is a proper exception > > handling model. > > I realize this would require making it PHP 5-only, but in my > > opinion, PHP5 > > adds some sorely-need features, such as the aforementioned > > exception > > handling model and a class/object system more in line with other > > languages." > > > > And Nate ( > http://groups.google.com/group/cake-php/browse_thread/thread/c8e782d0... > > ): > > "As we all know, the next major version of CakePHP will only have > > to > > worry about supporting one PHP version." > > > > The "built in method" if you are using PHP5 is PHP5. > > > > On 23 Juny, 14:51, mbavio <[EMAIL PROTECTED]> wrote: > > > > > CakePHP is not php4, it´s php4 and php5. > > > > > Cheers, > > > mbavio > > > > > On Jun 23, 4:13 am, Marcelius <[EMAIL PROTECTED]> wrote: > > > > > > If you are talking about Exception classes (with try..catch) there > are > > > > none because cake is php4 > > > > > > PHP errors are handled by the debugger class > > > > > > On 23 jun, 06:36, SajjadRaza <[EMAIL PROTECTED]> wrote: > > > > > > > what is the built in mechanism of excetion handling in cakephp > > > > > can we use the custom exception in cake php if yes then please tell > me > > > > > how > > > > > and where i have to keep custom exceptions > > > > > > > thanks > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $loginRedirect in the Auth component does not work?
That's how it's supposed to work. The Auth component just redirects to $loginRedirect when you access the $loginAction directly becouse it doesn't have any where else to go. If you want to redirect somewhere else you can use the auth's or controller's redirect method after a succesfull login. On Tue, Jun 24, 2008 at 8:03 PM, deltawing <[EMAIL PROTECTED]> wrote: > > I tried setting $loginRedirect in the Auth component but it doesn't > seem to work. No matter what I set the variable to, Cake will always > redirect to the last page that I was at prior to logging in. > > Anyone have any ideas on why? > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
I agree with Nate, I've been a cake developer for almost a year and made a few projects with ACL before I get things working. On Tue, Jun 24, 2008 at 3:22 PM, Nate <[EMAIL PROTECTED]> wrote: > > I totally don't get ACL. Like, at all. Who the heck wrote that?? > > On Jun 24, 12:11 pm, John David Anderson <[EMAIL PROTECTED]> > wrote: > > Bakers, > > > > How are we doing? What is the most confusing? What's most needed and > > missing? I have a punchlist of my own, but I'm looking for input from > > you guys, especially the new ones. > > > > Thanks, > > > > John > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Good coding
Hi all, I'm working in a helper that has to output lot of JS code. The thing is that I really dislike coding JS as string (ie "alert('whatever')") becouse I'm loosing all the code completition that modern IDE's do for me. So I'm actually doing something like this: (inside a helper class) function getSomeHtml(){ $output = ob_get_clean(); ob_start(); ?> HTML and JS here http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Multiple checkboxes and inserting descriptions
Thanks; I know how to grab the info from the database, but what I was wondering is if there is an $option like 'after' that works for each checkbox element, rather than the entire checkbox set. On Jun 24, 2:57 pm, francky06l <[EMAIL PROTECTED]> wrote: > Seems just a story of find('all' ..) and set::extract / > set::combine... > > On Jun 24, 11:16 pm, Tad <[EMAIL PROTECTED]> wrote: > > > CakePHP 1.2 RC1, PHP 5.2.5 > > > I'm using 1.2's new multiple checkbox input as follows: > > > echo $form->input('race', array( > > 'type'=>'select', > > 'multiple'=>'checkbox', > > 'options'=>$races, > > 'label'=>false > > )); > > > Currently, $races is populated from a find('list'). If I have the > > descriptions of each race as a field in the database, is there a way > > to coerce Cake to output the description after each checkbox? > > > Alternatively, is it possible to hand-code a multiple select? > > > Thanks, > > Tad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp on MAMP
That was my problem. Turned on hidden files. Found I was missing a .htaccess in the /webroot. Thanks. L.M. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cant't change Columns or View
If you have thtml files you are using a very old version of CakePHP. Time to shift to CakePHP 1.2 RC1 Also try clearing the cache in /tmp to see the effect of your views editing Lastly while developing have the debug level set to 2 HTH Tarique On Wed, Jun 25, 2008 at 3:12 AM, skyrocket777 <[EMAIL PROTECTED]> wrote: > > Hi guys!!! fist of all thanks if you can help me!!! I have just > started discovering CakePhp an find it very nice!!! I decided to > create the Controllers, Models, then the Views interactively, but now > that i have the code done, i have some columns in teh view that i dont > want to be shown on the listing, i erased them but nothing happens. I > removed the colums from the thml files, but nothing Can u help me? > thanks > > > > -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: integration phpbb3 with cake
I think cakephpbb is only for phpBB2 and not phpBB3. http://cakeforge.org/forum/forum.php?thread_id=3616&forum_id=327 Louie On Wed, Jun 25, 2008 at 11:56 AM, Marcos Aruj <[EMAIL PROTECTED]> wrote: > There's a project called cakephpbb that may help you: > http://cakeforge.org/projects/cakephpbb/ > > On Tue, Jun 24, 2008 at 7:50 PM, Alessio <[EMAIL PROTECTED]> wrote: > >> >> I am trying to integrate cake and phpbb3... >> The problem I get is that name of class of Cake are used in the core >> of PhpBB3... >> SO I get error ... Already declareted... USer Cache >> >> So someone was able to integrate? >> >> I am also trying to hash password with alghoritm...it is very hard ... >> Thanks >> >> > > > -- > Marcos Aruj Alvarez > Ingeniero de Software > --- > [EMAIL PROTECTED] > - > > > > -- Louie Miranda ([EMAIL PROTECTED]) http://www.axishift.com Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
I suppose I'm talking about this: http://book.cakephp.org/view/21/a-typical-cakephp-request Just right now I feel it's neither high-level enough nor detailled enough to really help. Adding code examples would be great. Following variables/data throughout the application would help (controller/ action Cakes::buy() is being chosen because...) etc. Explaining Model relationship declarations and where to call them from (why doesn't ModelA->ModelB->find('all') take conditions on the association into account). On 25 Jun 2008, at 09:51, David C. Zentgraf wrote: > Just the vaguest of ideas, but a section on "app flow" would be good > I think. > > Which parts of Cake get called in which order, which files are > minimally relevant to a functioning application, where all the > automagic comes from [1] etc. I think for "traditional" PHP > programmers [2] Cake is a huge opaque blob in the beginning. Example > apps like the blog tutorial are helping somewhat, but you'll still > have to piece together the big picture yourself. > > [1] e.g. relationship between specifying $belongsTo and the > generated SQL > [2] i.e. page starts at the top, includes() are easy to follow, one > instruction after the other, page ends > > Chrs, > Dav > > On 25 Jun 2008, at 01:11, John David Anderson wrote: > >> >> Bakers, >> >> How are we doing? What is the most confusing? What's most needed and >> missing? I have a punchlist of my own, but I'm looking for input from >> you guys, especially the new ones. >> >> Thanks, >> >> John >> >> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
S3 Behavior Integration Help
Hello, I've used this behavior http://bin.cakephp.org/view/517863202 I added the 2 required fields to my database table ('path' and 's3_url') When I try to upload the file, the file does get uploaded, but I get this printed to the screen: string(16)dkaksdfjw8rlaskdwwsampleniore508.mp3" string(103) "https:// my-bucket.s3.amazonaws.com/my-bucket/c1d147asample kasdjlfjasdf239487234682f649674a937508.mp3" (I removed the sha_1 above because ... well I thought I should) Has anyone overcome this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
integration phpbb3 with cake
I am trying to integrate cake and phpbb3... The problem I get is that name of class of Cake are used in the core of PhpBB3... SO I get error ... Already declareted... USer Cache So someone was able to integrate? I am also trying to hash password with alghoritm...it is very hard ... Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Html Helper get wrong!!
thank you Daniel ! thank you Hannibal ! dr. Hannibal Lecter wrote: > Also, be sure to use a dot instead of a slash: > > $form->input('Artist.name'); > > Happy baking! > > On Jun 24, 11:51�am, Daniel Hofstetter <[EMAIL PROTECTED]> wrote: > > Hi, > > > > > i get use the new cake version 1.2.0.7125 RC1, > > > > > i code the Html helper like before: > > > > > input('Artist/name');?> > > > > > but it got html: > > > > > > > > > > could somebody tell me how should i do? > > > > HtmlHelper::input() is deprecated and shouldn't be used anymore. Most > > of it's functionality is now in the FormHelper, > > seehttp://book.cakephp.org/view/182/form > > > > Hope that helps! > > > > -- > > Daniel Hofstetterhttp://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
Just the vaguest of ideas, but a section on "app flow" would be good I think. Which parts of Cake get called in which order, which files are minimally relevant to a functioning application, where all the automagic comes from [1] etc. I think for "traditional" PHP programmers [2] Cake is a huge opaque blob in the beginning. Example apps like the blog tutorial are helping somewhat, but you'll still have to piece together the big picture yourself. [1] e.g. relationship between specifying $belongsTo and the generated SQL [2] i.e. page starts at the top, includes() are easy to follow, one instruction after the other, page ends Chrs, Dav On 25 Jun 2008, at 01:11, John David Anderson wrote: > > Bakers, > > How are we doing? What is the most confusing? What's most needed and > missing? I have a punchlist of my own, but I'm looking for input from > you guys, especially the new ones. > > Thanks, > > John > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake 1.2 RC1 and MySQL 4.0 are not able to delete a record
I would submit a bug on this. I ran across another MySQL 4.1 incompatibility last week and they fixed it. But first update to the latest SVN version, because maybe this has already been fixed. I came across another MySQL 4.1 issue that luckily wasn't causing me any problems, so I didn't dig deeper, so I know there are multiple incompatibilities between the current version of Cake and MySQL 4.x -Aran On Jun 24, 11:56 am, wholewheat <[EMAIL PROTECTED]> wrote: > I am having a problem ever since moving to a sever that is limted to > MySQL 4.0. > Delete no longer works, and after some research in to why, it seems > that MySQL 4.0 does not like a table alias in a DELETE statement. So, > what Cake (1.2 RC1) is generating is: > DELETE `MyTable` FROM `cake_my_table` AS `MyTable` WHERE > `MyTable`.`id` IN (7) > but it only works when simplified down to... > DELETE FROM `cake_my_table` WHERE `id` IN (7) > > Does anyone have a work around that will save me from over-riding > delete (or del) for every model in the application. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems with query functions on production server
On Tue, Jun 24, 2008 at 4:37 PM, Sanfly <[EMAIL PROTECTED]> wrote: > > So i quickly changed the debug mode on my live website to '2' (Silly I > know, but I dont know how to display debug info on one page when the > site is set to '0', if anyone can tell me would appreciate), tried > again, copied the debug info, which didnt show any errors. > > Then when I did the refresh, It appeared that it had worked!! I > checked the database, and indeed it had been updated!!! > > But when I flicked the debug mode back to '0' it no longer works > again aggg. > > Any ideas what is going on here? How can I diagnose the problem if > there isnt one when its in full debug mode? Any time you go from debug '0' to another debug setting, make sure that you delete stuff in APP/tmp before you switch back. The fact that the code works when debug = 2 means that it will work just fine when debug = 0. It's probably crashing because you have cached model and other information in APP/tmp. Always good practice to delete stuff in APP/tmp every time you put a change into production as well. Just my opinion. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: exception handling in phpcake
so if i made the custom exception classes where i have to keep them and how can i access them On Jun 23, 6:56 pm, leo <[EMAIL PROTECTED]> wrote: > As Peter Chng says in his blog > (http://unitstep.net/blog/2008/05/11/cakephp-and-errorexception-handling/ > ): > "One thing I’d like to see, however, is a proper exception > handling model. > I realize this would require making it PHP 5-only, but in my > opinion, PHP5 > adds some sorely-need features, such as the aforementioned > exception > handling model and a class/object system more in line with other > languages." > > And Nate > (http://groups.google.com/group/cake-php/browse_thread/thread/c8e782d0... > ): > "As we all know, the next major version of CakePHP will only have > to > worry about supporting one PHP version." > > The "built in method" if you are using PHP5 is PHP5. > > On 23 Juny, 14:51, mbavio <[EMAIL PROTECTED]> wrote: > > > CakePHP is not php4, it´s php4 and php5. > > > Cheers, > > mbavio > > > On Jun 23, 4:13 am, Marcelius <[EMAIL PROTECTED]> wrote: > > > > If you are talking about Exception classes (with try..catch) there are > > > none because cake is php4 > > > > PHP errors are handled by the debugger class > > > > On 23 jun, 06:36, SajjadRaza <[EMAIL PROTECTED]> wrote: > > > > > what is the built in mechanism of excetion handling in cakephp > > > > can we use the custom exception in cake php if yes then please tell me > > > > how > > > > and where i have to keep custom exceptions > > > > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Table name
Hello I'm new here. I got this problem when I upload my script to web host : Query: SELECT `Language`.`id`, `Language`.`lang`, `Language`.`code` FROM `Langs` AS `Language` WHERE `Language`.`default`='1' LIMIT 1 Warning: SQL Error: 1146: Table 'h53.Langs' doesn't exist in /home/ user/h53/sites/www/cake/libs/model/datasources/dbo_source.php on line 440 Why cake search for table "Langs" ? when actually my table in db is "langs" (All lowercase) ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$loginRedirect in the Auth component does not work?
I tried setting $loginRedirect in the Auth component but it doesn't seem to work. No matter what I set the variable to, Cake will always redirect to the last page that I was at prior to logging in. Anyone have any ideas on why? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cant't change Columns or View
Hi guys!!! fist of all thanks if you can help me!!! I have just started discovering CakePhp an find it very nice!!! I decided to create the Controllers, Models, then the Views interactively, but now that i have the code done, i have some columns in teh view that i dont want to be shown on the listing, i erased them but nothing happens. I removed the colums from the thml files, but nothing Can u help me? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component the most failment of Cakephp
I guess if this Auth->user() looses the user, it's linked to session. What are you security.level in core ? What is your check.agent (do you do lot's of ajax ?). Do you have some other "notices, warnings" before ? On Jun 24, 5:30 am, aranworld <[EMAIL PROTECTED]> wrote: > I'm curious to know why you are routing everything to the > Contents_Controller rather than just put the functionality of the > Contents_Controller into the app_controller? > > I think that one of the frustrations people have with the Auth > component is that when a problem crops up, it can take a lot of > digging around to solve. I don't think this is a critique of the > component, but in the heat of the moment, I think people just get > frustrated when something isn't "just working". > > On Jun 23, 6:45 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > > > On Mon, Jun 23, 2008 at 9:33 PM, Alessio <[EMAIL PROTECTED]> wrote: > > > > Ok thanks Chris... > > > I believe that you have not problems with the component... > > > I wasn't try to be snarky or anything, but I realize it might come > > across that way. I just never run into those problems with Auth that > > people report. Again, I keep things very simple and haven't gone > > wrong with that approach. > > > > Maybe I have found the reason... > > > I believe that it doesn't work when you use a particular route:: > > >// Custom URL route > > > Router::connect('/*', array('controller' => 'contents', 'action' => > > > 'ProcessAllRequest')); > > > > Essentially when in my site the user write something, I redirect all > > > to the Content_Controller... > > > > So When, the user enter in mycontroller by route, the component forces > > > to logout... > > > Why would you do it that way? Is there a requirement that every > > single request has to go through just one controller? It makes no > > sense to me, but I probably don't understand the problem you are > > trying to solve. > > > > Essentially I say to the auth component to allow all request of > > > COntent_controller... > > > But I saw after many hour of debugging that the Auth COmponent is not > > > able to manage this situation... > > > I think (again, just my opinion) you are trying to use Auth for > > something it is not intended to do. You're not necessarily wrong, > > you're just trying to do something that maybe Auth just cannot handle. > > > It might help if you paste some code tohttp://bin.cakephp.orgit > > might be helpful. > > > -- > > Chris Hartjes > > Internet Loudmouth > > Motto for 2008: "Moving from herding elephants to handling snakes..." > > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: user data sanitized automatically?
there is some sanitation that is done by the model when data is saved to a database, it is one of the reasons that conditions were moved from the right side to the left side in the way you can specify them. Now is it perfect, is it going to cover all cases, probably not, that is why the sanitize class is there and why this is a framework not a solution. That being said cake does a lot for you in making sure that you are putting database safe stuff into the database, but there is a lot of crap that people can pull so be careful. Sam D -- (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/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ On Tue, Jun 24, 2008 at 10:05 AM, Perkster <[EMAIL PROTECTED]> wrote: > > Did you ever find the answer to this? I'm still looking... > > On Apr 28, 2:57 pm, "ryanwaggoner.com" <[EMAIL PROTECTED]> > wrote: >> If I'm handling a form submission in a controller, do I need >> tosanitize$this->data or does Cake do that for me? I'm asking because >> if I bake my controllers, Cake is pulling stuff from $this->data and >> doing $this->Model->find() with it. >> >> So my questions are: >> is user data in $this->data sanitized at all? >> are find() parameters sanitized in any way? >> >> Links to the relevant sections of the code would be great. Thanks! > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to set Ajax function call on "onblur" event of an tag
Well you do not need observeField in fact, You could write a javascript block : echo $javascript->codeBlock(); ?> function myfunc() { remoteFunction(array('url' => 'where you want to go', 'with' => 'Element.serialize(\'id_of_obersered_field\')', 'update' => 'divtoupdate')); ?> } blockEnd(); ?> Just associate myfunc to the event .. hth On Jun 24, 9:58 pm, adnangohar <[EMAIL PROTECTED]> wrote: > Thanx alot .. i figured it out earlier ... just > need one more clarification , any idea how to change event on $ajax -> > observerField() ?? > > Regards, > Adnan Gohar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
I would like to see more documentation on the Translate behavior and i18n/l10n in general. How do I localize numbers? How do I set up and make use of routes like www.example.org/eng/posts? How do I switch current locale? What about timezones? On 24 Jun., 18:11, John David Anderson <[EMAIL PROTECTED]> wrote: > Bakers, > > How are we doing? What is the most confusing? What's most needed and > missing? I have a punchlist of my own, but I'm looking for input from > you guys, especially the new ones. > > Thanks, > > John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to get path to the file
Never mind. Found the solution right after I posted (of course :) ). This works: url('/files/logo.swf'); ?> On Jun 24, 3:25 pm, jhicks <[EMAIL PROTECTED]> wrote: > I've got a flashfilethat I want toincludeon all pages of a site so > I'm trying toincludeit in the layout (default.ctp). I need to set > the param value where name = movie and the src value under the embed > tag to the path of the actualswfflashfile. I can't for the life of > me figure out how to do this so that it is always in reference to the > webroot. If I try and just set this value statically it will work for > some directories but not for others. For example my app is located at > > http://localhost/cake/tasks > > I set up a dummy view called template at > > http://localhost/cake/tasks/template > > If I put theswfflashfilein the files folder under webroot (webroot/ > files/logo.swf) and I set the url path statically (to files/logo.swf) > then I can get it to show up on the tasks page, but it won't show up > if I try and go to the template view. (I do also have an index view.) > > Anybody shed some light on what I can do? > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Multiple checkboxes and inserting descriptions
Seems just a story of find('all' ..) and set::extract / set::combine... On Jun 24, 11:16 pm, Tad <[EMAIL PROTECTED]> wrote: > CakePHP 1.2 RC1, PHP 5.2.5 > > I'm using 1.2's new multiple checkbox input as follows: > > echo $form->input('race', array( > 'type'=>'select', > 'multiple'=>'checkbox', > 'options'=>$races, > 'label'=>false > )); > > Currently, $races is populated from a find('list'). If I have the > descriptions of each race as a field in the database, is there a way > to coerce Cake to output the description after each checkbox? > > Alternatively, is it possible to hand-code a multiple select? > > Thanks, > Tad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Importing a helper
I usually do : if(!isset($this->helpers['Time'])) $this->helpers[] = 'Time'; Seems a lot of concern about performances (even if this checked by cake, that avoid the cake checking) .. My 2 (maybe 1) cents.. On Jun 24, 11:13 pm, "Federico Rinaldi" <[EMAIL PROTECTED]> wrote: > It actually works but the Helper's callbacks are not called so is only > viable if you don't need them. > > On Thu, Jun 19, 2008 at 9:48 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > > On Wed, Jun 18, 2008 at 9:15 PM, Turnquist, Jonah <[EMAIL PROTECTED]> > > wrote: > > > > I do not understand I did not give an answer I gave another question, > > > the question mark indicating that. Does the RAM not effect > > > performance? also, it does not matter if the database is slower than > > > the loading of the helper. That does not mean I should not optimize > > > other areas besides the database. Also I do not want the Time helper > > > loaded into all the actions because they are not used there, and that > > > is bad organization, and organization is what cakePHP is about, > > > right? So why not try to be organized. > > > My point was that there are probably other things that are more likely > > to affect the performance of your application than loading the Time > > helper for every action in a controller. > > > And how can you say that "it does not matter if the database is slower > > than the loading of the helper"?!? Of course it matters. How can > > someone who is so concerned about "speed" ignore such a thing as the > > "speed" at which you get data from a database? > > > In the interest of avoiding further douchebaggery, I will agree to > > disagree with you on the topic of premature optimization. Glad that > > Mr. Snook found the answer for you. My solution was missing a step, > > but I have no idea if it was going to work: > > > App::Import('Helper', 'Time'); > > $timeHelper = new TimeHelper(); > > $this->set('timeHelper', $timeHelper); > > > and then in your view you could reference the helper via $timeHelper. > > > Like I said, it *looks* good but no idea if it would work. > > > -- > > Chris Hartjes > > Internet Loudmouth > > Motto for 2008: "Moving from herding elephants to handling snakes..." > > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Multiple checkboxes and inserting descriptions
CakePHP 1.2 RC1, PHP 5.2.5 I'm using 1.2's new multiple checkbox input as follows: echo $form->input('race', array( 'type'=>'select', 'multiple'=>'checkbox', 'options'=>$races, 'label'=>false )); Currently, $races is populated from a find('list'). If I have the descriptions of each race as a field in the database, is there a way to coerce Cake to output the description after each checkbox? Alternatively, is it possible to hand-code a multiple select? Thanks, Tad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems with query functions on production server
Now I have another problem with differences on my production and development servers Im using $ajax->editor to update a field (bg_notes). On my home development server, this works fine regardless of debug mode. On my actual website, it didnt seem to be updating the database (i would make the change, the right value would return in my text area, but when I refresh it would go back to the previous value, and when I checked the database in phpMyAdmin it hadnt been updated) So i quickly changed the debug mode on my live website to '2' (Silly I know, but I dont know how to display debug info on one page when the site is set to '0', if anyone can tell me would appreciate), tried again, copied the debug info, which didnt show any errors. Then when I did the refresh, It appeared that it had worked!! I checked the database, and indeed it had been updated!!! But when I flicked the debug mode back to '0' it no longer works again aggg. Any ideas what is going on here? How can I diagnose the problem if there isnt one when its in full debug mode? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Importing a helper
It actually works but the Helper's callbacks are not called so is only viable if you don't need them. On Thu, Jun 19, 2008 at 9:48 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > On Wed, Jun 18, 2008 at 9:15 PM, Turnquist, Jonah <[EMAIL PROTECTED]> > wrote: > > > > I do not understand I did not give an answer I gave another question, > > the question mark indicating that. Does the RAM not effect > > performance? also, it does not matter if the database is slower than > > the loading of the helper. That does not mean I should not optimize > > other areas besides the database. Also I do not want the Time helper > > loaded into all the actions because they are not used there, and that > > is bad organization, and organization is what cakePHP is about, > > right? So why not try to be organized. > > My point was that there are probably other things that are more likely > to affect the performance of your application than loading the Time > helper for every action in a controller. > > And how can you say that "it does not matter if the database is slower > than the loading of the helper"?!? Of course it matters. How can > someone who is so concerned about "speed" ignore such a thing as the > "speed" at which you get data from a database? > > In the interest of avoiding further douchebaggery, I will agree to > disagree with you on the topic of premature optimization. Glad that > Mr. Snook found the answer for you. My solution was missing a step, > but I have no idea if it was going to work: > > App::Import('Helper', 'Time'); > $timeHelper = new TimeHelper(); > $this->set('timeHelper', $timeHelper); > > and then in your view you could reference the helper via $timeHelper. > > Like I said, it *looks* good but no idea if it would work. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard: http://www.littlehart.net/atthekeyboard > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
I've been going at cake for a bit over one month, and I've developed a love/hate relationship with it. I apologize if this is a rant ... cake documentation is a touchy subject for me, and I believe my experiences may help you. Understanding CakePHP has been an uphill battle the whole way, but it is a wonderful tool with great potential. My biggest problem (by far) with cake is a lack of adequate, up-to-date, advanced documentation. The book is getting better every day, but I'd like something a bit deeper. Specifically, I would like to see a lot more code comments, /everywhere/. Seeing more live examples and tutorials would be helpful, too ... But when I don't grasp a concept, and no API, CookBook, GoogleGroup or random Blog discusses it sufficiently, I am forced to go digging through hundreds to thousands of lines of (mostly) undocumented code to understand it. Don't get me wrong, I enjoy reading code in general, and would /like to/ enjoy reading Cake's core code. I just don't believe I should HAVE to take apart the car to learn how to drive it. It would help things tremendously to be able to read notes from the developers: what they where thinking, what complex code segments do, how the developers intended certain methods to be used, how objects interact with each other, why something was done how it was, etc. Sort of an extension to the API, maybe an order of magnitude bigger :). Documenting at the lowest level would allow you to breed more new experts, giving anyone the chance to fully and easily absorb cake's inner workings (and write knoledgeable tutorials, and contribute back, etc.). Writing tutorials and examples yourselves is fine ... helpful, even ... but for an open source project especially, at this point it's like putting a peephole in a giant black box. Please accept my criticism knowing that I hold you in the highest respect. If I didn't think it were worth it, I wouldn't have responded. Thanks to all the core developers for your hard work on this great project. On Tue, Jun 24, 2008 at 11:39 AM, Mech7 <[EMAIL PROTECTED]> wrote: > > Constraints on the join tables are still not described properly... > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to get path to the file
I've got a flash file that I want to include on all pages of a site so I'm trying to include it in the layout (default.ctp). I need to set the param value where name = movie and the src value under the embed tag to the path of the actual swf flash file. I can't for the life of me figure out how to do this so that it is always in reference to the webroot. If I try and just set this value statically it will work for some directories but not for others. For example my app is located at http://localhost/cake/tasks I set up a dummy view called template at http://localhost/cake/tasks/template If I put the swf flash file in the files folder under webroot (webroot/ files/logo.swf) and I set the url path statically (to files/logo.swf) then I can get it to show up on the tasks page, but it won't show up if I try and go to the template view. (I do also have an index view.) Anybody shed some light on what I can do? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: simple noob problem with database fetching
Hey guys, I actually found a (better) solution by accident. Check this link for anyone else that is interested: http://cakebaker.42dh.com/2008/05/18/new-core-behavior-containable/ On Jun 24, 12:09 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > Yeah I guess I'm going to need to do a lot of thinking about this. > Thanks. And thanks for the link Renan, it actually helped. I now see > there is a 'fields' option in the hasMany field, maybe I could use the > bind() or bindModel() function to temporarily change that setting > before using find(). I'll try it if I end up needing this again. > > On Jun 24, 12:56 am, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> > wrote: > > > Your routes are really a matter of preference and your decision would > > depend on the structure of your site and your plans for the future. > > Think carefully how you want to expand one day and see what's the best > > way to start. > > > On Jun 24, 1:39 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > > > > I actually figured out I don't need to do this. But I am still > > > curious. > > > > Does it make more sense to you guys that a category page would be at > > > > scripts/category/ > > > or > > > /categories/view:scripts/ > > > > ?? > > > And also /entries/index redirects to /categories/scripts which lists > > > all the categories > > > > Note I have one of these for all types of entries: scripts, examples > > > and tutorials > > > > Hmm... maybe I should just use a tree category system and scripts, > > > examples and tutorials could be the top level categories. than in the > > > future I could also add classes, cakephp helpers and etc wow writing > > > really helps me brainstorm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to set Ajax function call on "onblur" event of an tag
Thanx alot .. i figured it out earlier ... just need one more clarification , any idea how to change event on $ajax -> observerField() ?? Regards, Adnan Gohar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A few questions from a new user.
Not quite... The firewalls I am dealing with won't support SOAP, though I am looking at using it for logging into some things from Google, such as their docs and mail components if I use them instead of private designs... But for the remote data sources, most of them are behind a firewall that is lagging badly when it comes to XML-RPC calls... Mainly from the sheer number it is getting, some are getting dropped, or otherwise lost, as well as delayed... Tests have shown that using it have taken 36+ hours for one call to make the round trip, which is why some competitors to the project I am doing ceased using it at all... HTTP requests, require a unit on the inside of the firewall's protected area to first send a request OUT of that protected area, in order for one to be allowed into it, otherwise the incomming request is silently dropped, if it isn't in response to an outgoing request. The firewall will only permit one incomming request following an outgoing request from a unit inside it's protected area... Basically it has to be a one for one exchange... One out for each one comming into the protected area... What I can do is send an email to the remote server, which will then trigger it to check in with the web server, but in all honesty that's more work then just having the remote server "ping" the site server with a http request every so often, such as every 12 hours or so, unless there is a need for it to check in sooner, such as a status change, etc... On Jun 24, 3:01 pm, francky06l <[EMAIL PROTECTED]> wrote: > You could set-up web services (xml / Soap ... ), in order them to make > first call (Am I wrong ?). > They also could just send an http request to you (would be as a > "normal" request), then the job is either to answer or to trigger your > request to them .. > Maybe I do not fully understand the problem, but receiving a request > is not much a problem for cake, issuing some neither .. > Now request that can take up to 24 hours ... hummm => FTP :-) > Again, maybe I do not understand fully the needs/communication > process. > > On Jun 24, 8:44 pm, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > Trick is francky06l, the outside data sources don't always have the > > ability to recieve until they send first... The firewall structure > > they are behind, will only allow them to recieve data from a server > > that they have sent a http stream / post to prior, within a certain > > time window. One of the joys of designing a website that has to > > utilize data from a non-public or semi-public system with a tight > > security net. CURL would be nice if it was a matter where I could > > just 'scrape' a certain webpage that was just data, without formatting > > or an XML / RSS feed, but I am not that lucky... I have XML-RPC on > > one of the nets I have to draw data from, but prior uses of it by > > myself and others have shown it to be fairly unreliable, and quite > > lagged... Requests can take upwards of 24 hours to actually be > > handled, which isn't acceptable for what I am doing... As it is now, > > I have the remote data sources fire off a status request every so > > often, and if everything is good on the site, the website sends back > > an AOK status code, similar to the 200, 404, etc that a standard web > > server sends a browser to tell the status of a page, as well as any > > other data the remote unit might need. > > > On Jun 24, 2:21 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > > I also use a CURL model for this kind of POST / GET. I enhanced the > > > one on the bakery for my needs, and it can be a "base" for the models > > > of this kind. > > > The ideal would be to have a data source, or a "driver" to handle this > > > data in the cake way: "find" / "read" etc ... > > > hth > > > > On Jun 24, 7:01 pm, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > > > Thanks DaveMahon... > > > > > Right now I am using 1.2, and am playing around with it... From what > > > > I have found Cake seems to pickup the post data automatically, so > > > > getting it in, is fairly easy from what I have found, as is cleaning > > > > it... The ACL part I am looking at DarkAuth for what I need, as it > > > > seems to be laid out the same way I sketch things out on paper... The > > > > HTTPSocket, and XML stuff though will definetly be something to look > > > > into, as I will need XML, as well as CSV, down the road abit once I > > > > have the basics up... Now to just figure out the login system... *C* > > > > Wasn't going to allow site-side registrations, but now have to due to > > > > the specs being significantly expanded upon, and having a core site, > > > > that then shares it's logins with numerous sub-sites below it, each on > > > > a seperate sub-domain, with their own ACLs, etc... *C* Sometimes > > > > clients forget you are but one person... *G* > > > > > On Jun 6, 7:23 pm, DaveMahon <[EMAIL PROTECTED]> wrote: > > > > > > Check out the HttpSocket class in 1.2, particularly the post
Re: How to set Ajax function call on "onblur" event of an tag
Use the $javascript->event along with $ajax->remoteFunction. On Jun 24, 10:59 am, adnangohar <[EMAIL PROTECTED]> wrote: > Hi, > > I am using $ajax->ObserverField('mydd',$options) to call ajax from my > page. It works fine but works on the onchange event of my tag > by default. How can i change its behaviour of calling ajax on not on > its onchange event but on its onblur event. > > The code which i am using in my view is: > > > > 1996 > 1997 > 1998 > > > ?php > > $options = array( > 'update' => 'view', > 'with' => 'Form.serializeElements($("myForm").getElements())', > 'url'=> '/people/search', > 'frequency' => 1, > 'loading' => "Element.hide('view');Element.show('loading')", > 'complete' => "Element.hide('loading');Effect.Appear('view')" > ); > > echo $ajax -> observeField('mydd', $options); > ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Concurrency : need your opinion about this piece of code
In this process, there are 2 approaches, quite different . What I think is very frustrating is to fill up a form (can be long), and find out that your time is lost because someone was quicker than you to post. The other approach is to implement a "lock" mechanisms (I know it can be quite complex, mainly if the user shut down the computer etc ..but can be handled), to avoid other people being able to get a record for modifying when someone else can possibly modify it before you do ... A part from this, I did not try your solution, but seems to handle the case, maybe a bit costive thought. Using the security component can avoid people to post after a certain time .. a way to explore ... hth On Jun 24, 4:06 pm, Marc MENDEZ <[EMAIL PROTECTED]> wrote: > Hi, > > I asked a few days ago how to handled concurrency with Cake. Thanks to > some members of this group, examples and time, I have a possible solution. > However, I need your experience to validate this solution. > > I want to warn users when a record they save was modified in the > meanwhile by somebody else. > I add a datetime column in the table called "tst" (I can't use > "modified" column, 'cause the value of this column seems to be updated > before the callback 'beforeSave'... and of course, I use beforeSave > method !). > On the beforeSave(), I start a transaction and lock "for update" the > record. Then I compare the tst value with the value I retrieved. If it's > the same, I go on and update the tst value with the current datetime. If > not, I halt the process with an error. > I must add in my view $form->hidden("model.tst"). > I should do the same kind of process on beforeDelete() > If a deadlock or timeout occurs, I handle these errors somewhere else. > > Any opinion ? A way to improve it ? > > Thanks ! > > function beforeSave() > { > foreach ($this->data as $key=>$value) > { > if (!isset($value['tst'])) > { > continue; > } > $pkValue = $this->id; > $pkCol = $this->primaryKey; > $pkType = $this->getColumnType($this->primaryKey); > $db =& ConnectionManager::getDataSource($this->useDbConfig); > $db->begin($this); > $sql = "SELECT tst FROM " . $this->table . " WHERE " . > $pkCol . " = "; > switch ($pkType) { > case 'integer': // TODO : add other numeric type > break; > default: > $pkValue = "'".$pkValue."'"; > break; > } > > $sql.=$pkValue. " FOR UPDATE"; > $modifiedInDB = $this->query($sql); > if (!count($modifiedInDB)) > { >// Record deleted > $this->WWsetSqlErrMsg("Enregistrement déjà supprimé"); > $db->rollback($this); > return false; > } > if ($modifiedInDB[0][$this->table]['tst'] != $value['tst']) > { > // Record deleted by somebody else > $this->WWsetSqlErrMsg("Enregistrement modifié par un > autre utilisateur"); > $db->rollback($this); > return false; > } > else > { > $this->set('tst',date("Y-m-d G:i:s",strtotime('now'))); > } > } > return true; > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cake 1.2 RC1 and MySQL 4.0 are not able to delete a record
I am having a problem ever since moving to a sever that is limted to MySQL 4.0. Delete no longer works, and after some research in to why, it seems that MySQL 4.0 does not like a table alias in a DELETE statement. So, what Cake (1.2 RC1) is generating is: DELETE `MyTable` FROM `cake_my_table` AS `MyTable` WHERE `MyTable`.`id` IN (7) but it only works when simplified down to... DELETE FROM `cake_my_table` WHERE `id` IN (7) Does anyone have a work around that will save me from over-riding delete (or del) for every model in the application. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Controller obviously not called. Wrong URL in Cake core ?
Hi again there :) No idea ? Anybody ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: An AJAX request made from a timed-out session will throw a 500 error
if your request was redirected to login page then you would get HTML of the login page returned. chances are you are getting 500 error response header by design. This way you can deal with it using "onFailure" callback handler. The problem though is that generic 500 status code is not specific enough so you probably should not assume that the error is always due to session timeout. If you find a way to generate custom headers within Cake's Auth than you can parse it on client side and have more flexibility in error handling Here is what I do with session timeouts - when laoded, each protected page starts JavaScript timer that redirects user to a "session expired" page after certain period of inactivity. This way users never see access protected pages with stale session information. On Jun 23, 9:00 am, James K <[EMAIL PROTECTED]> wrote: > Has anyone else come into this problem? I'm using Cake's Auth > component and the Request Handler to do my login system. Logging in is > done via a standard non-AJAX Cake generated form using the Form > Helper. The user is authenticated and then forwarded to the > application which makes heavy use of AJAX requests. If the user's > session times out, any successive AJAX calls will result in a 500 > error (according to FireBug), and will give the user no feedback (the > loading bar will just sit there forever). > > I suspect it has some issue with cake trying to forward the AJAX > request to the login page (which is a regular page with a non-AJAX > layout). I'd like to handle the situation more gracefully like > forwarding to a page which will spawn a login box, or at the VERY > least throw a "sorry, your session has timed out" message. Is there > any way to catch a session timeout from an AJAX request and handle it > separately via the Auth component? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: simple noob problem with database fetching
Yeah I guess I'm going to need to do a lot of thinking about this. Thanks. And thanks for the link Renan, it actually helped. I now see there is a 'fields' option in the hasMany field, maybe I could use the bind() or bindModel() function to temporarily change that setting before using find(). I'll try it if I end up needing this again. On Jun 24, 12:56 am, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > Your routes are really a matter of preference and your decision would > depend on the structure of your site and your plans for the future. > Think carefully how you want to expand one day and see what's the best > way to start. > > On Jun 24, 1:39 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > > > I actually figured out I don't need to do this. But I am still > > curious. > > > Does it make more sense to you guys that a category page would be at > > > scripts/category/ > > or > > /categories/view:scripts/ > > > ?? > > And also /entries/index redirects to /categories/scripts which lists > > all the categories > > > Note I have one of these for all types of entries: scripts, examples > > and tutorials > > > Hmm... maybe I should just use a tree category system and scripts, > > examples and tutorials could be the top level categories. than in the > > future I could also add classes, cakephp helpers and etc wow writing > > really helps me brainstorm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A few questions from a new user.
You could set-up web services (xml / Soap ... ), in order them to make first call (Am I wrong ?). They also could just send an http request to you (would be as a "normal" request), then the job is either to answer or to trigger your request to them .. Maybe I do not fully understand the problem, but receiving a request is not much a problem for cake, issuing some neither .. Now request that can take up to 24 hours ... hummm => FTP :-) Again, maybe I do not understand fully the needs/communication process. On Jun 24, 8:44 pm, Infinite Knight <[EMAIL PROTECTED]> wrote: > Trick is francky06l, the outside data sources don't always have the > ability to recieve until they send first... The firewall structure > they are behind, will only allow them to recieve data from a server > that they have sent a http stream / post to prior, within a certain > time window. One of the joys of designing a website that has to > utilize data from a non-public or semi-public system with a tight > security net. CURL would be nice if it was a matter where I could > just 'scrape' a certain webpage that was just data, without formatting > or an XML / RSS feed, but I am not that lucky... I have XML-RPC on > one of the nets I have to draw data from, but prior uses of it by > myself and others have shown it to be fairly unreliable, and quite > lagged... Requests can take upwards of 24 hours to actually be > handled, which isn't acceptable for what I am doing... As it is now, > I have the remote data sources fire off a status request every so > often, and if everything is good on the site, the website sends back > an AOK status code, similar to the 200, 404, etc that a standard web > server sends a browser to tell the status of a page, as well as any > other data the remote unit might need. > > On Jun 24, 2:21 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > I also use a CURL model for this kind of POST / GET. I enhanced the > > one on the bakery for my needs, and it can be a "base" for the models > > of this kind. > > The ideal would be to have a data source, or a "driver" to handle this > > data in the cake way: "find" / "read" etc ... > > hth > > > On Jun 24, 7:01 pm, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > > Thanks DaveMahon... > > > > Right now I am using 1.2, and am playing around with it... From what > > > I have found Cake seems to pickup the post data automatically, so > > > getting it in, is fairly easy from what I have found, as is cleaning > > > it... The ACL part I am looking at DarkAuth for what I need, as it > > > seems to be laid out the same way I sketch things out on paper... The > > > HTTPSocket, and XML stuff though will definetly be something to look > > > into, as I will need XML, as well as CSV, down the road abit once I > > > have the basics up... Now to just figure out the login system... *C* > > > Wasn't going to allow site-side registrations, but now have to due to > > > the specs being significantly expanded upon, and having a core site, > > > that then shares it's logins with numerous sub-sites below it, each on > > > a seperate sub-domain, with their own ACLs, etc... *C* Sometimes > > > clients forget you are but one person... *G* > > > > On Jun 6, 7:23 pm, DaveMahon <[EMAIL PROTECTED]> wrote: > > > > > Check out the HttpSocket class in 1.2, particularly the post method, > > > > which will allow you to pull from and push to the remote servers. The > > > > same library also provides easy access to the headers if and when the > > > > remote servers push data. Cake automatically sanitizes form input for > > > > SQL automatically, so you should be covered there. Javascript/HTML > > > > sanitization can be done automatically as well, but this doesn't > > > > happen by default. You usually have to submit an additional parameter > > > > in the relevant function calls and occasionally make use of the > > > > Javascript helper (as in $clean = > > > > JavascriptHelper::escapeScript($dirty) ). For your XML, check out the > > > > XML helper and layout and the XMLNode class. > > > > > If you're looking for security by obscurity, you can always create a > > > > dedicated method in your controller to handle these requests as well. > > > > > Auth and ACL should work for your programatically assigned > > > > permissions, but ACL's are complicated and good tutorials aren't > > > > really out there yet. The coverage in the new manual seems decent. Of > > > > course, although I've read it, I haven't tried working with that > > > > documentation yet. > > > > > If you're working with 1.2, your best resources are the manual and the > > > > API. > > > > > On Jun 3, 4:31 am, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > > > > You are only scratching the surface of what I need, leo... My entire > > > > > app DEPENDS on the outside data it recieves, so if I can't find an > > > > > efficent way to get that into the system to be processed, and results > > > > > returned, as quickly, preferably faster then I presen
Checkbox problem with pquery
Hi All, I am using latest RC realese of Cakephp with latest pquery. it is working fine. However, i am having one problem with it that is I have an form with some input fields and checkboxes as well. Whenever i submit blank form then it give error message it is fine But all of my checkboxes got checked automatically everytime whenever there is an Error. How can i stop checkboxes to get checked ? Please help. It is a bit urgent as i have to show this to the client with in few hours. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Multiple sites - > Single Login
That is why I was thinking of having it look for the original cookie set on login, then connect to the root site's DB, grab the needed row from the Users table for that specific user, then switch back to it's own DB, and set the needed session data there and take the ID from the previously grabbed row, and look up in the app's own Users table for that specific ID, which would give it any extra information it needs, such as credits, post counts, nicknames, etc... I really wish I could post a full workup on what I am doing, but my partners would kill me as they want everything kept hush-hush and discussed in as vauge terms as possible, so the idea doesn't get stolen before we debut it... Doesn't quite make it easy to ask for help when experimenting with a new framework at the same time... *C* On Jun 24, 2:40 pm, francky06l <[EMAIL PROTECTED]> wrote: > Basically you want to share the session. > I have tried something like this (maybe a bit unsecured thought), in > your link you can pass an argument 'sessid:xxx' ..You can get the > value using Session->id(); > > On the different application, in beforeFilter, you can do : > > if(isset($this->params['named']['sessid'])) > { > // we restore the session for the underwriter uploading > $this->Session->id($this->params['named']['sessid']); > $this->Session->activate('/'); > > } > > As I said might a a security issue, you could also check by storing > session in DB and share the DB accross applications > hth > > On Jun 24, 6:53 pm, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > Just curious... This may have been asked before but I missed it in my > > searches... I am designing a multi-site app, where each sub-site is a > > seperate app, but yet part of the larger core... The following layout > > is what I am after, any pointers to such would be helpful... > > >http://www.domain.com(Allusers start / login here) > > > Once logged in, a user will see a menu show up on the right or left, > > depending on the theme they have set in their preferences, that will > > allow them to access the sub-apps, such as: > > >http://sub1.domain.comhttp://sub2.domain.comhttp://sub3.domain.com > > etc... > > > If the user tries to directly access one of the sub-apps, the system > > should re-route them back tohttp://www.domain.comtologin... > > > While at first look this should be simple, (and is, if I were using > > one single DB), but since I am using a DB per sub-app, so I can take > > entire sites / DBs offline periodically for optimization, maintance, > > etc, not to mention keep from having a gigabyte sized DB to work on, I > > need a way to reference data from the core site's DB to user data in > > the sub-app's DB... > > > Right now, I have my cake libraries installed under /home/user/cake, > > and each sub-app is installed as: > > /home/user/public_html/sub1/app > > /home/user/public_html/sub2/app > > /home/user/public_html/sub3/app > > etc... > > > The root site (http://www.domain.com) is installed as: /home/user/ > > public_html/app > > > That part I have running right... So now I just need to share the > > login status... Since all sites use the same basic theme / user > > preferences data, what I am thinking is having Cake reference the root > > site's DB to get the user preference data from the Users table, then > > switching to it's own DB and using the user's ID from the gathered > > preference data to reference a local user table that contains the > > extra items specific to that site... > > > Or is there a better way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A few questions from a new user.
Trick is francky06l, the outside data sources don't always have the ability to recieve until they send first... The firewall structure they are behind, will only allow them to recieve data from a server that they have sent a http stream / post to prior, within a certain time window. One of the joys of designing a website that has to utilize data from a non-public or semi-public system with a tight security net. CURL would be nice if it was a matter where I could just 'scrape' a certain webpage that was just data, without formatting or an XML / RSS feed, but I am not that lucky... I have XML-RPC on one of the nets I have to draw data from, but prior uses of it by myself and others have shown it to be fairly unreliable, and quite lagged... Requests can take upwards of 24 hours to actually be handled, which isn't acceptable for what I am doing... As it is now, I have the remote data sources fire off a status request every so often, and if everything is good on the site, the website sends back an AOK status code, similar to the 200, 404, etc that a standard web server sends a browser to tell the status of a page, as well as any other data the remote unit might need. On Jun 24, 2:21 pm, francky06l <[EMAIL PROTECTED]> wrote: > I also use a CURL model for this kind of POST / GET. I enhanced the > one on the bakery for my needs, and it can be a "base" for the models > of this kind. > The ideal would be to have a data source, or a "driver" to handle this > data in the cake way: "find" / "read" etc ... > hth > > On Jun 24, 7:01 pm, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > Thanks DaveMahon... > > > Right now I am using 1.2, and am playing around with it... From what > > I have found Cake seems to pickup the post data automatically, so > > getting it in, is fairly easy from what I have found, as is cleaning > > it... The ACL part I am looking at DarkAuth for what I need, as it > > seems to be laid out the same way I sketch things out on paper... The > > HTTPSocket, and XML stuff though will definetly be something to look > > into, as I will need XML, as well as CSV, down the road abit once I > > have the basics up... Now to just figure out the login system... *C* > > Wasn't going to allow site-side registrations, but now have to due to > > the specs being significantly expanded upon, and having a core site, > > that then shares it's logins with numerous sub-sites below it, each on > > a seperate sub-domain, with their own ACLs, etc... *C* Sometimes > > clients forget you are but one person... *G* > > > On Jun 6, 7:23 pm, DaveMahon <[EMAIL PROTECTED]> wrote: > > > > Check out the HttpSocket class in 1.2, particularly the post method, > > > which will allow you to pull from and push to the remote servers. The > > > same library also provides easy access to the headers if and when the > > > remote servers push data. Cake automatically sanitizes form input for > > > SQL automatically, so you should be covered there. Javascript/HTML > > > sanitization can be done automatically as well, but this doesn't > > > happen by default. You usually have to submit an additional parameter > > > in the relevant function calls and occasionally make use of the > > > Javascript helper (as in $clean = > > > JavascriptHelper::escapeScript($dirty) ). For your XML, check out the > > > XML helper and layout and the XMLNode class. > > > > If you're looking for security by obscurity, you can always create a > > > dedicated method in your controller to handle these requests as well. > > > > Auth and ACL should work for your programatically assigned > > > permissions, but ACL's are complicated and good tutorials aren't > > > really out there yet. The coverage in the new manual seems decent. Of > > > course, although I've read it, I haven't tried working with that > > > documentation yet. > > > > If you're working with 1.2, your best resources are the manual and the > > > API. > > > > On Jun 3, 4:31 am, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > > > You are only scratching the surface of what I need, leo... My entire > > > > app DEPENDS on the outside data it recieves, so if I can't find an > > > > efficent way to get that into the system to be processed, and results > > > > returned, as quickly, preferably faster then I presently can do, then > > > > there is no point in me using it... I don't want to have to run a > > > > custom framework along side CakePHP... I will either run a variant of > > > > my in-house Shield system, which was built upon the aforementioned > > > > libraries, with specialized classes for sanitizing incoming and > > > > outgoing data, so nothing is ever entered into either the filesystem, > > > > or database / logic side that isn't cleaned first, even if it is > > > > comming from the DB / Filesystem, or I will use Cake... But not > > > > both... Running both is just stupid, as it would be incredibly > > > > redundant... Long story short I am in the process of developing a > > > > platform syste
Re: How to use several languages in cakePHP?
Maybe this one : http://www.cakephpforum.net/index.php?showtopic=179 On Jun 24, 10:03 am, riverside <[EMAIL PROTECTED]> wrote: > OK, guys > > I think most of the people who faced with that problem already are > read above article, but in fact it is so hard to find out complete > solution for friendly URL's problem. > Is there a someone who can post such one? > > On 22 Май, 17:05, leo <[EMAIL PROTECTED]> wrote: > > > Try this it helped me. a > > lot.http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persis... > > > Leo > > > (Apologies if I have made multiple posts here. Usenet is not the most > > modern technology.) > > > On 22 Maig, 08:42, Margarittka <[EMAIL PROTECTED]> wrote: > > > > Hello! > > > I need to write site with support of 3 languages. Differences of parts > > > are only in files with constants. How can i realize this in optimum > > > way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Multiple sites - > Single Login
Basically you want to share the session. I have tried something like this (maybe a bit unsecured thought), in your link you can pass an argument 'sessid:xxx' ..You can get the value using Session->id(); On the different application, in beforeFilter, you can do : if(isset($this->params['named']['sessid'])) { // we restore the session for the underwriter uploading $this->Session->id($this->params['named']['sessid']); $this->Session->activate('/'); } As I said might a a security issue, you could also check by storing session in DB and share the DB accross applications hth On Jun 24, 6:53 pm, Infinite Knight <[EMAIL PROTECTED]> wrote: > Just curious... This may have been asked before but I missed it in my > searches... I am designing a multi-site app, where each sub-site is a > seperate app, but yet part of the larger core... The following layout > is what I am after, any pointers to such would be helpful... > > http://www.domain.com(All users start / login here) > > Once logged in, a user will see a menu show up on the right or left, > depending on the theme they have set in their preferences, that will > allow them to access the sub-apps, such as: > > http://sub1.domain.comhttp://sub2.domain.comhttp://sub3.domain.com > etc... > > If the user tries to directly access one of the sub-apps, the system > should re-route them back tohttp://www.domain.comto login... > > While at first look this should be simple, (and is, if I were using > one single DB), but since I am using a DB per sub-app, so I can take > entire sites / DBs offline periodically for optimization, maintance, > etc, not to mention keep from having a gigabyte sized DB to work on, I > need a way to reference data from the core site's DB to user data in > the sub-app's DB... > > Right now, I have my cake libraries installed under /home/user/cake, > and each sub-app is installed as: > /home/user/public_html/sub1/app > /home/user/public_html/sub2/app > /home/user/public_html/sub3/app > etc... > > The root site (http://www.domain.com) is installed as: /home/user/ > public_html/app > > That part I have running right... So now I just need to share the > login status... Since all sites use the same basic theme / user > preferences data, what I am thinking is having Cake reference the root > site's DB to get the user preference data from the Users table, then > switching to it's own DB and using the user's ID from the gathered > preference data to reference a local user table that contains the > extra items specific to that site... > > Or is there a better way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
Constraints on the join tables are still not described properly... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: self-referencing HABTM relations
Actually I think you might do something like this : in status model var $hasAndBelongsToMany = array('Tostatus' => array('className' => 'Status', 'joinTable' => 'status_links', 'foreignKey' => 'status_id', 'associationForeignKey' => 'to_status_id') ; You could even create a model for your status_link (maybe to store more informations), and use the 'with' parameters of the HABTM. hth On Jun 24, 10:14 am, Bo ozz <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to create a small workflow system, in which I have a table > of available statusses a job can have. Since it is not possible to > switch from certain statusses to another, I'm trying to create some > logic which describes which status can lead to which. > > Therefor, I've made a link table that should enable the self-reference > on status: > > status > - id > - name > > status_link > - status_id > - to_status_id > > The thing is, that I cannot seem to define a HABTM in the status model > for this relation. I also tried it with hasMany, belongsTo and hasOne. > > Any thoughts? > > thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with ajax and javascript
It's working. It was the 'complete', I was not calling the function correctly -> init() instead of imgReplace.init() Thanks! On Jun 24, 1:53 pm, clrockwell <[EMAIL PROTECTED]> wrote: > Thanks for the replay Michael > > I tried the complete with evalScripts set to true and no luck. I also > tried 'success' but that > did not do the trick. I think it has to be in the callbacks, just can > not figure out where. > > Thanks again. > > On Jun 24, 12:50 pm, schneimi <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I think this is because the javascript-code that comes with the ajax > > answer is only inserted but not executed. There is the ajax-Option > > evalScripts, you may try to set that to true. > > > I am not sure with 'complete', if I am not wrong it is executed at the > > end of the ajax-call, but this is yet before the end of the code > > insertion, so the next three thumbs may not already be there on > > execution of 'complete'. > > > If I remember where I had a similar problem, I will let you know. > > > Hope this helps anyway, > > > Michael > > > [EMAIL PROTECTED] schrieb: > > > > Any direction on this is much appreciated, I think I need to somehow > > > use the 'complete' option on the ajax call but I cannot get it to > > > work. > > > > I have an image gallery that displays one big image in the preview > > > pane, and three thumbnails. I use an ajax call to fetch the next > > > three or previous three based on user selection. I also use > > > javascript to load a selected thumbnail into the preview pane > > > onclick. I am not using any inline javascript (no 'onclick'), I add > > > an event listener to each thumbnail. Problem is that when the next > > > three thumbnails are populated via the ajax, the event listeners are > > > not getting added to them. > > > > Is there a way I can force the javascript to add the event listener > > > after the ajax call returns the next three (or previous three)? > > > > Thanks much for any time and direction. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
On Jun 24, 2008, at 12:22 PM, Nate wrote: > > I totally don't get ACL. Like, at all. Who the heck wrote that?? I'd have to agree - the INI stuff is especially bad. -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using pagination helper on a view element
Not sure of this, but I did used it at the beginning of 1.2: $lview= ClassRegistry::getObject('view'); $paginator = $lview->loaded['paginator']; Really not sure that will work.. hth On Jun 24, 11:47 am, bob <[EMAIL PROTECTED]> wrote: > Anyone have an answer to this problem? > > Thanks > > On Apr 7, 7:19 pm, "Juan Luis Baptiste" <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > I'm trying to make a view element and reuse it in various views. The > > element uses the pagination helper, the problem is that the element > > can't see the paginator helper object: > > > : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7] > > > If I add the helper to the "uses" variable of the controller which > > calls the action that includes the element on its view, then the > > helper is found but I get these errors: > > > Warning (2): array_merge() [function.array-merge]: Argument #1 is not > > an array [CORE/cake/libs/view/helpers/paginator.php, line 139] > > > The code of my element is something like the the following: > > > $servers = $this->requestAction('servers/index/'); > > ?> > > > > > > sort('Server Name', 'name');?> > > sort('IP Address', 'ip_address');?> > > > > > > > > > > > > > > > > > > prev('<< Previous ', null, null);?> > > next(' Next >>', null, null);?> > > '.$paginator->counter(); ?> > > div(null,$paginate, array('align' => 'center')); ?> > > > on the view that includes it: > > > echo $this->renderElement('servers'); > > > and the controller action: > > > function index($id = null) { > > $servers = $this->paginate('Server'); > > $this->set(compact('servers')); > > if(isset($this->params['requested'])) { > > return $servers; > > } > > > } > > > So how is the propper way to use the pagination helper on a view element ? > > > Thanks. > > -- > > Juan Luis Baptiste --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
I totally don't get ACL. Like, at all. Who the heck wrote that?? On Jun 24, 12:11 pm, John David Anderson <[EMAIL PROTECTED]> wrote: > Bakers, > > How are we doing? What is the most confusing? What's most needed and > missing? I have a punchlist of my own, but I'm looking for input from > you guys, especially the new ones. > > Thanks, > > John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A few questions from a new user.
I also use a CURL model for this kind of POST / GET. I enhanced the one on the bakery for my needs, and it can be a "base" for the models of this kind. The ideal would be to have a data source, or a "driver" to handle this data in the cake way: "find" / "read" etc ... hth On Jun 24, 7:01 pm, Infinite Knight <[EMAIL PROTECTED]> wrote: > Thanks DaveMahon... > > Right now I am using 1.2, and am playing around with it... From what > I have found Cake seems to pickup the post data automatically, so > getting it in, is fairly easy from what I have found, as is cleaning > it... The ACL part I am looking at DarkAuth for what I need, as it > seems to be laid out the same way I sketch things out on paper... The > HTTPSocket, and XML stuff though will definetly be something to look > into, as I will need XML, as well as CSV, down the road abit once I > have the basics up... Now to just figure out the login system... *C* > Wasn't going to allow site-side registrations, but now have to due to > the specs being significantly expanded upon, and having a core site, > that then shares it's logins with numerous sub-sites below it, each on > a seperate sub-domain, with their own ACLs, etc... *C* Sometimes > clients forget you are but one person... *G* > > On Jun 6, 7:23 pm, DaveMahon <[EMAIL PROTECTED]> wrote: > > > Check out the HttpSocket class in 1.2, particularly the post method, > > which will allow you to pull from and push to the remote servers. The > > same library also provides easy access to the headers if and when the > > remote servers push data. Cake automatically sanitizes form input for > > SQL automatically, so you should be covered there. Javascript/HTML > > sanitization can be done automatically as well, but this doesn't > > happen by default. You usually have to submit an additional parameter > > in the relevant function calls and occasionally make use of the > > Javascript helper (as in $clean = > > JavascriptHelper::escapeScript($dirty) ). For your XML, check out the > > XML helper and layout and the XMLNode class. > > > If you're looking for security by obscurity, you can always create a > > dedicated method in your controller to handle these requests as well. > > > Auth and ACL should work for your programatically assigned > > permissions, but ACL's are complicated and good tutorials aren't > > really out there yet. The coverage in the new manual seems decent. Of > > course, although I've read it, I haven't tried working with that > > documentation yet. > > > If you're working with 1.2, your best resources are the manual and the > > API. > > > On Jun 3, 4:31 am, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > > You are only scratching the surface of what I need, leo... My entire > > > app DEPENDS on the outside data it recieves, so if I can't find an > > > efficent way to get that into the system to be processed, and results > > > returned, as quickly, preferably faster then I presently can do, then > > > there is no point in me using it... I don't want to have to run a > > > custom framework along side CakePHP... I will either run a variant of > > > my in-house Shield system, which was built upon the aforementioned > > > libraries, with specialized classes for sanitizing incoming and > > > outgoing data, so nothing is ever entered into either the filesystem, > > > or database / logic side that isn't cleaned first, even if it is > > > comming from the DB / Filesystem, or I will use Cake... But not > > > both... Running both is just stupid, as it would be incredibly > > > redundant... Long story short I am in the process of developing a > > > platform system that will facilitate data to be aggrated from a number > > > of sources (four different websites), and a number of specialized > > > "servers" and "clients" deployed across a semi-private intranet > > > grid... The system has to support this arrangement with a fairly high > > > throughput, and be able to maintain it... Maximum user load, should > > > everyone possible take advantage of the system numbers well into the > > > millons, and given that each user can utilize as many clients and > > > servers as they desire once they are a member of the system, it has to > > > be able to take a beating and mirror the functions of other systems I > > > have deployed for other businesses... The only reason I am willing to > > > listen to my friend's suggestion to use Cake is that this deployment > > > is a personal project, not a commercial one at the moment, so I have > > > room to play with... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
I love the manual, but as the good doctor said . . . i'd like to see more hands-on code or tutorials for specific things. Kinda like the api but with actual usage code. and thanks wayne for the post jack! read the manual! On Jun 24, 2:01 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 24, 2008 at 12:17 PM, Wayne Madison > > <[EMAIL PROTECTED]> wrote: > > > Hello, > > Thanks for showing no social skills and hijacking a thread! > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
On Tue, Jun 24, 2008 at 12:17 PM, Wayne Madison <[EMAIL PROTECTED]> wrote: > > Hello, Thanks for showing no social skills and hijacking a thread! -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
My personal requests: -- I think there should be more documentation -- or better a tutorial -- on how to add a simple search box integrated in an index display. Actually designing a Search component that can be easily integrated would be fabulous. Someone had added that feature in their "masterbake" console app if I recall, but it was a bit too complicated -- and I stopped using it after 1.2. --I would really like to see a good tutorial or small app on how to use the TreeBehavior (and behaviors in general). Alain dr. Hannibal Lecter wrote: > Hi there, > > as far as I can see, the cookbook has become an excellent tool. Since > I currently don't have internet connection at home, I just scrap the > "all in one" page and take it with me. Indeed , it has helped me many > times. I can see only one flaw, and one only. The cookbook explains > things with isolated examples, more like an extended kind of API > reference. This means that you already have to understand the basic > concepts to understand the examples in the cookbook. > > I believe that we need more "simple blog tutorials", i.e. a step-by- > step guide of creating simple applications, with every little detail > explained. I think this would help the newbs a lot. > > Still, the docs are pretty damn amazing and useful, kudos to everyone > who contributed! > > On Jun 24, 6:11 pm, John David Anderson <[EMAIL PROTECTED]> > wrote: > >> Bakers, >> >> How are we doing? What is the most confusing? What's most needed and >> missing? I have a punchlist of my own, but I'm looking for input from >> you guys, especially the new ones. >> >> Thanks, >> >> John >> > > > > -- Alain Veylit Application developer Claremont Colleges Digital Library The Libraries of the Claremont Colleges Claremont University Consortium 909-621-8013 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with ajax and javascript
Thanks for the replay Michael I tried the complete with evalScripts set to true and no luck. I also tried 'success' but that did not do the trick. I think it has to be in the callbacks, just can not figure out where. Thanks again. On Jun 24, 12:50 pm, schneimi <[EMAIL PROTECTED]> wrote: > Hi, > > I think this is because the javascript-code that comes with the ajax > answer is only inserted but not executed. There is the ajax-Option > evalScripts, you may try to set that to true. > > I am not sure with 'complete', if I am not wrong it is executed at the > end of the ajax-call, but this is yet before the end of the code > insertion, so the next three thumbs may not already be there on > execution of 'complete'. > > If I remember where I had a similar problem, I will let you know. > > Hope this helps anyway, > > Michael > > [EMAIL PROTECTED] schrieb: > > > Any direction on this is much appreciated, I think I need to somehow > > use the 'complete' option on the ajax call but I cannot get it to > > work. > > > I have an image gallery that displays one big image in the preview > > pane, and three thumbnails. I use an ajax call to fetch the next > > three or previous three based on user selection. I also use > > javascript to load a selected thumbnail into the preview pane > > onclick. I am not using any inline javascript (no 'onclick'), I add > > an event listener to each thumbnail. Problem is that when the next > > three thumbnails are populated via the ajax, the event listeners are > > not getting added to them. > > > Is there a way I can force the javascript to add the event listener > > after the ajax call returns the next three (or previous three)? > > > Thanks much for any time and direction. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
Hello, I want to create cakePHP(1.2.0.) Forms to "View", "Add", "Edit", "Delete" a "User". Constraints: 1 (No "Scaffold") 2 (No Deprecated "generateList()") I want the "Add" and "Edit" form to contain: 1) A select option box for "title" based upon the values in the "titles" table showing field values for "Title" saving "title_id" to the "users" table. 2) An input box for first_name 3) An input box for last_name I want the "User" "View" form to show: 1) The "title" selected not the "title_id" 2) The "first_name" value 3) The "last_name" value Table One: "Users" user_id integer primary key auto number title_id integer, first_name varchar(40) last_name varchar(40) Table One: Data Example: user_id titile_id first_name last_name 1 1 bill smith 2 2 jane murphy 3 3 elizabeth baker Table Two: "Titles" title_id: integer primary key autonumber title: varchar(40) Table Two: Data Example: title_id title 1 Mr. 2 Ms. 3 Mrs. Thanks Wayne On Jun 24, 12:11 pm, John David Anderson <[EMAIL PROTECTED]> wrote: > Bakers, > > How are we doing? What is the most confusing? What's most needed and > missing? I have a punchlist of my own, but I'm looking for input from > you guys, especially the new ones. > > Thanks, > > John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: user data sanitized automatically?
Did you ever find the answer to this? I'm still looking... On Apr 28, 2:57 pm, "ryanwaggoner.com" <[EMAIL PROTECTED]> wrote: > If I'm handling a form submission in a controller, do I need > tosanitize$this->data or does Cake do that for me? I'm asking because > if I bake my controllers, Cake is pulling stuff from $this->data and > doing $this->Model->find() with it. > > So my questions are: > is user data in $this->data sanitized at all? > are find() parameters sanitized in any way? > > Links to the relevant sections of the code would be great. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A few questions from a new user.
Thanks DaveMahon... Right now I am using 1.2, and am playing around with it... From what I have found Cake seems to pickup the post data automatically, so getting it in, is fairly easy from what I have found, as is cleaning it... The ACL part I am looking at DarkAuth for what I need, as it seems to be laid out the same way I sketch things out on paper... The HTTPSocket, and XML stuff though will definetly be something to look into, as I will need XML, as well as CSV, down the road abit once I have the basics up... Now to just figure out the login system... *C* Wasn't going to allow site-side registrations, but now have to due to the specs being significantly expanded upon, and having a core site, that then shares it's logins with numerous sub-sites below it, each on a seperate sub-domain, with their own ACLs, etc... *C* Sometimes clients forget you are but one person... *G* On Jun 6, 7:23 pm, DaveMahon <[EMAIL PROTECTED]> wrote: > Check out the HttpSocket class in 1.2, particularly the post method, > which will allow you to pull from and push to the remote servers. The > same library also provides easy access to the headers if and when the > remote servers push data. Cake automatically sanitizes form input for > SQL automatically, so you should be covered there. Javascript/HTML > sanitization can be done automatically as well, but this doesn't > happen by default. You usually have to submit an additional parameter > in the relevant function calls and occasionally make use of the > Javascript helper (as in $clean = > JavascriptHelper::escapeScript($dirty) ). For your XML, check out the > XML helper and layout and the XMLNode class. > > If you're looking for security by obscurity, you can always create a > dedicated method in your controller to handle these requests as well. > > Auth and ACL should work for your programatically assigned > permissions, but ACL's are complicated and good tutorials aren't > really out there yet. The coverage in the new manual seems decent. Of > course, although I've read it, I haven't tried working with that > documentation yet. > > If you're working with 1.2, your best resources are the manual and the > API. > > On Jun 3, 4:31 am, Infinite Knight <[EMAIL PROTECTED]> wrote: > > > You are only scratching the surface of what I need, leo... My entire > > app DEPENDS on the outside data it recieves, so if I can't find an > > efficent way to get that into the system to be processed, and results > > returned, as quickly, preferably faster then I presently can do, then > > there is no point in me using it... I don't want to have to run a > > custom framework along side CakePHP... I will either run a variant of > > my in-house Shield system, which was built upon the aforementioned > > libraries, with specialized classes for sanitizing incoming and > > outgoing data, so nothing is ever entered into either the filesystem, > > or database / logic side that isn't cleaned first, even if it is > > comming from the DB / Filesystem, or I will use Cake... But not > > both... Running both is just stupid, as it would be incredibly > > redundant... Long story short I am in the process of developing a > > platform system that will facilitate data to be aggrated from a number > > of sources (four different websites), and a number of specialized > > "servers" and "clients" deployed across a semi-private intranet > > grid... The system has to support this arrangement with a fairly high > > throughput, and be able to maintain it... Maximum user load, should > > everyone possible take advantage of the system numbers well into the > > millons, and given that each user can utilize as many clients and > > servers as they desire once they are a member of the system, it has to > > be able to take a beating and mirror the functions of other systems I > > have deployed for other businesses... The only reason I am willing to > > listen to my friend's suggestion to use Cake is that this deployment > > is a personal project, not a commercial one at the moment, so I have > > room to play with... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Multiple sites - > Single Login
Just curious... This may have been asked before but I missed it in my searches... I am designing a multi-site app, where each sub-site is a seperate app, but yet part of the larger core... The following layout is what I am after, any pointers to such would be helpful... http://www.domain.com (All users start / login here) Once logged in, a user will see a menu show up on the right or left, depending on the theme they have set in their preferences, that will allow them to access the sub-apps, such as: http://sub1.domain.com http://sub2.domain.com http://sub3.domain.com etc... If the user tries to directly access one of the sub-apps, the system should re-route them back to http://www.domain.com to login... While at first look this should be simple, (and is, if I were using one single DB), but since I am using a DB per sub-app, so I can take entire sites / DBs offline periodically for optimization, maintance, etc, not to mention keep from having a gigabyte sized DB to work on, I need a way to reference data from the core site's DB to user data in the sub-app's DB... Right now, I have my cake libraries installed under /home/user/cake, and each sub-app is installed as: /home/user/public_html/sub1/app /home/user/public_html/sub2/app /home/user/public_html/sub3/app etc... The root site (http://www.domain.com) is installed as: /home/user/ public_html/app That part I have running right... So now I just need to share the login status... Since all sites use the same basic theme / user preferences data, what I am thinking is having Cake reference the root site's DB to get the user preference data from the Users table, then switching to it's own DB and using the user's ID from the gathered preference data to reference a local user table that contains the extra items specific to that site... Or is there a better way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with ajax and javascript
Hi, I think this is because the javascript-code that comes with the ajax answer is only inserted but not executed. There is the ajax-Option evalScripts, you may try to set that to true. I am not sure with 'complete', if I am not wrong it is executed at the end of the ajax-call, but this is yet before the end of the code insertion, so the next three thumbs may not already be there on execution of 'complete'. If I remember where I had a similar problem, I will let you know. Hope this helps anyway, Michael [EMAIL PROTECTED] schrieb: > Any direction on this is much appreciated, I think I need to somehow > use the 'complete' option on the ajax call but I cannot get it to > work. > > I have an image gallery that displays one big image in the preview > pane, and three thumbnails. I use an ajax call to fetch the next > three or previous three based on user selection. I also use > javascript to load a selected thumbnail into the preview pane > onclick. I am not using any inline javascript (no 'onclick'), I add > an event listener to each thumbnail. Problem is that when the next > three thumbnails are populated via the ajax, the event listeners are > not getting added to them. > > Is there a way I can force the javascript to add the event listener > after the ajax call returns the next three (or previous three)? > > Thanks much for any time and direction. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
Hi there, as far as I can see, the cookbook has become an excellent tool. Since I currently don't have internet connection at home, I just scrap the "all in one" page and take it with me. Indeed , it has helped me many times. I can see only one flaw, and one only. The cookbook explains things with isolated examples, more like an extended kind of API reference. This means that you already have to understand the basic concepts to understand the examples in the cookbook. I believe that we need more "simple blog tutorials", i.e. a step-by- step guide of creating simple applications, with every little detail explained. I think this would help the newbs a lot. Still, the docs are pretty damn amazing and useful, kudos to everyone who contributed! On Jun 24, 6:11 pm, John David Anderson <[EMAIL PROTECTED]> wrote: > Bakers, > > How are we doing? What is the most confusing? What's most needed and > missing? I have a punchlist of my own, but I'm looking for input from > you guys, especially the new ones. > > Thanks, > > John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Documentation
2008/6/24 John David Anderson <[EMAIL PROTECTED]>: > > Bakers, > > How are we doing? What is the most confusing? What's most needed and > missing? I have a punchlist of my own, but I'm looking for input from > you guys, especially the new ones. Well, relations seems to be most confusing subject for beginners, specialy HATM. Maybe more exemples? More grafics? Some people miss the mosts simplests conventions. Maybe repeat here and there, just to make sure? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Documentation
Bakers, How are we doing? What is the most confusing? What's most needed and missing? I have a punchlist of my own, but I'm looking for input from you guys, especially the new ones. Thanks, John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Help with ajax and javascript
Any direction on this is much appreciated, I think I need to somehow use the 'complete' option on the ajax call but I cannot get it to work. I have an image gallery that displays one big image in the preview pane, and three thumbnails. I use an ajax call to fetch the next three or previous three based on user selection. I also use javascript to load a selected thumbnail into the preview pane onclick. I am not using any inline javascript (no 'onclick'), I add an event listener to each thumbnail. Problem is that when the next three thumbnails are populated via the ajax, the event listeners are not getting added to them. Is there a way I can force the javascript to add the event listener after the ajax call returns the next three (or previous three)? Thanks much for any time and direction. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Where do I find data before modification ?
callbacks in behaviors take the model as the first argument: function afterFind(&$model, $results, $primary) { ... } On Jun 24, 4:51 pm, Marc MENDEZ <[EMAIL PROTECTED]> wrote: > You're right : that may help you ;> > Here is it :http://bin.cakephp.org/saved/33964 > > francky06l a écrit : > > > Yes, I need the URL of the bin after you posted it :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Where do I find data before modification ?
You're right : that may help you ;> Here is it : http://bin.cakephp.org/saved/33964 francky06l a écrit : > Yes, I need the URL of the bin after you posted it :-) > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Where do I find data before modification ?
Yes, I need the URL of the bin after you posted it :-) On Jun 24, 9:38 am, Marc MENDEZ <[EMAIL PROTECTED]> wrote: > Hi, > > I'm paste the very simple example in the bin (first time, I hope it will > work...) > > Before posting, I tested the code. > > Ask me more if needed. > > francky06l a écrit : > > > Strange since the afterFind in behavior should be called. Maybe you > > have a problem in declaration or syntax ... Can you paste some code in > > the bin ? > > By the way I have implemented a similar behavior that stores the > > "delta" between modifications in a table, for an "historization" and > > eventual rollback. > > > On Jun 23, 2:28 pm, Marc MENDEZ <[EMAIL PROTECTED]> wrote: > > >> To complete my request, I notice that if I use the afterFind method in a > >> Behavior class, I get nothing. However, if I call afterFind in the model > >> class, I get the right data... > > >> So, is there a difference between the two afterFind ? > > >> Marc MENDEZ a écrit : > > >>> Hi, > > >>> I'm working on models and behaviors. > >>> I'm developing a behaviour which will compare the "modified" field value > >>> in the database to its value I got when the record was fetched. > >>> On the "beforeSave" method, I thought the "modified" column was not yet > >>> changed to the current time, but I was wrong. > >>> I tried to get the original value in the afterFind method, but the data > >>> property is empty. > > >>> How can I do ? > > >>> Thanks for your help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
table driven select box example for cakePHP ver 1.2.0.xxxxx
Hello, I want to create cakePHP(1.2.0.) Forms to "View", "Add", "Edit", "Delete" a "User". Constraints: 1 (No "Scaffold") 2 (No Deprecated "generateList()") I want the "Add" and "Edit" form to contain: 1) A select option box for "title" based upon the values in the "titles" table showing field values for "Title" saving "title_id" to the "users" table. 2) An input box for first_name 3) An input box for last_name I want the "User" "View" form to show: 1) The "title" selected not the "title_id" 2) The "first_name" value 3) The "last_name" value Table One: "Users" user_id integer primary key auto number title_id integer, first_name varchar(40) last_name varchar(40) Table One: Data Example: user_id titile_id first_name last_name 1 1 bill smith 2 2 jane murphy 3 3 elizabeth baker Table Two: "Titles" title_id: integer primary key autonumber title: varchar(40) Table Two: Data Example: title_id title 1 Mr. 2 Ms. 3 Mrs. Thanks Wayne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Error using Cron
Hello all, i have an error using Cron and CakePHP...** I have defined a cron_dispatcher.php file in my app/webroot/ (cf. http://www.lost-in-code.com/27/cakephp-crontab/ and http://bakery.cakephp.org/articles/view/calling-controller-actions-from-cron-and-the-command-line) but I have an issue and I don't understand why. My command in my cron file is : /usr/local/bin/php -q /home/lifeorganizers/www/taskmanager/app/webroot/cron_dispatcher.php /tasks/cron/ And i receive an error email from Cron which contains : PHP Fatal error: Cannot redeclare loadmodels() (previously declared in /home/lifeorganizers/www/taskmanager/cake/basics.php:113) in /home/lifeorganizers/www/taskmanager/cake/basics.php on line 142 Fatal error: Cannot redeclare loadmodels() (previously declared in /home/lifeorganizers/www/taskmanager/cake/basics.php:113) in /home/lifeorganizers/www/taskmanager/cake/basics.php on line 142 If someone has an idea, it would be great ?! Thanks for your help. -- *Pierre MARCOURT* *IT Department* *CableOrganizer.com* 5610 NW 12th Ave, suite 214 Fort Lauderdale, FL 33304 Phone: 954-861-6310 Fax: 954-861-2001 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
Very concisely explained. Thank you. Time for me to stop the comparison's with Java, and learn the Cake/PHP way. I'd held off learning PHP in anger until the introduction of better OO support in PHP5. Clearly it helps encapsulate logic and re-use and prevents spaghetti code (scripting). I'd naturally assumed that OO concepts would get taken to the domain-object level, but as you say, this is potentially a needless overhead. Apologies if I sounded derogatory. It's my British sense of humour, I guess. Nothing more. (That, and the desire for my question to gain attention). I didn't go so far as to state that Cake is half-baked; merely asked the question. As you said yourself, it's not typical ORM. I doubt I'll be the last Java developer to venture down the Cake path, and ask similar questions. Thanks again. time for me to fatten up my models! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Concurrency : need your opinion about this piece of code
Hi, I asked a few days ago how to handled concurrency with Cake. Thanks to some members of this group, examples and time, I have a possible solution. However, I need your experience to validate this solution. I want to warn users when a record they save was modified in the meanwhile by somebody else. I add a datetime column in the table called "tst" (I can't use "modified" column, 'cause the value of this column seems to be updated before the callback 'beforeSave'... and of course, I use beforeSave method !). On the beforeSave(), I start a transaction and lock "for update" the record. Then I compare the tst value with the value I retrieved. If it's the same, I go on and update the tst value with the current datetime. If not, I halt the process with an error. I must add in my view $form->hidden("model.tst"). I should do the same kind of process on beforeDelete() If a deadlock or timeout occurs, I handle these errors somewhere else. Any opinion ? A way to improve it ? Thanks ! function beforeSave() { foreach ($this->data as $key=>$value) { if (!isset($value['tst'])) { continue; } $pkValue = $this->id; $pkCol = $this->primaryKey; $pkType = $this->getColumnType($this->primaryKey); $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->begin($this); $sql = "SELECT tst FROM " . $this->table . " WHERE " . $pkCol . " = "; switch ($pkType) { case 'integer': // TODO : add other numeric type break; default: $pkValue = "'".$pkValue."'"; break; } $sql.=$pkValue. " FOR UPDATE"; $modifiedInDB = $this->query($sql); if (!count($modifiedInDB)) { // Record deleted $this->WWsetSqlErrMsg("Enregistrement déjà supprimé"); $db->rollback($this); return false; } if ($modifiedInDB[0][$this->table]['tst'] != $value['tst']) { // Record deleted by somebody else $this->WWsetSqlErrMsg("Enregistrement modifié par un autre utilisateur"); $db->rollback($this); return false; } else { $this->set('tst',date("Y-m-d G:i:s",strtotime('now'))); } } return true; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
On Tue, Jun 24, 2008 at 8:36 AM, Howie <[EMAIL PROTECTED]> wrote: > I guess I'm being a little pendantic about the Model, but then again, > I did lose time trying to understand it, as I's asumed it did much > more than it appears to do. What happens under-the-hood is great, and > keeps the code clean, but it's not ORM as I understand it. Agreed. It's not typical ORM, certainly not when coming from the world of Java. > From my Java OO experience, the real benefits gained from ORM is > mapping relational data back into into an object graph. That's not really the benefit, per se. How do you work with data in Java? Using objects and Java data types, of course. The ORM literally maps the relational to the objectal (and vice versa). However, the benefit is not the mapping part in and of itself. The benefit is in the ability to work with data in a format that's native to the language, and in Java, that's as objects. In PHP, arrays are at the very core of the language, although OO approaches have slowly been seeping their way into the language. What CakePHP has done is take ORM and apply it to the PHP paradigm. What you get is an A/ORM (Array/Object relational mapping -- since CakePHP technically uses both). > If my model is to become thick with business logic, then it should be able > to operate as a class instance. > Can my Toy class encapsulate logic such as: > > if ($this->price < 9.99) then {.. } ? Yes, your Toy model class can—and should—encapsulate that logic. Make that model thick. That logic is normally applied where it matters most: when attempting to push the data from the model back to the database either via the validation phase or via the beforeSave callback (as opposed to getter/setter methods which I'm guessing is what you're thinking). The lifetime of the object is too short-lived to need anything more complicated. The purpose of the A/ORM in CakePHP is to act as a conduit to the database (or whatever the final datasource is). > The examples of Fat model that I've seen all seem statelss with > repsect to the object attributes. PHP is stateless. A user initiates an action and expects a quick response. PHP's (and CakePHP's) job is take the data, validate the data, store the data, and then formulate a response. After that, it's like nothing happened. I don't see any advantage (or disadvantage) to using an ORM in the traditional sense and, to get back to your original point, calling CakePHP's approach "half-baked" comes across as derogatory when ultimately, you have all the facitilities available as you do with traditional ORM. Every example you've shown so far is possible (and designed to be easily done) with CakePHP. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
Thanks Jonathan. I guess I'm being a little pendantic about the Model, but then again, I did lose time trying to understand it, as I's asumed it did much more than it appears to do. What happens under-the-hood is great, and keeps the code clean, but it's not ORM as I understand it. >From my Java OO experience, the real benefits gained from ORM is mapping relational data back into into an object graph. So, my findUser($id) method might return a User with Roles that can be accessed as $user->getRoles() rather than $user['User']['Roles']. In your example, setting an array of name/value pairs is not conceptually) the same as setting class attributes. If my model is to become thick with business logic, then it should be able to operate as a class instance. Can my Toy class encapsulate logic such as: if ($this->price < 9.99) then {.. } ? The examples of Fat model that I've seen all seem statelss with repsect to the object attributes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
> $toy = new Toy(); > $toy.set(array( > 'size' => 'value', > 'price' => 'value', > 'weight' => 'value', > ); > $toy.save(); > > That'll work in CakePHP. How is that conceptually different? I realized my PHP is wrong (hey, this is off the top of my head): $toy = new Toy(); $toy->set(array( 'size' => 'value', 'price' => 'value', 'weight' => 'value', ); $toy->save(); There we go. that should work. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
> No problem. It's not a big deal. It is a bit misleading that the Cake > home page states that it supports ORM tho' :-( I disagree. I think that you are looking for a narrowly defined approach for OR mapping. The approach that you describe is quite similar to how CakePHP does it, even though the syntax is different. For example, toy = new Toy(); toy.size = 'value'; toy.price = 'value'; toy.weight = 'value'; toy.save(); Compared to: $toy = new Toy(); $toy.set(array( 'size' => 'value', 'price' => 'value', 'weight' => 'value', ); $toy.save(); That'll work in CakePHP. How is that conceptually different? More importantly, you need to look at what CakePHP does and how it makes programming web applications easier. The fact is, I almost never create objects and save data in this fashion. The framework automates much of this kind of work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Html Helper get wrong!!
Also, be sure to use a dot instead of a slash: $form->input('Artist.name'); Happy baking! On Jun 24, 11:51 am, Daniel Hofstetter <[EMAIL PROTECTED]> wrote: > Hi, > > > i get use the new cake version 1.2.0.7125 RC1, > > > i code the Html helper like before: > > > input('Artist/name');?> > > > but it got html: > > > > > > could somebody tell me how should i do? > > HtmlHelper::input() is deprecated and shouldn't be used anymore. Most > of it's functionality is now in the FormHelper, > seehttp://book.cakephp.org/view/182/form > > Hope that helps! > > -- > Daniel Hofstetterhttp://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
No problem. It's not a big deal. It is a bit misleading that the Cake home page states that it supports ORM tho' :-( On 24 Jun, 10:43, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > Hi Howie, > > > I do see use of arrays - $post['Post']['id'] - where I'd rather be > > writing $post->id > > You can't access the data like that in cake out of the box, there is a > behaviour out there that does this if you insist on doing it this way. > > sorry not to be of more help! > > jon > > -- > > jon bennett > w:http://www.jben.net/ > iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
one controller - two models
Hi to all, I have some problem. In user controller I have a function forget() - if user forgets his password, he fills a certain form in view http://www.paste.lt/paste/a2a6a50327d0383d5c7629381aee67bc in users controller I've discribed what models to use http://www.paste.lt/paste/2394d3cbae928a8adef5fa43f9c1dc0c in user controller forget function http://www.paste.lt/paste/182ff06f2703e358b65b4aa061ebc7d4 Forget model http://www.paste.lt/paste/5c14c0189d16c9dfac96dd8149519d66 And forget model allways returns true. Any Ideas ? Thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to set Ajax function call on "onblur" event of an tag
Hi, I am using $ajax->ObserverField('mydd',$options) to call ajax from my page. It works fine but works on the onchange event of my tag by default. How can i change its behaviour of calling ajax on not on its onchange event but on its onblur event. The code which i am using in my view is: 1996 1997 1998 ?php $options = array( 'update' => 'view', 'with' => 'Form.serializeElements($("myForm").getElements())', 'url'=> '/people/search', 'frequency' => 1, 'loading' => "Element.hide('view');Element.show('loading')", 'complete' => "Element.hide('loading');Effect.Appear('view')" ); echo $ajax -> observeField('mydd', $options); ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake perfomance
francky06l, bebug 0 or 1 not take perfomance effect db queries works fast = 1-2 ms Grant Cox, i will look this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Html Helper get wrong!!
Hi, > i get use the new cake version 1.2.0.7125 RC1, > > i code the Html helper like before: > > input('Artist/name');?> > > but it got html: > > > > could somebody tell me how should i do? HtmlHelper::input() is deprecated and shouldn't be used anymore. Most of it's functionality is now in the FormHelper, see http://book.cakephp.org/view/182/form Hope that helps! -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: newbie elements question
Hi . On Tue, Jun 24, 2008 at 11:28 AM, . <[EMAIL PROTECTED]> wrote: > I have a controller comments_controller.php and comments/add.ctp file, but I > want to be able to add this add.ctp onto more than 1 page (don't want to > duplicate the same code). Should I make an elements/comments/add.ctp instead > of view/comments/add.ctp? You can do both ways, see requestAction("/comments/add") and element("/comments/add") in the manual. The "element" way will probably be a better choice, as you should need no controller logic (action) to render a simple form in several places... AFAIK, the ultimate choice depends more on your controller logic : how will the result be saved and displayed, will it be ajax or will it be redirected, will there be validation, ? etc... > Also, in my elements/add.ctp file, if I do , and in my > comments_controller.php file I do $this->set('variable', 'test');, it gives > me an error. How would I do this the right way? You must set the variables for the elements in the element() function : $this->element("/comments/add",array("variable"=>"test")); + Clément > > Thanks > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using pagination helper on a view element
Anyone have an answer to this problem? Thanks On Apr 7, 7:19 pm, "Juan Luis Baptiste" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to make a view element and reuse it in various views. The > element uses the pagination helper, the problem is that the element > can't see the paginator helper object: > > : Undefined variable: paginator [APP/views/elements/servers.ctp, line 7] > > If I add the helper to the "uses" variable of the controller which > calls the action that includes the element on its view, then the > helper is found but I get these errors: > > Warning (2): array_merge() [function.array-merge]: Argument #1 is not > an array [CORE/cake/libs/view/helpers/paginator.php, line 139] > > The code of my element is something like the the following: > > $servers = $this->requestAction('servers/index/'); > ?> > > > sort('Server Name', 'name');?> > sort('IP Address', 'ip_address');?> > > > > > > > > > prev('<< Previous ', null, null);?> > next(' Next >>', null, null);?> > '.$paginator->counter(); ?> > div(null,$paginate, array('align' => 'center')); ?> > > on the view that includes it: > > echo $this->renderElement('servers'); > > and the controller action: > > function index($id = null) { > $servers = $this->paginate('Server'); > $this->set(compact('servers')); > if(isset($this->params['requested'])) { > return $servers; > } > > } > > So how is the propper way to use the pagination helper on a view element ? > > Thanks. > -- > Juan Luis Baptiste --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
Hi Howie, > I do see use of arrays - $post['Post']['id'] - where I'd rather be > writing $post->id You can't access the data like that in cake out of the box, there is a behaviour out there that does this if you insist on doing it this way. sorry not to be of more help! jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
I've read the tutorial several times. Can't see any reference to how to do this. I do see use of arrays - $post['Post']['id'] - where I'd rather be writing $post->id I can see where the power of Cake is with sinmple CRUD operations. The controller calls the DAO (model) directly, but for anything more complex, I'd like my skinny controller to call a service/manager, that calls the DAOs. This would, ideally, return a class representing my model,, that I could make available to the view. Personally,I don't believe that the model should be fat with business loogic, if in fact the model is a DAO, and not a domain object. Maybe Cake isn't for me. I know that Django/Python's domain model is OO based. Not sure about Ruby --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
newbie elements question
I have a controller comments_controller.php and comments/add.ctp file, but I want to be able to add this add.ctp onto more than 1 page (don't want to duplicate the same code). Should I make an elements/comments/add.ctp instead of view/comments/add.ctp? Also, in my elements/add.ctp file, if I do , and in my comments_controller.php file I do $this->set('variable', 'test');, it gives me an error. How would I do this the right way? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Html Helper get wrong!!
hi all: i get use the new cake version 1.2.0.7125 RC1, i code the Html helper like before: input('Artist/name');?> but it got html: could somebody tell me how should i do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
Hi Howie, > Can I instantiate a domain object (model), and then save it? > > part = new Part() > part.price = 123.45 > part.save() You can, but in doing so you wouldn't be leveraging cake's true power, I would read through the Blog tutorial in the cookbook: http://book.cakephp.org/view/219/blog hth jon -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Timeout on IE but not on other browsers
On 24 Jun 2008, at 17:23, azlanms wrote: > but there no error indicated at the bottom left taskbar of the window. Yes, that's why it's such a hard error to figure out. Depending on what your JS is doing it may still be the problem. Have you disabled JS in IE to see if it's *really* not the problem? azlanms further wrote: > I did further investigation and found a temporary solution. What I've > done was to insert an echo " "; statement in the controller function > to force the page to be written something before performing other > queries and rendering the remaining page. I have to set > define('DEBUG', 0); in core.php beforehand because if I set to > debugging mode, I'll get those "Warning: session_start(): Cannot send > session cookie" messages. if (!see($evil) && !hear($evil)) { $evil = false; // ? } ;-P > On Jun 24, 11:35 am, Lance Willett <[EMAIL PROTECTED]> wrote: >>> Do you have any JavaScripts anywhere in the page? >> >> I agree that this sounds like a JavaScript issue, not a PHP or HTTP >> issue. If you want to force IE to have a longer keep-alive value, see >> "How to change the default keep-alive time-out value in Internet >> Explorer" article on Microsoft.com:http://support.microsoft.com/kb/813827 >> . > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Timeout on IE but not on other browsers
Yes, there's some Javascript code but there no error indicated at the bottom left taskbar of the window. When there's not so many data, the page can be displayed correctly. I did further investigation and found a temporary solution. What I've done was to insert an echo " "; statement in the controller function to force the page to be written something before performing other queries and rendering the remaining page. I have to set define('DEBUG', 0); in core.php beforehand because if I set to debugging mode, I'll get those "Warning: session_start(): Cannot send session cookie" messages. Any other clues? On Jun 24, 11:35 am, Lance Willett <[EMAIL PROTECTED]> wrote: > > Do you have any JavaScripts anywhere in the page? > > I agree that this sounds like a JavaScript issue, not a PHP or HTTP > issue. If you want to force IE to have a longer keep-alive value, see > "How to change the default keep-alive time-out value in Internet > Explorer" article on Microsoft.com:http://support.microsoft.com/kb/813827. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Bekijk deze pagina: 'CakePHP In The Wild'
added http://www.seaderm.nl Klik op http://groups.google.com/group/cake-php/web/cakephp-in-the-wild - of kopieer de link en plak deze in de adresbalk van je browser als dit niet werkt. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
self-referencing HABTM relations
Hi, I'm trying to create a small workflow system, in which I have a table of available statusses a job can have. Since it is not possible to switch from certain statusses to another, I'm trying to create some logic which describes which status can lead to which. Therefor, I've made a link table that should enable the self-reference on status: status - id - name status_link - status_id - to_status_id The thing is, that I cannot seem to define a HABTM in the status model for this relation. I also tried it with hasMany, belongsTo and hasOne. Any thoughts? thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to use several languages in cakePHP?
OK, guys I think most of the people who faced with that problem already are read above article, but in fact it is so hard to find out complete solution for friendly URL's problem. Is there a someone who can post such one? On 22 Май, 17:05, leo <[EMAIL PROTECTED]> wrote: > Try this it helped me. a > lot.http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persis... > > Leo > > (Apologies if I have made multiple posts here. Usenet is not the most > modern technology.) > > On 22 Maig, 08:42, Margarittka <[EMAIL PROTECTED]> wrote: > > > Hello! > > I need to write site with support of 3 languages. Differences of parts > > are only in files with constants. How can i realize this in optimum > > way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: simple noob problem with database fetching
Your routes are really a matter of preference and your decision would depend on the structure of your site and your plans for the future. Think carefully how you want to expand one day and see what's the best way to start. On Jun 24, 1:39 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > I actually figured out I don't need to do this. But I am still > curious. > > Does it make more sense to you guys that a category page would be at > > scripts/category/ > or > /categories/view:scripts/ > > ?? > And also /entries/index redirects to /categories/scripts which lists > all the categories > > Note I have one of these for all types of entries: scripts, examples > and tutorials > > Hmm... maybe I should just use a tree category system and scripts, > examples and tutorials could be the top level categories. than in the > future I could also add classes, cakephp helpers and etc wow writing > really helps me brainstorm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Where do I find data before modification ?
Hi, I'm paste the very simple example in the bin (first time, I hope it will work...) Before posting, I tested the code. Ask me more if needed. francky06l a écrit : > Strange since the afterFind in behavior should be called. Maybe you > have a problem in declaration or syntax ... Can you paste some code in > the bin ? > By the way I have implemented a similar behavior that stores the > "delta" between modifications in a table, for an "historization" and > eventual rollback. > > On Jun 23, 2:28 pm, Marc MENDEZ <[EMAIL PROTECTED]> wrote: > >> To complete my request, I notice that if I use the afterFind method in a >> Behavior class, I get nothing. However, if I call afterFind in the model >> class, I get the right data... >> >> So, is there a difference between the two afterFind ? >> >> Marc MENDEZ a écrit : >> >> >>> Hi, >>> >>> I'm working on models and behaviors. >>> I'm developing a behaviour which will compare the "modified" field value >>> in the database to its value I got when the record was fetched. >>> On the "beforeSave" method, I thought the "modified" column was not yet >>> changed to the current time, but I was wrong. >>> I tried to get the original value in the afterFind method, but the data >>> property is empty. >>> >>> How can I do ? >>> >>> Thanks for your help >>> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Cake Models half-baked?
Hi Nate Thanks for your reply. Didn't realsie that PHP4 was still so prevailant. I'd already seen the article in link you provided, and am familiar with the concept of skinny controller, fat model. No problem convnicing me that a controller should be thin! But my point about the Model still stands. The Cake home page mentions support for ORM pattern, and in my Google searches I've found references to claims that Cake supports the ActiveRecord pattern. I don't really see use of either patterns Can I instantiate a domain object (model), and then save it? part = new Part() part.price = 123.45 part.save() Thanks H --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---