APP/views/logs/index.ctp, ... to link to the file?
Is there a way to get this Warning (2): Invalid argument supplied for foreach() [APP/views/logs/ index.ctp, line 12] Where the "APP/views/logs/index.ctp" Would actually open the file (make it a link)? So that I can just click and fix it. I love cake, and I use it on a daily basis now, I just find that most of my time and brain is used for - locating files - opening files - identifying a line There are just too many files to deal with (when you work from a class to the other, even in the one project) to keep it all open in tabs (then you get 20 tabs open, it's just silly). Is this a feature request? Did I miss the option? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session be losted when I use redirect function
Hi, I just checked it with firefox, and the session variables were still missing. I think it is a problem about cakephp and the reason has never been answered very well at least in this Google group. I spent several hours on checking previous similar problems and still do not know the reason. Could someone give a good answer or link to the good answser telling me why the session variables got lost after redirection and how to solve it in an easy(not necessary to config Apache) and safe way(not transfered by url) to keep the session variables. Thank you. On Apr 13, 5:26 pm, Arash <[EMAIL PROTECTED]> wrote: > Hi, > I think I have the same problem, but my session variables are getting > lost only in internet explorer! every thing works fine in firefox! do > you have the same problem?! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session be losted when I use redirect function
Hi, I met the same problem. Even if I redirect to the same page, the session variables were missing. For details, please check my post as following. http://groups.google.com/group/cake-php/browse_thread/thread/aec5967695dcb20d?hl=en# On Apr 11, 7:51 am, Freshow <[EMAIL PROTECTED]> wrote: > in my AddController ,i use: $this -> Session -> > write('id','1001');... > > and I can read the value of id by :..$session -> read('id');.. > > but ,if I add this into AddController, I cannot get the value of id: > > .. > $this -> Session -> write('id','1001'); > $this -> redirect('/'); > .. > > how can I fix this problem, THX for your help! ^_^ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Different pagination condition for different functions
Hello, I want to have different pagination conditions for different functions in my controller. For example: function index() { $criteria = "nodeType LIKE 'Blog'"; $data = $this->Blog->paginate($criteria); $this->set('data',$data); } function myBlogs() { $criteria = "nodeType LIKE 'Forum'"; $data = $this->paginate($criteria); $this->set('data', $data); } Can someone show me how to do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Which versions of MySQL compatible with CakePHP 1.1.9.6305?
New to Cake and hoping someone can answer this. I am running into all bunch of sql syntac error 1064 for the simplest of queries. I'm running MySql 5.0.51a, php 5.2.5, both installed via XAMPP, Mac 10.5. A lot of the queries are generated by cake internally so it doesn't make sense to rewrite anything there. What MySql versions are best with my cake version of 1.1.9.6305? For example, this simple sql does not work: SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`, `Post`.`modified` FROM `posts` AS `Post` where all LIMIT 1 The DB table posts is indeed there and the fields all exist and there are values. Cake is producing this code, not me, and it seems to look legit. Am I missing something here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CakePHP Stops Responding
Hi, I'm running Version 1.2.0.5427. First up, I tried the latest version: 1.2.0.6311 but it had so many bugs with Postgres, I had to revert. Ok, I'm running a PostgreSQL database with over a million records in one table. Every hour or so, the system just simply stops responding. All CakePHP related pages just do nothing. I've even created a dumb page that does nothing in the controller and only outputs some raw text in the view. Still no response. I have a test page under the webroot directory outputting phpinfo() and that works no worries. That page however, is pretty much bypassing the CakePHP framework. I'm not utilising any data caching either. So, I'm stumped. For absolutely no apparent reason, Cake just stops responding to requests. A restart of Apache (httpd) solves the issue for the next hour until the situation re-occurs. Anyone have any ideas? Thanks, Ian. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Displaying the results of a dynamic query
controller: $this->set('some_var', $this->ModelName->query($your_sql)); view: debug($some_var); By "dynamic query" I'm assuming you mean you're not using find(). On Mon, Apr 14, 2008 at 8:45 PM, UTDStudent <[EMAIL PROTECTED]> wrote: > > Hey all, > > I am creating dynamic queries in my application and need help figuring > out how to display them elegantly in CakePHP. I could hard code a > bunch of views in with a lot of if statements, but I was wondering if > there was a more elegant way of displaying the result set. > > Thanks, > > Jeff Lott > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
$model->beforeSave() missing from translate.php?
How can I use beforeSave() in a model that actsAs Translate? Is that even possible? Does using a behavior remove that possibility? Is any of this documented somewhere? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Displaying the results of a dynamic query
Hey all, I am creating dynamic queries in my application and need help figuring out how to display them elegantly in CakePHP. I could hard code a bunch of views in with a lot of if statements, but I was wondering if there was a more elegant way of displaying the result set. Thanks, Jeff Lott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem with plugins
I'm having problems getting plugins to work in my app. I keep getting missing controller errors as cake is tying to access a controller with the name of the plugin. At first I thought I had done something wrong in the plugin I was creating but the problems are there with all of the plugins that I've downloaded and tried to get to work. Is there something I have to do to enable plugins or something? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session be losted when I use redirect function
'?>' tag is working fine in model, I think i should upgrade cakephp V1.2.6311 to a higher version , hope it useful 在08-4-14,Diego Alexandre <[EMAIL PROTECTED]> 写道: > > > Check for whitespaces after the closing tag "?>" in the model.. > > []s. > > > > On Apr 13, 10:26 pm, DYH1919 <[EMAIL PROTECTED]> wrote: > > I configure it as this in core.php > > > > Configure::write('Security.level', 'low'); > > > > but the problem is awalys > > > > > 2008/4/14, klenwell <[EMAIL PROTECTED]>: > > > > > > > > > > > > > > One possible fix, depending on where the redirect is going: > > > > > I was having a problem like this that was driving me crazy. In my > > > case, one character of the url path was changing between requests. > > > IIRC, it was because I was running the entire url path through > > > urlencode and a tilda [~] was being encoded producing a "same origin" > > > conflict for the cookie. In my case, restricting the encoding to the > > > query string alone solved the problem. > > > > > You might also check your security setting in core/config.php as I > > > seem to remember reading that lowering the setting to medium or low > > > solved some session issues. > > > > > Tom > > > > > On Apr 13, 7:39 am, DYH1919 <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm a fresh CakePHPer,and cannot fix it both in IE and FF > > > > > > 2008/4/13, Arash <[EMAIL PROTECTED]>: > > > > > > > Hi, > > > > > I think I have the same problem, but my session variables are > getting > > > > > lost only in internet explorer! every thing works fine in firefox! > do > > > > > you have the same problem?! > > > > > > -- > > > > > > 我的博客,白板博客,IT 生活类博客! > > > > 博客:http://www.oblank.com > > > > -- > > 我的博客,白板博客,IT 生活类博客! > > 博客:http://www.oblank.com > > > > -- 我的博客,白板博客,IT 生活类博客! 博客:http://www.oblank.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: weird behaviour of query conditions
I understand what you mean about "AND" vs. "and" (and my suggestion to use an array stands). But this sentence: "if value contains and the query wont work" is not the same as this one: "if value contains and , the query wont work" The 2nd example you posted generated a string with a comma and an extra space. I'm not saying there isn't something wrong with Cake's munging of the string. I'm saying that the second example is Not Good because it's changed the string you're trying to use as a comparison. On Mon, Apr 14, 2008 at 7:46 PM, bingo <[EMAIL PROTECTED]> wrote: > > well, the second example works fine..I tested in on my cakephp > installation. The problem is with the word "and". I guess whenever > cakePHP sees "AND" (note capital case), it assumes that another is > starting. But this is not true for "and" (lower case) > > Regards, > > > On Apr 14, 3:08 pm, "b logica" <[EMAIL PROTECTED]> wrote: > > It looks to me like the second example will fail also. Note the added > comma. > > > > The proper way to deal with this should be to separate your conditions > > into an array. > > > > > > > > > On Mon, Apr 14, 2008 at 3:01 PM, bingo <[EMAIL PROTECTED]> wrote: > > > > > hi > > > > > I just discovered that this condition in a query wont work > > > > > //Example 1 > > > $condition['Model'][upper($field)] = "IF VALUE CONTAINS AND , THE > > > QUERY WONT WORK"; > > > $this->findAll($condition) > > > //generates this --> select * from model where upper(field) = "IF > > > VALUE CONTAINS" AND ", THE QUERY WONT WORK ". > > > > > //Example 2 > > > $condition['Model'][lower($field)] = "if value contains and the query > > > wont work" > > > $this->findAll($condition); > > > //generates this -> select * from model where lower(field) = "if value > > > contains and , the query wont work" > > > > > Example 1 generate wrong query where as example 2 generate right > > > query. The problem is with the word "and" in the value. > > > > > Did anyone else faced similar problem. if so let me know how you > > > solved the problem- Hide quoted text - > > > > - Show quoted text - > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Password Question
Here's what I got in my view: ///code... input('User.password',array("type"=>"password","label"=>false)); echo $form->error("User.password"); ?> //more code In my controller I have: //code print_r($this->data); when i have Auth enabled, I get: Array ( [User] => Array ( [username] => [referer] => ) ) The odd thing is that if I disable Auth, then I get: Array ( [User] => Array ( [username] => [referer] => [password] => ) ) Any suggestions or thoughts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: weird behaviour of query conditions
well, the second example works fine..I tested in on my cakephp installation. The problem is with the word "and". I guess whenever cakePHP sees "AND" (note capital case), it assumes that another is starting. But this is not true for "and" (lower case) Regards, On Apr 14, 3:08 pm, "b logica" <[EMAIL PROTECTED]> wrote: > It looks to me like the second example will fail also. Note the added comma. > > The proper way to deal with this should be to separate your conditions > into an array. > > > > On Mon, Apr 14, 2008 at 3:01 PM, bingo <[EMAIL PROTECTED]> wrote: > > > hi > > > I just discovered that this condition in a query wont work > > > //Example 1 > > $condition['Model'][upper($field)] = "IF VALUE CONTAINS AND , THE > > QUERY WONT WORK"; > > $this->findAll($condition) > > //generates this --> select * from model where upper(field) = "IF > > VALUE CONTAINS" AND ", THE QUERY WONT WORK ". > > > //Example 2 > > $condition['Model'][lower($field)] = "if value contains and the query > > wont work" > > $this->findAll($condition); > > //generates this -> select * from model where lower(field) = "if value > > contains and , the query wont work" > > > Example 1 generate wrong query where as example 2 generate right > > query. The problem is with the word "and" in the value. > > > Did anyone else faced similar problem. if so let me know how you > > solved the problem- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: N00b layout question
yea only the php worked :/ what's the class you would use for the favorite icon? $html.link is for anchor tags On Apr 13, 2:25 am, Adam Royle <[EMAIL PROTECTED]> wrote: > either use absolute urls for your css or use the html helper.. > > > > or > > css('cake.generic'); ?> > > On Apr 13, 7:46 am,blazingbunny<[EMAIL PROTECTED]> wrote: > > > I'm trying to learn cake php for a project because it's awesome, and > > I'm stuck on something silly. How do you attach a style sheet or for > > that matter an img/js/files and all that stuff in the webroot folder? > > Right now I just have their code plus a stylesheet link but nothing > > it's not working. I even made a favorite icon and that's not showing > > up either. What silly mistake am I making? > > > views/layouts/default.thtml > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > > http://www.w3.org/1999/xhtml";> > > > > > > > > > > > > > > > > > > > ... > > > > > > > > > > > > ... > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL Aro and the Tree Behavior - faulty tree generation
Hi, When creating Aro's with parent_id's, the lft column in the tree is invalid. Here is the code: $this->Acl->Aro->create(); $this->Acl->Aro->save(array('alias' => 'All')); $parent_id = $this->Acl->Aro->getLastInsertID(); $this->Acl->Aro->create(); $this->Acl->Aro->save(array('alias' => 'User', 'parent_id' => $parent_id)); $this->Acl->Aro->create(); $this->Acl->Aro->save(array('alias' => 'Guest', 'parent_id' => $parent_id)); It generates this tree: (5)All(6) (4)User(3) (4)Guest(5) when it should generate this: (1)All(6) (2)User(3) (4)Guest(5) I've been able to localize the problem to this two queries that are run after the 2nd Aro->save(): SELECT "Aro"."id" AS "Aro__id" FROM "aros" AS "Aro" WHERE "Aro"."lft" >= '2'; UPDATE "aros" SET "lft" = lft + 2; As I see it, the first query should select the newly created Aro (in this case the 'User') with empty 'lft' field and return its id so the second query can use it. Can anyone confirm this problem and the faulty tree generation, or am I missing something here? Tested on PHP5 and PostgreSQL 8.2 using nightly build of 13.04.2008. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: id = 0 or id ='0' not allowed in cakephp?
=== Sent from my AT&T Rotary Phone http://blog.samdevore.com On Apr 14, 2008, at 3:01 PM, Defranco <[EMAIL PROTECTED]> wrote: > > On 14 abr, 18:48, Stephen Orr <[EMAIL PROTECTED]> wrote: >> MySQL specifically disallows an ID of 0. I've tested this manually by >> inserting a test row with an ID of 0 into an auto_incremented column. >> It ignores it, and gives it an ID of 1 instead. > > Ok, > > I agree with you regarding numeric PKs. > > But what about non numeric primary keys like I told? > >> Cake will allow id = '00' and will allow id = '000' but will not >> allow update on id = '0' > > I know that most people here don't use non numeric keys and may not > agree with it use, but as I know cakephp supports non numeric primary > key, but do not support id='0' and MySQL does. > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: id = 0 or id ='0' not allowed in cakephp?
My guess is that it is related to the fact that php is loosely typed and the ambiguity in something like '0' === Sent from my AT&T Rotary Phone http://blog.samdevore.com On Apr 14, 2008, at 3:01 PM, Defranco <[EMAIL PROTECTED]> wrote: > > On 14 abr, 18:48, Stephen Orr <[EMAIL PROTECTED]> wrote: >> MySQL specifically disallows an ID of 0. I've tested this manually by >> inserting a test row with an ID of 0 into an auto_incremented column. >> It ignores it, and gives it an ID of 1 instead. > > Ok, > > I agree with you regarding numeric PKs. > > But what about non numeric primary keys like I told? > >> Cake will allow id = '00' and will allow id = '000' but will not >> allow update on id = '0' > > I know that most people here don't use non numeric keys and may not > agree with it use, but as I know cakephp supports non numeric primary > key, but do not support id='0' and MySQL does. > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems saving with hasAndBelongsToMany (multi_field)
I wasn't able to get that script of yours to work, so I set a test up quickly. If I add a product and select the different multi_fields I get this as my $this->data: Array ( [Product] => Array ( [name] => socks ) [Category] => Array ( [Category] => Array ( [0] => 3 ) ) [Color] => Array ( [Color] => Array ( [0] => 1 [1] => 2 ) ) [Size] => Array ( [Size] => Array ( [0] => 1 [1] => 2 ) ) ) This corresponds with the way you should write to HABTM models as per the documentation. I am not sure why your code is not working, but it looks like you have an issue with the way you are programmatically generating things in your app_controller and/or maybe an issue in the add form. I'll have another look tomorrow. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: id = 0 or id ='0' not allowed in cakephp?
On 14 abr, 18:48, Stephen Orr <[EMAIL PROTECTED]> wrote: > MySQL specifically disallows an ID of 0. I've tested this manually by > inserting a test row with an ID of 0 into an auto_incremented column. > It ignores it, and gives it an ID of 1 instead. Ok, I agree with you regarding numeric PKs. But what about non numeric primary keys like I told? >Cake will allow id = '00' and will allow id = '000' but will not allow update >on id = '0' I know that most people here don't use non numeric keys and may not agree with it use, but as I know cakephp supports non numeric primary key, but do not support id='0' and MySQL does. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: id = 0 or id ='0' not allowed in cakephp?
MySQL specifically disallows an ID of 0. I've tested this manually by inserting a test row with an ID of 0 into an auto_incremented column. It ignores it, and gives it an ID of 1 instead. So, not a CakePHP bug at all. Steve On Apr 14, 9:37 pm, Defranco <[EMAIL PROTECTED]> wrote: > nobody? > > /erico --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems saving with hasAndBelongsToMany (multi_field)
OK, whatever I'm doing wrong, it's probably the exact same thing I'm doing wrong with this code (I've put it public before it's working in case it helps you help me fix my bug at all): Tarball: http://cakephp.bytenoise.co.uk/simple-blog-example.tbz SQL: http://cakephp.bytenoise.co.uk/#creating_a_database /app/views/entries/admin_form.ctp lines 13 to 20: echo $form->input('Tag.multi_field', array( 'options' => $tags, 'label' => 'Tags', 'multiple' => 'checkbox', 'error' => array( 'Please choose at least one tag.' ) )); /app/app_controller.php line 166: if ($this->$modelName->save($this->data)) { Thank you very much for your help, Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems saving with hasAndBelongsToMany (multi_field)
> Oh, interesting... Yeah, I'll be happy to include it in my publicly shared code just as soon as I can get the thing working. :) > How about a full output of $this->data then? I know I have had > problems saving if the array is not in the correct order. i.e. If you > try to do $this->Product->save() then the Product array should appear > first in $this->data. OK, here's the whole thing: Array ( [Product] => Array ( [id] => 6 [name] => Classic Men's Parka ) [Category] => Array ( [multi_field] => Array ( [0] => 4 ) ) [Colour] => Array ( [multi_field] => Array ( [0] => 4 [1] => 8 ) ) [Size] => Array ( [multi_field] => Array ( [0] => 1 [1] => 2 [2] => 3 ) ) ) > Have you turned debug on to 2 - if you have then > is it showing you the SQL? Yes, but it's redirecting afterwards. Let me tell it not to and see what it outputs and paste the relevant looking bits: 25 UPDATE `products` AS `Product` SET `Product`.`id` = 6, `Product`.`name` = 'Classic Men\'s Parka', `Product`.`slug` = 'classic- mens-parka' WHERE `Product`.`id` IN (6) 0 0 26 SELECT `CategoriesProduct`.`product_id` FROM `categories_products` AS `CategoriesProduct` WHERE `product_id` = 6 1 1 0 27 DELETE `CategoriesProduct` FROM `categories_products` AS `CategoriesProduct` WHERE `CategoriesProduct`.`product_id` IN (6) 1 0 28 SELECT COUNT(*) AS `count` FROM `categories_products` AS `CategoriesProduct` WHERE `CategoriesProduct`.`product_id` = 6 1 1 0 29 INSERT INTO `categories_products` (`category_id`,`product_id`) VALUES ('0',6) At least it looks like there are no errors! Thanks, Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Password Question
Is it perhaps that your password field on your login form is not labelled User.password? Many tutorials use User.passwd instead. You can also override this by setting $this->Auth->fields = array('username' => 'username', 'password' => 'password'); in your app_controller. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: id = 0 or id ='0' not allowed in cakephp?
nobody? /erico --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM returning single result?
You win! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems saving with hasAndBelongsToMany (multi_field)
Oh, interesting... How about a full output of $this->data then? I know I have had problems saving if the array is not in the correct order. i.e. If you try to do $this->Product->save() then the Product array should appear first in $this->data. Have you turned debug on to 2 - if you have then is it showing you the SQL? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Auth Password Question
I am attempting to implement ACL and Auth into my application and quickly ran into trouble. when I submit my login form i get: Undefined index: password [APP/controllers/users_controller.php, line 209] after looking, this is where my $data['User']['password'] variable is. This is probably a horribly dumb question with a simple answer but, why did this disappear when I turned on Auth? Thanks as always for the help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Slideshow App
hi Kyle, > I want to get this working with cake but I'm afraid that Mootools will > be too troublesome. Any alternatives? A quick google brought up: http://benjaminsterling.com/jqgalviewiii-proof-of-concept/all-comments/ loads of options here: http://ntt.cc/2008/04/08/over-21-beautiful-javascript-and-ajax-based-solutions-to-our-gallery-requirements.html > Maybe one with scriptaculous? Cake is moving to away from Prototype/scriptaculous to jQuery now, so perhaps better to look elsewhere. 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 "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Application Design Suggestions, computers -> switches -> and ports
ClientNode (computer) hasMany ClientNodeInterface (nic, virtual) ClientNodeInterface belongsTo ClientNode, ClientConnector (jack) ClientConnector hasMany ClientNodeInterface, SwitchConnector (shared, distribution) SwitchConnector belongsTo ClientConnector SwitchConnector hasMany SwitchNodeInterface (ports) SwitchNodeInterface belongsTo SwitchConnector, SwitchNode SwitchNode hasMany SwitchNodeInterface --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Plugin Models - Not needed?
Are you setting up HABTM between plugin models and app models? ..just curious. On Apr 14, 11:34 pm, leafspan <[EMAIL PROTECTED]> wrote: > Ok, so I've run into an issue that is literally just stupid, and I'm > baffled. > > I have a plugin with several controllers and models, fully > operational, > everything is working fine. > > All of the models for the plugin are just the basics of defining the > model > class and giving it a name. > > But now, I'm trying to setup a HABTM to tie a model to tagging, and > this is > where everything gets weird. > > After setting up the HABTM association inside the model needed, I > notice > that the data that is being returned by a findAll(), is the same as it > was > before setting a HABTM. > > So I renamed my model file to something else, which should spawn an > error > saying "hey idiot, your missing a model for this controller", but this > is > not the case. Even without the model present, it still gives me back > the > same information from findAll() as if the model was still there. > > I completely removed my models directory from within the plugin, and > the > plugin seems to be working just fine. > > Is this a cakephp bug? What the hell can I do to setup the HABTM for > the > controllers/models within the plugin? > > Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Application Design Suggestions, computers -> switches -> and ports
Hello guys and gals, First, I apologize that this isn't directly related to cakePHP. However, since this is really the only development community I interact with, I hope that you can overlook my off-topic post. :P I'm currently working on a web application, using my favorite framework, that will help me manage user information, computers, hardware, software licenses, etc. So far I'm happy with the way things are looking with the exception of how computers and network devices are related. Here is what I have: A HABTM relationship between computers and network_devices. I've done this since some of the servers I managed have multiple nics and are plugged into more than one switch, router, and/or firewall solution. Using scaffold I see that this is what I'm wanting. Looks great. Well, almost great. The problem with what I have: However here is the problem: port assignment. I'd like to be able to report that server-a is plugged into switch-a port 3. I've currently got a port field in my computers table which allows one port but no relation to which switch the port belongs to. Does anyone have any ideas for an elegant solution to this problem? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Webroot folder in Plugins
I've been looking for the very same thing from last few hrs.. Changeset 6189 (https://trac.cakephp.org/changeset/6189) suggests that JS and CSS support is added, but I cant seem to even access css/js files inside my plugin directory. What folder am I supposed to keep inside my plugin folder? webroot or vendor? On Apr 10, 1:53 am, MYRZ <[EMAIL PROTECTED]> wrote: > After some time reusing and perfecting some code for cakephp, i think > it's time to put all the reusable stuff in aplugin. > > But, > > In the manual (which I realize is not up to date any more for 1.2), i > found that the controllers, models and views folders could be placed > in such aplugin, but not thewebrootfolder. Now, for my code, lots > of images (I just love those http://www.famfamfam.com/lab/ > icons/silk/">Silk Icons), lots of javascript and some css is > essential. And if i should place those in the app/webrootevery time i > reuse it, the whole 'plugin' idea wouldn't make much sence now would > it? > > (Again:) But.. > > After some searching, i saw that the amazing CakePHP developers had > reconized this in http://trac.cakephp.org/ticket/1897";>ticket > 1897, which is fixed with http://trac.cakephp.org/ > changeset/6189">revision 6178. > > Rock 'n roll! > > But somehow i feel would be too obious to just copy thewebrootfolder > into theplugin. I can seem to find somebody tried it in the cakephp > blogosphere... > > So anybody knows a bit more about this down here? > > If i could fix this, it would feel like being in Nerdvana... > > Thanx in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Plugin Models - Not needed?
Ok, so I've run into an issue that is literally just stupid, and I'm baffled. I have a plugin with several controllers and models, fully operational, everything is working fine. All of the models for the plugin are just the basics of defining the model class and giving it a name. But now, I'm trying to setup a HABTM to tie a model to tagging, and this is where everything gets weird. After setting up the HABTM association inside the model needed, I notice that the data that is being returned by a findAll(), is the same as it was before setting a HABTM. So I renamed my model file to something else, which should spawn an error saying "hey idiot, your missing a model for this controller", but this is not the case. Even without the model present, it still gives me back the same information from findAll() as if the model was still there. I completely removed my models directory from within the plugin, and the plugin seems to be working just fine. Is this a cakephp bug? What the hell can I do to setup the HABTM for the controllers/models within the plugin? Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: weird behaviour of query conditions
It looks to me like the second example will fail also. Note the added comma. The proper way to deal with this should be to separate your conditions into an array. On Mon, Apr 14, 2008 at 3:01 PM, bingo <[EMAIL PROTECTED]> wrote: > > hi > > I just discovered that this condition in a query wont work > > //Example 1 > $condition['Model'][upper($field)] = "IF VALUE CONTAINS AND , THE > QUERY WONT WORK"; > $this->findAll($condition) > //generates this --> select * from model where upper(field) = "IF > VALUE CONTAINS" AND ", THE QUERY WONT WORK ". > > //Example 2 > $condition['Model'][lower($field)] = "if value contains and the query > wont work" > $this->findAll($condition); > //generates this -> select * from model where lower(field) = "if value > contains and , the query wont work" > > Example 1 generate wrong query where as example 2 generate right > query. The problem is with the word "and" in the value. > > Did anyone else faced similar problem. if so let me know how you > solved the problem > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
weird behaviour of query conditions
hi I just discovered that this condition in a query wont work //Example 1 $condition['Model'][upper($field)] = "IF VALUE CONTAINS AND , THE QUERY WONT WORK"; $this->findAll($condition) //generates this --> select * from model where upper(field) = "IF VALUE CONTAINS" AND ", THE QUERY WONT WORK ". //Example 2 $condition['Model'][lower($field)] = "if value contains and the query wont work" $this->findAll($condition); //generates this -> select * from model where lower(field) = "if value contains and , the query wont work" Example 1 generate wrong query where as example 2 generate right query. The problem is with the word "and" in the value. Did anyone else faced similar problem. if so let me know how you solved the problem --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM returning single result?
I think you have your associationForeignKey and foreignKey reversed (very common problem) On Mon, Apr 14, 2008 at 11:00 AM, John R <[EMAIL PROTECTED]> wrote: > > PS: Anyone else think Google should have a better way to paste code? > > Here is the external paste so you can actually read the model: > > http://bin.cakephp.org/view/2092329615 > > > > > > > On Apr 14, 9:58 am, John R <[EMAIL PROTECTED]> wrote: > > I have a HABTM relationship that is working, except it only returns > > the first result. Here is the entry in my User model: > > > > var $hasAndBelongsToMany = array( > > 'Contests' => > > array('className' > > => 'Contest', > > > > 'joinTable' => 'contests_users', > > > > 'foreignKey' => 'contest_id', > > 'associationForeignKey' > > => 'user_id', > > 'fields' > => 'id', > > > > 'uniq' => false, > > ) > > ); > > > > When I find a user, I see the first contest_id they have: > > > > [Contests] => Array > > ( > > [0] => Array > > ( > > [id] => 1 > > > > But just that one .. even though this particular user has two entries > > in the database (id 1 and 2).. > > > > Any ideas? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
View this page "CakePHP: Unofficial Resources"
Click on http://groups.google.com/group/cake-php/web/cakephp-unofficial-resources - or copy & paste it into your browser's address bar if that doesn't work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session problem
How is your core.php configured? Post what you have for all Configure::write('Session.*', '...') and whether they are uncommented or not. On Mon, Apr 14, 2008 at 1:35 PM, Ramiro Araujo <[EMAIL PROTECTED]> wrote: > > Hi. Im having a strange problem, and couldn't find any solution or > anyone with a similar problem... Its quite simple: > > same controller, 2 methods: > > function sessionWriteTest ($key, $value) { > $this->Session->write($key, $value); > } > function sessionReadTest ($key) { > debug($this->Session->read($key)); > } > > doesnt work... > > modifying the method sessionWriteTest like this, works: > function sessionWriteTest ($key, $value) { > $_SESSION[$key] = $value; > } > > Am I missing something really simple? My config is set quite default, > temp directories are chmod 777, and normal session handling works! > > Thanks! > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Rendering element from controller
1.2.x uses a new syntax for rendering elements: $this->element('helpbox', array('cache' => true)); You should probably look over the temp docs for 1.2 it will help to understand the changes that have been made from 1.1: http://tempdocs.cakephp.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakeAMF on a shared host?
If you look at the code of the plugin you will see that a lot of work has already gone into decoding AMF messages. With the AMF specification being released it should make it easier to work on, though I must say the osflash site has more info from the developers who reversed engineered it. I put the AMF plugin together for a project I am working on and as can be seen I always intended for the project to support php installs that do not have the plugin. In any case, you are free to work on it and see what you can figure out. Also, you may want to look into pecl run time extensions and see if the amfext might work without being compiled. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
big troubles with Cake's ORDER BY
cake_1.2.x.x_6590, Postgres 8.3 I have a list which should be ordered by name alphabetically, except that one row, "other" should come last. With straight SQL, this is accomplished by: SELECT * FROM service_types ORDER BY name = 'Other', name ASC; So, in my criteria aray for find() i have (ignore the "_en" it's just a language thing and is not important here) 'order' => array( 'ServiceType.name_en' => ' = \'Other\'', 'ServiceType.name_en' => 'ASC') But the first line is missing from the SQL log output. I've tried: $this->ServiceType->order = array( 'AskServiceType.name_en' => ' = \'Other\'', 'AskServiceType.name_en' => 'ASC' ); With the same result. I tried passing an $order array to find() but was left with no ordering at all. I tried just a string: $criteria = array( 'order' => "ServiceType.name_en = 'Other', ServiceType.name_en ASC" ); giving: WHERE 1 = 1 ORDER BY ServiceType"."name_en" = 'Other' ASC, "ServiceType"."name_en" ASC The quotes are unbalanced, with no leading quote just after ORDER BY. The first "ASC" is superfluous and i can live with that. But I cannot figure out what is causing the quotes to become unbalanced. It's obvious, given that first "ASC" though, that the text is being munged somewhere to create the final query. If there's any "Cake" way to do this kind of query I'm all ears. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
I can not solve "Session - losing value after redirect" problem after I read all previous posts.
Hi, I am a beginner in both php and cakePHP. I have met the same problem as many previous posts. However, I have tried most of the solutions and it is still not working. I was just following the IBM Tutorial "Cook up Web sites fast with CakePHP" to learn how to write the script for login. However, after seccessfully login, the session information such as $_SESSION['user'] were not saved if I use the redirect() function. To sovle the problem, I modified my code so that it will redirect to the same login page and echo session variables and session id. After redirection, the session variables are missing and the session id is always the same. If I comment these two lines "$this->redirect('/users/login'); $this->exit();" I can see the correct session variables and the same session id. That means they were saved. My question is that is it possible to keep the session variables after redirect to other pages without configurate Apache server since it is in the university. The code is as following, and my system is WinXP +Apache2.0.59+MySQL5.0.45+PHP4.4.7+cakePHP1.1.19.6305. Here are the methods I have already tried and did not work. 1.set the security level in core.php to low. 2.apply function exit(); 3.I tried to comment out the lines as Grant Cox mentioned in the session.php. In users_controller.php function login() { $this->set('error', false); if ($this->data) { $results = $this->User->findByUsername($this->data['User'] ['username']); if ($results && $results['User']['password'] ==md5($this- >data['User']['password'])) { $this->Session->write('username',$this->data['User'] ['username']); $results['User']['last_login'] = date("Y-m-d H:i:s"); $this->Session->write('last_login',$results['User'] ['last_login']); $this->redirect('/users/login'); $this->exit(); } else { $this->set('error', true); } } } In login.thtml session id is ".session_id()); if ($error) { e('Invalid Login.'); } ?> Please log in. formTag('/users/login')?> Username: inputTag('User/username', array('size' => '40')) ?> Password: password('User/password', array('size' => '20')) ?> submitTag('Login') ?> link('register', '/users/register') ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Submit "multipart/form-data" forms with CakePHP / Ajax
Thanks Adam. You are right, there is no way to make it work without using iFrame or SWFUpload. I have chosen the first option and now it is working well. To make it work, I used this tutorial : http://elmicoxcodes.blogspot.com/2007/03/asynchronous-upload-like-ajax-1.html Adam Royle a écrit : > My point was that Ajax doesn't let you use multipart/data. You'll need > to either use something like swfupload or post to an iframe, etc. > > http://www.railsforum.com/viewtopic.php?id=11430 > > On Apr 14, 11:29 pm, Pierre MARCOURT <[EMAIL PROTECTED]> > wrote: > >> Yes Chris, I am using CakePHP 1.1.19.6305 so it does not work... >> Thank you for the link Adam but it is not the solution I was looking >> for. I don't want that the user has to change a setting in his browser. >> It is not going to be easy to use... I am using Ajax to have a tool >> "user friendly", so I don't want to ask for changing setting in the >> browser... >> So I don't know yet how to make it work, if someone has another idea ? >> Thanks. >> >> Chris Hartjes a écrit : >> >> >>> On Fri, Apr 11, 2008 at 4:40 PM, Pierre MARCOURT >>> <[EMAIL PROTECTED]> wrote: >>> Thanks Chris, but when I try to use the create method, I have the Fatal error : Call to undefined method FormHelper::create() >>> That link was for CakePHP 1.2. >>> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems saving with hasAndBelongsToMany (multi_field)
> Hi Zoe, could you post the controller code? The thing is it's all in app_controller. I've made a scoffolding-esque set of admin pages that apply to pretty much every model. After checking the user's an admin, it works out the controller name, model name, checks if $this->data is empty, then saves the data with $this-> $modelName->save($this->data); It's really not doing much. $this->data isn't tampered with, changed or updated at any stage. Is there anything in particular you need to see? Thank you, Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems saving with hasAndBelongsToMany (multi_field)
Hi Zoe, could you post the controller code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Session problem
Hi. Im having a strange problem, and couldn't find any solution or anyone with a similar problem... Its quite simple: same controller, 2 methods: function sessionWriteTest ($key, $value) { $this->Session->write($key, $value); } function sessionReadTest ($key) { debug($this->Session->read($key)); } doesnt work... modifying the method sessionWriteTest like this, works: function sessionWriteTest ($key, $value) { $_SESSION[$key] = $value; } Am I missing something really simple? My config is set quite default, temp directories are chmod 777, and normal session handling works! Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problems saving with hasAndBelongsToMany (multi_field)
Hi. I'm using this spiffy new automatically-generating-multiple-tickboxes part of the form helper like this: echo $form->input('Colour.multi_field', array( 'options' => $colours, 'label' => 'Colours', 'multiple' => 'checkbox', 'error' => array( 'required' => 'Please choose at least one colour.' ) )); This is all well and good, causing $this->data to have values like this: [Colour] => Array ( [multi_field] => Array ( [0] => 4 [1] => 8 ) ) Which is fine, except this is what ends up in my database: mysql> select * from colours_products; +---++ | colour_id | product_id | +---++ | 0 | 6 | +---++ 1 row in set (0.01 sec) The product ID is being saved just fine (albeit only once), but the colour's not being stored. It should be saving colour ID 4 with product ID 6, and colour ID 8 with product ID 6. I'm not sure if this is relevant, but I'm trying to update three hasAndBelongsToMany relationships at once: the product has-and-belongs- to-many categories, colours, and sizes. I've created the form elements in alphabetical order just in case that makes a difference. Any help would be much appreciated. Thanks, Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakeAMF on a shared host?
Gwoo: I am really sorry for insulting you (and probably others) by not phrasing my question more carefully. I was really trying be humble about my insight into how to setup Apache and PHP plugins. The reason I had such a hard time believing that CakeAMF requires a compiled extension is because it is quite a contrast to the stance of Cake itself. While many PHP-projects have dropped PHP4 Cake still retains compatibility to be installable on the widest possible base of servers. So, I assumed I had missed something. I totally get the effort involved in something as crazy-complex as writing an interface for a proprietary and "compiled" data-format. From what I have found out for myself, there are two paths to take to get CakeAMF running without the extension. I could try to either hook up AMFPHP to replace the two extension-functions used or try to "port" the extension to php-code. Initially, the first option looks like the best one. (If I ever get any of these working I will, of-course, make it available.) Tom: I guess that in a years time you may be right. Hosting is changing and a shared server costs about as much now as a "simple account" did not long ago. Many Flash-apps are short-time campaigns and similar stuff. In these cases you sometimes have to fight for php and a database. :) Not many Flash-apps require remoting, but many could benefit from using it. I have used it on apps with a very slim backend simply because there is not data-conversion overhead. There is also the benefit of less memory-usage on the client (Flash has no garbage collection for loadvars and xml) and it makes "casual hacking" more difficult when you are storing scores in competitions and such. /Martin On Apr 11, 4:49 pm, Gwoo <[EMAIL PROTECTED]> wrote: > > The reason I ask something that even to me sounds exceptionally stupid > > is that I can't really believe that CakeAMF was purposely built to > > only run on custom PHP-installs... > > The only thing that "sounds exceptionally stupid" is the tone of your > message and your perceived attitude. Let me re-phrase your message, so > hopefully you will learn something. > > "From time to time I use Flash on projects and have previously used > CakeAMFPHP. I noticed that this project is no longer being actively > developed. I certainly appreciate the effort that was made and I am > happy to see a newly supported CakeAMF plugin. This plugin seems much > lighter and easier to manage. However, currently the plugin does not > work on shared hosts without asking for the amfext pecl extension to > be installed. I had a quick look at the code and noticed that some > initial efforts were made to make the plugin work without the > extension. I would like to know if there is anyway I can help, so that > for my next Flash project I can use the plugin. Thanks again." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: paginate related model's data
Yes. The easiest way is to create this page as something like /items/ view_items_of_article/article_id instead of /articles/view/article_id so that you can just use $this->paginate the way you normally would. Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Rendering element from controller
I've been using the method detailed in this post: http://cakebaker.42dh.com/2007/12/21/rendering-elements-from-controllers/ for rendering elements as responses to ajax calls. This method is from the implementation of: https://trac.cakephp.org/ticket/3132 After updating to the latest cakephp 1.2 development branch (I hadn't updated in a while) using this method gives a 404. Does anyone know if this feature has been removed? If yes, then why? And what is the new alternative (if there is one)? Thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
paginate related model's data
i have 2 models. Article hasMany Items. so when i go to baked articles/view/id i get details of that article with list of all related Items. But there are many Items. Can i use pagination here on related model somehow? Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 15min Blog Tutorial
A little bit of advice, for what it's worth: If you have a Unix machine with Apache on it, it can be worth trying to get your project to work locally first before trying to get it to work on someone else's server. That way you can ensure you have mod_rewrite turned on, and so on. As I point out here: http://cakephp.bytenoise.co.uk/#installing_cakephp , you may need to add this line to your main .htaccess: RewriteBase / Otherwise, yes, try what Martin said. It's quite common to copy across all the site's subdirectories fine, including their contents, but to miss the hidden files in the main directory you're in, the root of the site. So make sure you copy across all the .htaccess files, including the main one. Hope that helps a bit, Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with My Model
AHH. I kind of thought that may be it. But I thought I'd seen others with that same naming convention. Thanks! On Apr 14, 11:59 am, grigri <[EMAIL PROTECTED]> wrote: > `File` is a reserved word - CakePHP already has a class called `File`. > Until PHP supports namespaces, you'll have to use another class name. > > On Apr 14, 4:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > I'm baffled that I cannot see the problem here. I'll just post simple > > code and see if you guys can see what the heck I did wrong. > > > MODEL > > > > class File extends AppModel { > > var $name = 'File';} > > > ?> > > > CONTROLLER > > > > class FilesController extends AppController { > > > var $name = 'Files'; > > > function index() { > > $this->Session->setFlash(__('Sorry that action is protected.', > > true)); > > $this->redirect('/'); > > } > > > function test() { > > $this->File->recursive = 1; > > $this->set('files', $this->paginate()); > > }} > > > ?> > > > Then there's my view for test which just says hello really. > > > When I try to run /files/test > > > Fatal error: Call to undefined method File::findCount() in /mnt/gs03/ > > herd23/24631/domains/sub.domain.com/html/cake/libs/controller/ > > controller.php on line 1156 > > > I do have other functions etc, but I tried to dumb down the code just > > to test. But still my File Model does not seem to work. Cannot see any > > methods in it. > > > I know I'm missing something so simple, so I'm hoping while I'm gone > > for lunch some of you can point out my error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 15min Blog Tutorial
It sounds indeed sound like rewriting is not working correctly... or if I (miss)interpret your explanation another way... like php is not working at all. if you are "seeing index.php" I hope you are referring to Cakes startpage and not the actual php-code of index.php, right? Just checking. I had a few suggestions off the top of my head. 1. Check that you actually managed to copy the .htaccess files when moving Cake. Sometimes these files are invisible and will not always be copied when just drag-n-dropping. Tell your ftp-client to view all files and check that they are really there. You should have one in each of your folders: cake_root_folder/, cake_root_folder/app/, cake_root_folder/app/webroot/ 2. Do not edit te .htaccess files. To get rewrite working you should not have to edit anything. 3. Check the permissions on the files you uploaded. (Specifically the .htaccess files.) While you are at it make app/tmp/ and all its contents writable by te webserver. (chmod 777 will do for now) 4. Instead of trying to view a view-file directly, you can check that a known image is where you expect it to be. /img/cake.power.gif /app/webroot/img/cake.power.gif If I understood your setup correctly both these should point to the same image. The first one will work if rewriting is running. That's all got at the moment, good luck. /martin On Apr 14, 3:54 pm, conspirator <[EMAIL PROTECTED]> wrote: > Hello, world! > > I've decided it's time to try to learn CakePHP. I played around with > CodeIgnitor, but every time I mentioned it, people just brought up > Cake, so I decided to make my way over to the standard(or maybe it was > just my circle of friends?). > > The first project that I decided to tackle was a heavily documented > tutorial, so I decided to take a look at the 15min. Blog Tutorial, and > of course I have some questions... > > So far I've completed all the steps to the first part of Section 8. > The tutorial suggests that I go to www.example.com/posts/indexand > see some sort of output. Unfortunately, whenever I go there, all I see > is the index.php in the root. I tried navigating to the more specific > part of the sitewww.example.com/app/views/posts/indexand received > the same thing. What am I doing wrong? > > I feel as if I didn't do the mod_rewrite correctly, but would love > some information on how to do this correctly as I wasn't sure how to > correctly modify this or where to go. I contacted my hosting company > and they informed me that what I wanted was already set as the > default, but I'm not sure. Any help would be appreciated! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Getting CakePHP App to work under Apache alias on Windows
http://www.google.com.ar/search?q=cakephp+apache+alias On Mon, Apr 14, 2008 at 9:37 AM, Louie <[EMAIL PROTECTED]> wrote: > > I am having trouble getting this new cake app I am developing to work > smoothly under an Apache alias. I have my app located under C:\xampp > \htdocs\cake\roco. I have setup an alias in http.conf named roco, have > mod_rewrite on with the following in my .htaccess under C:\xampp\htdocs > \cake\roco: > > > RewriteEngine on > RewriteBase /roco > RewriteRule^$webroot/[L] > RewriteRule(.*) webroot/$1[L] > > > Everything seems to work fine when I go to http://localhost/roco but > the problem is that any references to '/' in my pages just point back > to http://localhost/ eg when I go to http://localhost/roco/staff/ I > lose my stylesheet. > > The reason I'd like to do it this way is so that I can have different > apps under the main cake branch that each have their own web server > alias eg > > C:\xampp\htdocs\cake\mywebapp1 => http://localhost/mywebapp1 > C:\xampp\htdocs\cake\mywebapp2 => http://localhost/mywebapp2 > C:\xampp\htdocs\cake\mywebapp3 => http://localhost/mywebapp3 > > I know this probably a pretty basic Apache config thing but I'm in new > territory here! > > Would appreciate any help, > > thanks Luke > > ps have gone through this...http://bakery.cakephp.org/articles/view/ > working-with-apache-aliases-during-cake-setup > > ... but doesn't seem to work. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with My Model
`File` is a reserved word - CakePHP already has a class called `File`. Until PHP supports namespaces, you'll have to use another class name. On Apr 14, 4:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm baffled that I cannot see the problem here. I'll just post simple > code and see if you guys can see what the heck I did wrong. > > MODEL > > class File extends AppModel { > var $name = 'File';} > > ?> > > CONTROLLER > > class FilesController extends AppController { > > var $name = 'Files'; > > function index() { > $this->Session->setFlash(__('Sorry that action is protected.', > true)); > $this->redirect('/'); > } > > function test() { > $this->File->recursive = 1; > $this->set('files', $this->paginate()); > }} > > ?> > > Then there's my view for test which just says hello really. > > When I try to run /files/test > > Fatal error: Call to undefined method File::findCount() in /mnt/gs03/ > herd23/24631/domains/sub.domain.com/html/cake/libs/controller/ > controller.php on line 1156 > > I do have other functions etc, but I tried to dumb down the code just > to test. But still my File Model does not seem to work. Cannot see any > methods in it. > > I know I'm missing something so simple, so I'm hoping while I'm gone > for lunch some of you can point out my error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem with My Model
I'm baffled that I cannot see the problem here. I'll just post simple code and see if you guys can see what the heck I did wrong. MODEL CONTROLLER Session->setFlash(__('Sorry that action is protected.', true)); $this->redirect('/'); } function test() { $this->File->recursive = 1; $this->set('files', $this->paginate()); } } ?> Then there's my view for test which just says hello really. When I try to run /files/test Fatal error: Call to undefined method File::findCount() in /mnt/gs03/ herd23/24631/domains/sub.domain.com/html/cake/libs/controller/ controller.php on line 1156 I do have other functions etc, but I tried to dumb down the code just to test. But still my File Model does not seem to work. Cannot see any methods in it. I know I'm missing something so simple, so I'm hoping while I'm gone for lunch some of you can point out my error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A small query() example to help me get started
> I am trying to figure out how to override the findAll() in one of my > baked index.thtml files with a custom query Why would there be a findAll() [model function] inside an index.thtml file [view template]? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM returning single result?
PS: Anyone else think Google should have a better way to paste code? Here is the external paste so you can actually read the model: http://bin.cakephp.org/view/2092329615 On Apr 14, 9:58 am, John R <[EMAIL PROTECTED]> wrote: > I have a HABTM relationship that is working, except it only returns > the first result. Here is the entry in my User model: > > var $hasAndBelongsToMany = array( > 'Contests' => > array('className' > => 'Contest', > > 'joinTable' => 'contests_users', > > 'foreignKey' => 'contest_id', > 'associationForeignKey' > => 'user_id', > 'fields' > => 'id', > > 'uniq' => false, > ) > ); > > When I find a user, I see the first contest_id they have: > > [Contests] => Array > ( > [0] => Array > ( > [id] => 1 > > But just that one .. even though this particular user has two entries > in the database (id 1 and 2).. > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A small query() example to help me get started
http://book.cakephp.org/view/66/models On Apr 14, 7:00 am, UTDStudent <[EMAIL PROTECTED]> wrote: > I am trying to figure out how to override the findAll() in one of my > baked index.thtml files with a custom query, but I can't seem to get > the syntax for the command right. Can someone provide me a very basic > example to get me started? > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
HABTM returning single result?
I have a HABTM relationship that is working, except it only returns the first result. Here is the entry in my User model: var $hasAndBelongsToMany = array( 'Contests' => array('className' => 'Contest', 'joinTable' => 'contests_users', 'foreignKey' => 'contest_id', 'associationForeignKey' => 'user_id', 'fields' => 'id', 'uniq' => false, ) ); When I find a user, I see the first contest_id they have: [Contests] => Array ( [0] => Array ( [id] => 1 But just that one .. even though this particular user has two entries in the database (id 1 and 2).. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
There are two competitors that I am aware of: e-TextEditor, and Intype. Intype's development has slowed, but there is already a converted Cake bundle. The bundle should still work with the current beta build, but there are still probably some changes that may need to be made. http://intype.info/forums/discussion/315/extended-bundles On Apr 14, 2:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I would opt for extending the CakePHP "bundle" for TextMate. TextMate > is Mac-only but a little over a year ago there was efforts of making > an Editor for Windows that would use the same bundles and in other > ways be inspired by TextMate. I am not aware of any similar efforts > for a Linux-editor. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
bake on smb share
Hi everybody, i get a strange effect when i try to bake on a mounted smb share: Fatal error: Class 'Overloadable' not found in /home/perelin/Desktop/ schmoe/sebas/sebas/cake/cake/libs/model/model.php on line 45 Can somebody confirm this behaviour? The volumen was mounted with: smbmount "//192.168.0.120/wwwroot" ~/Desktop/schmoe/sebas/ -o username=xxx,password=xxx,uid=1000,mask=000 bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session be losted when I use redirect function
Check for whitespaces after the closing tag "?>" in the model.. []s. On Apr 13, 10:26 pm, DYH1919 <[EMAIL PROTECTED]> wrote: > I configure it as this in core.php > > Configure::write('Security.level', 'low'); > > but the problem is awalys > > 2008/4/14, klenwell <[EMAIL PROTECTED]>: > > > > > > > One possible fix, depending on where the redirect is going: > > > I was having a problem like this that was driving me crazy. In my > > case, one character of the url path was changing between requests. > > IIRC, it was because I was running the entire url path through > > urlencode and a tilda [~] was being encoded producing a "same origin" > > conflict for the cookie. In my case, restricting the encoding to the > > query string alone solved the problem. > > > You might also check your security setting in core/config.php as I > > seem to remember reading that lowering the setting to medium or low > > solved some session issues. > > > Tom > > > On Apr 13, 7:39 am, DYH1919 <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm a fresh CakePHPer,and cannot fix it both in IE and FF > > > > 2008/4/13, Arash <[EMAIL PROTECTED]>: > > > > > Hi, > > > > I think I have the same problem, but my session variables are getting > > > > lost only in internet explorer! every thing works fine in firefox! do > > > > you have the same problem?! > > > > -- > > > > 我的博客,白板博客,IT 生活类博客! > > > 博客:http://www.oblank.com > > -- > 我的博客,白板博客,IT 生活类博客! > 博客:http://www.oblank.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
15min Blog Tutorial
Hello, world! I've decided it's time to try to learn CakePHP. I played around with CodeIgnitor, but every time I mentioned it, people just brought up Cake, so I decided to make my way over to the standard(or maybe it was just my circle of friends?). The first project that I decided to tackle was a heavily documented tutorial, so I decided to take a look at the 15min. Blog Tutorial, and of course I have some questions... So far I've completed all the steps to the first part of Section 8. The tutorial suggests that I go to www.example.com/posts/index and see some sort of output. Unfortunately, whenever I go there, all I see is the index.php in the root. I tried navigating to the more specific part of the site www.example.com/app/views/posts/index and received the same thing. What am I doing wrong? I feel as if I didn't do the mod_rewrite correctly, but would love some information on how to do this correctly as I wasn't sure how to correctly modify this or where to go. I contacted my hosting company and they informed me that what I wanted was already set as the default, but I'm not sure. Any help would be appreciated! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
I would have recommended you to look at http://bakery.cakephp.org/articles/view/setting-up-eclipse-to-work-with-cake but the text seems to be gone. On Apr 14, 7:20 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Sun, Apr 13, 2008 at 7:52 PM, Smelly_Eddie <[EMAIL PROTECTED]> wrote: > > > What are your thoughts? > > Several IDE's have the ability to go through directories that contain > your code (Komodo is one of these) to help provide you with tool-tips > and autocompletion. As noble as the idea of a CakePHP-specific IDE > is, there are many IDE's that can be made Cake friendly with minimal > effort. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Getting CakePHP App to work under Apache alias on Windows
I am having trouble getting this new cake app I am developing to work smoothly under an Apache alias. I have my app located under C:\xampp \htdocs\cake\roco. I have setup an alias in http.conf named roco, have mod_rewrite on with the following in my .htaccess under C:\xampp\htdocs \cake\roco: RewriteEngine on RewriteBase /roco RewriteRule^$webroot/[L] RewriteRule(.*) webroot/$1[L] Everything seems to work fine when I go to http://localhost/roco but the problem is that any references to '/' in my pages just point back to http://localhost/ eg when I go to http://localhost/roco/staff/ I lose my stylesheet. The reason I'd like to do it this way is so that I can have different apps under the main cake branch that each have their own web server alias eg C:\xampp\htdocs\cake\mywebapp1 => http://localhost/mywebapp1 C:\xampp\htdocs\cake\mywebapp2 => http://localhost/mywebapp2 C:\xampp\htdocs\cake\mywebapp3 => http://localhost/mywebapp3 I know this probably a pretty basic Apache config thing but I'm in new territory here! Would appreciate any help, thanks Luke ps have gone through this...http://bakery.cakephp.org/articles/view/ working-with-apache-aliases-during-cake-setup ... but doesn't seem to work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
However I have just started to use Eclipse and I don't know even all functionality, I'm getting a real fan of it. It would be a great thought to have Cake power beside it. On 4/14/08, Louie Miranda <[EMAIL PROTECTED]> wrote: > > Eclipse IDE? > > On Mon, Apr 14, 2008 at 5:43 PM, [EMAIL PROTECTED] < > [EMAIL PROTECTED]> wrote: > > > > > > I would opt for extending the CakePHP "bundle" for TextMate > > > > Talking of which does anyone have a link for this? It no longer > > appears in the snv, it was at > > http://macromates.com/svn/Bundles/trunk/Bundles/CAKE.tmbundle > > but that's a 404 now, looking in > > http://macromates.com/svn/Bundles/trunk/Bundles/ > > I don't see it. > > > > Paul > > > > > > > -- > Louie Miranda ([EMAIL PROTECTED]) > http://www.axishift.com > > Security Is A Series Of Well-Defined Steps > chmod -R 0 / ; and smile :) > > > -- -- PHP web developer Delphi desktop developer www.khone.ir --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: image from database as view is too slow
mysql_query() doesn't allow for multiple SQL queries/commands; they can't perform injection (I have yet to see how they could) on the command. Of course you should still sanitize the input though. As for a client not caching images, it depends on how you do it. If you serve up a URL with the address: http://www.website.com/images.php?id=23 Then yes, you're correct. But why not make use of Cake's routes and allow yourself to do something like: http://www.website.com/images/view/23.jpg In which case they would cache the response. Also with the right setup on a server (eAccel, memcache, etags, expire-date, etc) you can achieve a *much* faster turn around if you use the DB to store images. On Apr 13, 11:32 am, jonknee <[EMAIL PROTECTED]> wrote: > On Apr 13, 6:28 am, schneimi <[EMAIL PROTECTED]> wrote: > > > Ok thx jonknee, I understand the problem better now. > > > The only reason I store them in db is that I have all data at one > > place and it's easy to handle for me, not the best reason I know. > > > For now I will use the direct access to the db, thats fast enough. > > Here is the code I use now in the extra php to set up the db > > connection: > > If you're going to be doing it that way, make sure you edit the > original script you posted... It has a glaring SQL injection hole: > > > $result = mysql_query('SELECT thumbnail FROM covers WHERE album_id='. > > $_GET['id']); > > You're putting GET variables directly into a query... Might work nice > when id=1, but what about if someone makes id=1; DELETE FROM covers > WHERE 1? All of your cover images go away. Depending on the MySQL user > permissions they could do a lot worse. > > In your case you could simply pass the GET id variable through > intval() to make sure it's just a number. Adding a LIMIT 1 wouldn't > hurt either in case any duplicates ever pop up in the DB. > > So something like this: > > $result = mysql_query('SELECT thumbnail FROM covers WHERE album_id='. > intval($_GET['id']) . ' LIMIT 1'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nothing written to session SOLVED
In case others run into this: When I used debug($_SESSION) all the information was shown, so everything is working. Although I thought the info would show in the session component array with debug set to 3, it doesn't show there. After further checking, I had set the permissions for the server to write to the temp directory, and although I had added my user to the www-data group, the files were owner rw only - I wasn't getting an access denied warning, rather kwrite seemed to open the file but it appeared empty. Glad it was such a simple mistake. On Apr 11, 5:23 pm, NorthWind <[EMAIL PROTECTED]> wrote: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
Just found it from http://fisheye2.cenqua.com/browse/textmate-bundles/trunk/Bundles/PHP%20Cake.tmbundle Have been lookingfor this bundle for quite a while after noticing the whole bundle being removed from textmate bundle repository. Seems to have been under review since august last year? Mika On Apr 14, 12:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > I would opt for extending the CakePHP "bundle" for TextMate > > Talking of which does anyone have a link for this? It no longer > appears in the snv, it was > athttp://macromates.com/svn/Bundles/trunk/Bundles/CAKE.tmbundle > but that's a 404 now, looking > inhttp://macromates.com/svn/Bundles/trunk/Bundles/ > I don't see it. > > Paul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
There are some articles in the Bakery about how to configure EclipsePDT to work with CakePHP (http://bakery.cakephp.org/articles/ view/setting-up-eclipse-to-work-with-cake), many people there mentions some of the things they would like to include in that solution (ie. autocompletion of models names), and someone mentions the idea of a CakePHP plugin for Eclipse, which I think would be a nice thing to have :) Naty On 13 abr, 20:52, Smelly_Eddie <[EMAIL PROTECTED]> wrote: > I was just thinking how cool a community effort to build an ide for > cake could be. > > The framework has so much power it would be great if it could be > organized and called through menus and such. > > What are your thoughts? > > Are you a LinkedIn Member? > Join the CakePHP Architects and Developers > group;http://www.linkedin.com/e/gis/82040/190BFF29FEC2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
A small query() example to help me get started
I am trying to figure out how to override the findAll() in one of my baked index.thtml files with a custom query, but I can't seem to get the syntax for the command right. Can someone provide me a very basic example to get me started? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
Yes that's a great idea. But it would be better if cakephp gets integerated with existing IDE's like eclipse On Apr 14, 4:52 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote: > I was just thinking how cool a community effort to build an ide for > cake could be. > > The framework has so much power it would be great if it could be > organized and called through menus and such. > > What are your thoughts? > > Are you a LinkedIn Member? > Join the CakePHP Architects and Developers > group;http://www.linkedin.com/e/gis/82040/190BFF29FEC2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
It was moved to http://macromates.com/svn/Bundles/trunk/Review/Bundles/PHP%20Cake.tmbundle/ because since I made the bundle ages ago they have made their standards a little clearer and I just haven't had the time to finish cleaning it up. I have most of the current version updated to 1.2 styles, but still have some work to do to get it out of 'review' Sam D On Mon, Apr 14, 2008 at 2:43 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > I would opt for extending the CakePHP "bundle" for TextMate > > Talking of which does anyone have a link for this? It no longer > appears in the snv, it was at > http://macromates.com/svn/Bundles/trunk/Bundles/CAKE.tmbundle > but that's a 404 now, looking in > http://macromates.com/svn/Bundles/trunk/Bundles/ > I don't see it. > > Paul > > > > > -- -- (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/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with updating counter cache values
lol, I knew it had to be easy but didn't expect that to be honest. It works well now, you've saved me lots of time man, thanks a lot! On Apr 10, 4:45 pm, grigri <[EMAIL PROTECTED]> wrote: > replace this: > > $this->Comment->post_id = $post_id; > $this->Comment->Post->id = $post_id; > > with this: > > $this->Comment->set('post_id', $post_id); > > In cake, the data fields of a model entity are never stored as member > properties of the model object - they are stored in the $data member > property, set using the set() method (it might seem that the $id > member is an exception to this "rule", but it isn't - the member $id > is always called $id, regardless of the actual name of the primary key > field). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model validation - how do you handle different rules for different forms?
How about this? AppModel: function setValidation($validation) { $this->__restoreValidation = $this->validate; if (isArray($validation)) { $this->validate = $validation; } else { $validation = 'validate_' . $validation; $this->validate = $this->$validation; } } function restoreValidation() { $this->validate = $this->__restoreValidation } In your model: function register($data) { $this->setValidation('register'); $result = $this->save($data); $this->restoreValidation(); return $result; } I was thinking in putting all of this in a behavior... On Mon, Apr 14, 2008 at 6:55 AM, Flipflops <[EMAIL PROTECTED]> wrote: > > Hi > > That's a really good idea - you also wouldn't have to worry about > using the wrong validation array by mistake - which I have done - and > it took me an age before I figured out what the problem was. > > Cheers > > > > On Apr 14, 10:16 am, keymaster <[EMAIL PROTECTED]> wrote: > > oops, that should read: > > > > function beforeValidate(){ > > > > // assume $action is set to current action. > > if (isset($this->validateArray[$action])) { > > > > // reassign the $validate variable. > > $this->validate = $this->validateArray[$action]; > > } > > > > } > > > > The beforeValidate() can be put into the appModel to apply to all your > > models. > > > > This way your controllers never have to worry about any of this > > validation stuff, as it should be. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Submit "multipart/form-data" forms with CakePHP / Ajax
My point was that Ajax doesn't let you use multipart/data. You'll need to either use something like swfupload or post to an iframe, etc. http://www.railsforum.com/viewtopic.php?id=11430 On Apr 14, 11:29 pm, Pierre MARCOURT <[EMAIL PROTECTED]> wrote: > Yes Chris, I am using CakePHP 1.1.19.6305 so it does not work... > Thank you for the link Adam but it is not the solution I was looking > for. I don't want that the user has to change a setting in his browser. > It is not going to be easy to use... I am using Ajax to have a tool > "user friendly", so I don't want to ask for changing setting in the > browser... > So I don't know yet how to make it work, if someone has another idea ? > Thanks. > > Chris Hartjes a écrit : > > > On Fri, Apr 11, 2008 at 4:40 PM, Pierre MARCOURT > > <[EMAIL PROTECTED]> wrote: > > >> Thanks Chris, > > >> but when I try to use the create method, I have the Fatal error : > >> Call to undefined method FormHelper::create() > > > That link was for CakePHP 1.2. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Submit “multipart/form-data” forms with CakePHP / Ajax
Yes Chris, I am using CakePHP 1.1.19.6305 so it does not work... Thank you for the link Adam but it is not the solution I was looking for. I don't want that the user has to change a setting in his browser. It is not going to be easy to use... I am using Ajax to have a tool "user friendly", so I don't want to ask for changing setting in the browser... So I don't know yet how to make it work, if someone has another idea ? Thanks. Chris Hartjes a écrit : > On Fri, Apr 11, 2008 at 4:40 PM, Pierre MARCOURT > <[EMAIL PROTECTED]> wrote: > >> Thanks Chris, >> >> but when I try to use the create method, I have the Fatal error : >> Call to undefined method FormHelper::create() >> > > That link was for CakePHP 1.2. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Slideshow App
I want to get this working with cake but I'm afraid that Mootools will be too troublesome. Any alternatives? Maybe one with scriptaculous? On Apr 14, 9:17 am, "amro tahtamoni" <[EMAIL PROTECTED]> wrote: > realllt its a too nice photo browser but we need the correct way to deal > with it under cake ?? > > On Sun, Apr 13, 2008 at 6:35 AM, Kyle Decot <[EMAIL PROTECTED]> wrote: > > > I recently found this slideshow app and I was wondering if anyone had > > tried to use this, or a similar app with Cake. > > >http://www.e2interactive.com/e2_photo_gallery/ > > > If so, I was hoping you could share some of your experiences/ > > frustrations with it so I know what to look forward to. Thanks as > > always --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Slideshow App
realllt its a too nice photo browser but we need the correct way to deal with it under cake ?? On Sun, Apr 13, 2008 at 6:35 AM, Kyle Decot <[EMAIL PROTECTED]> wrote: > > I recently found this slideshow app and I was wondering if anyone had > tried to use this, or a similar app with Cake. > > http://www.e2interactive.com/e2_photo_gallery/ > > If so, I was hoping you could share some of your experiences/ > frustrations with it so I know what to look forward to. Thanks as > always > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: testing with phpunit
Yes. I have to use continuous integration server XINC, which uses phpunit, so I have to. Anybody with alternate solution? -- Regards, Jay On Apr 14, 4:10 pm, the_woodsman <[EMAIL PROTECTED]> wrote: > Is PHPUnit essential? > > Cake's built in testing uses SimpleTest, which is, to my knowledge, > comparable to or better than PHPUnit. > > On Apr 14, 6:50 am, Jay <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Can anybody explain me how to test cakephp in phpunit. > > > If any example, then it would be great. > > > -- > > Thanks & Regards, > > Jay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
Eclipse IDE? On Mon, Apr 14, 2008 at 5:43 PM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > > I would opt for extending the CakePHP "bundle" for TextMate > > Talking of which does anyone have a link for this? It no longer > appears in the snv, it was at > http://macromates.com/svn/Bundles/trunk/Bundles/CAKE.tmbundle > but that's a 404 now, looking in > http://macromates.com/svn/Bundles/trunk/Bundles/ > I don't see it. > > Paul > > > -- 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 "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Reliable Shared Host under $10?
I am also hosted at asmallorange hosting. my website, axishift.com is running cakephp 1.2.x (still being developed) On Sun, Mar 23, 2008 at 7:30 PM, Farid <[EMAIL PROTECTED]> wrote: > > Try http://www.asmallorange.com/services/hosting/ they have a 'Tiny' > plan which is $25 / year. I have a similar setup with them, i.,e. > practically zero traffic as I only use it for weekend projects - been > using them for six months or so without issues. > > PS: Have not actually tried cakePHP there yet, but built a simple > Facebook app with PHP and mySQL support without issues. > > On Mar 20, 4:33 am, websurfshop <[EMAIL PROTECTED]> wrote: > > Brand New to PHP and Cake. I would like to put up a really > > inexpensive webpage with zero traffic for all intents and purposes / > > * unless I hit it big ;-/ */ > > > > Can someone recommend a reliable Host for under $10/month that would > > be CakePHP friendly? > > > > -- 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 "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: saveAll, bug or miss in documentation?
Oho, sorry. 1.2.0.6311 beta And yes, I'm talking about the Model class. I'll have to checkout the cake from svn and check it the :P Thanks for the fast respons anyway. On 14 Apr, 14:11, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > What version of CakePHP are you running? > If you are refering to cake/libs/model/model.php then it has been > fixed as far as I can see. > > On Apr 14, 1:09 pm, laeffe <[EMAIL PROTECTED]> wrote: > > > Hi all, if I havent missunderstod something I belive that there is > > ether a bug in saveAll or an error in the phpDoc. > > > In the phpDoc it says "True on success, or an array of validation > > errors on failure" and by looking at this code (which is the last > > couple of lines in that method): > > > if ($options['atomic']) { > > $db->commit($this); > > > } > > > And after that the function ends, which means that in some cases it > > might success in saveing the data but without returning true. > > > I tried to add a return true; in that if statment which seams to work > > for me atlest. > > > The reason i found this is because saveAll stoped returning true after > > i added a behavior which alters the data for a related model. > > > So, can anyone confirm my idea?' > > > //Laeffe > > Ps. sorry if my english sucks :P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: saveAll, bug or miss in documentation?
What version of CakePHP are you running? If you are refering to cake/libs/model/model.php then it has been fixed as far as I can see. On Apr 14, 1:09 pm, laeffe <[EMAIL PROTECTED]> wrote: > Hi all, if I havent missunderstod something I belive that there is > ether a bug in saveAll or an error in the phpDoc. > > In the phpDoc it says "True on success, or an array of validation > errors on failure" and by looking at this code (which is the last > couple of lines in that method): > > if ($options['atomic']) { > $db->commit($this); > > } > > And after that the function ends, which means that in some cases it > might success in saveing the data but without returning true. > > I tried to add a return true; in that if statment which seams to work > for me atlest. > > The reason i found this is because saveAll stoped returning true after > i added a behavior which alters the data for a related model. > > So, can anyone confirm my idea?' > > //Laeffe > Ps. sorry if my english sucks :P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Curious model related bug - server stops responding
Hi. Sorry to bother you all again, but I've got a curious bug I just can't fathom. In my /app/app_controller.php I've got the following code as part of a routine that works out whether the user's logged in or not: App::import('Model', 'Person'); $this->PersonTemp = new Person(); # This conflicts with webpages' recursion, but not categories' recursion For some reason I can't work out, the second of these two lines has broken every page that uses the Webpage model I have. This is confusing for several reasons: the two models are not directly related in my ER diagram; I don't get an error message, the webserver just doesn't return anything; and I have a model called Category which is nearly identical to Webpage, but which works fine. Through a bit of trial and error, I've found out that commenting out the part of the Webpage model that deals with it being its own parent and children (it recurses) makes the site work again, but I need this functionality and it's an intriguing puzzle as to why it's not working. Here's what I've commented out in /app/models/webpage.php to temporarily fix it: Class Webpage extends AppModel { var $name = 'Webpage'; var $belongsTo = array( /* #This conflicts with the People model in app_controller 'Parent' => array( 'className' => 'Webpage' ) */ ); var $hasMany = array( /* #This conflicts with the People model in app_controller 'Child' => array( 'className' => 'Webpage' ), */ 'WebpageTranslation' => array( 'className' => 'WebpageTranslation' ) ); } I'm sure I've somehow managed to introduce a simple typo or something somewhere, but does anyone have any ideas as to whereabouts the trouble might lie? Thank you very much, Zoe. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: testing with phpunit
Is PHPUnit essential? Cake's built in testing uses SimpleTest, which is, to my knowledge, comparable to or better than PHPUnit. On Apr 14, 6:50 am, Jay <[EMAIL PROTECTED]> wrote: > Hi, > > Can anybody explain me how to test cakephp in phpunit. > > If any example, then it would be great. > > -- > Thanks & Regards, > Jay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
saveAll, bug or miss in documentation?
Hi all, if I havent missunderstod something I belive that there is ether a bug in saveAll or an error in the phpDoc. In the phpDoc it says "True on success, or an array of validation errors on failure" and by looking at this code (which is the last couple of lines in that method): if ($options['atomic']) { $db->commit($this); } And after that the function ends, which means that in some cases it might success in saveing the data but without returning true. I tried to add a return true; in that if statment which seams to work for me atlest. The reason i found this is because saveAll stoped returning true after i added a behavior which alters the data for a related model. So, can anyone confirm my idea?' //Laeffe Ps. sorry if my english sucks :P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model validation - how do you handle different rules for different forms?
Hi That's a really good idea - you also wouldn't have to worry about using the wrong validation array by mistake - which I have done - and it took me an age before I figured out what the problem was. Cheers On Apr 14, 10:16 am, keymaster <[EMAIL PROTECTED]> wrote: > oops, that should read: > > function beforeValidate(){ > > // assume $action is set to current action. > if (isset($this->validateArray[$action])) { > > // reassign the $validate variable. > $this->validate = $this->validateArray[$action]; > } > > } > > The beforeValidate() can be put into the appModel to apply to all your > models. > > This way your controllers never have to worry about any of this > validation stuff, as it should be. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP IDE
> I would opt for extending the CakePHP "bundle" for TextMate Talking of which does anyone have a link for this? It no longer appears in the snv, it was at http://macromates.com/svn/Bundles/trunk/Bundles/CAKE.tmbundle but that's a 404 now, looking in http://macromates.com/svn/Bundles/trunk/Bundles/ I don't see it. Paul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model validation - how do you handle different rules for different forms?
oops, that should read: function beforeValidate(){ // assume $action is set to current action. if (isset($this->validateArray[$action])) { // reassign the $validate variable. $this->validate = $this->validateArray[$action]; } } The beforeValidate() can be put into the appModel to apply to all your models. This way your controllers never have to worry about any of this validation stuff, as it should be. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model validation - how do you handle different rules for different forms?
Beautiful. The only disadvantage I see is somewhat semantic. The controller shouldn't be telling the model which validation array to use. I wonder if this could be improved by having the model transparently perform the $validate re-assignment in beforeValidate(), using the current action as the key. Something like this: ... in your model constructor: $validateArray['login'] = $validate_login; $validateArray['register'] = $validate_register; ... in your model's beforeValidate callback: function beforeValidate(){ // assume $action is set to current action. if (isset($this->validateArray[$action])) { // reassign the $validate variable. $validate = $this->validateArray[$action]; } } etc . --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Default this->data controller?
I'd guess that your AppController has $uses = array('User') - and the first model to be used by a controller is considered its default model. Try doing $form->create('Contest') to explicitly set the model for the form. On Apr 14, 2:08 am, John R <[EMAIL PROTECTED]> wrote: > I have a pretty basic form that looks like this: > > create(); ?> > checkbox('contest.agree'); ?> I have read & agreed to the > contest rules > end('Join This Contest!'); ?> > > This is in the 'contests' controller. > > When the form is submitted however, I get this: > > Array > ( > [Users] => Array > ( > [agree] => 1 > ) > > ) > > Any idea why the first parameter in the array is 'Users'? It should be > 'Contests' .. and there is no mention of Users anywhere in the > controller or view. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model validation - how do you handle different rules for different forms?
This is the way I do it (haven't tried it in 1.2 - but I see no reason why it wouldn't work). I've been using this in loads of 1.1.x based sites together Evan Sagge's excellent validation code http://bakery.cakephp.org/articles/view/more-improved-advanced-validation In your model define a number of different validation arrays as required: var $validate = array(); var $validate_register = array( 'title' => array('required'), 'first_name' => array('required'), 'last_name' => array('required'), 'username' => array('required', 'unique'), 'email' => array('required', 'unique', 'email'), 'passwd' => array('required'), 'passwd' => array('length' => array('min' => 8, 'max' => 20)), 'postcode' => array('required','postcode'), 'agree_terms' => array('required'), ); var $validate_details = array( 'title' => array('required'), 'first_name' => array('required'), 'last_name' => array('required'), 'username' => array('required', 'unique'), 'email' => array('required', 'unique', 'email'), 'postcode' => array('required','postcode'), ); var $validate_edit_password = array( 'passwd' => array('required'), 'passwd' => array('length' => array('min' => 8, 'max' => 20)), ); Then in your controller you just select the validation you want to use depending on context and over-ride the default validation array e.g. function register() { $this->User->recursive = 0; $this->User->validate = $this->User->validate_register; // etc. } function members_details() { $this->User->recursive = 0; $this->User->validate = $this->User->validate_details; $this->layout = "member"; // etc. } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A Little Help with Plug-Ins
I can confirm: Pizza tutorial worked for me just now when trying it out. Check your naming carefully. The word Pizza will be everywhere :) The controllers should be called PizzaSomethingController and extend the PizzaAppController. And the PizzaAppController (and PizzaAppModel) must exist even if they are just empty classes otherwise you will get errors similar to what you describe. Those where the things I experienced as "new" and "unusual". BTW: I am running a trunk-version of 1.2 from last week, not the published beta which is now quite old. Lots of things have been fixed since the 6311-beta so if you are on that you might try to update. /Martin On Apr 14, 6:43 am, klenwell <[EMAIL PROTECTED]> wrote: > Thanks for the response, aran. After researching the issue as much as > I could, I'm left with the impression that plugins are broken in 1.2. > Or at least not very reliable. > > Has anyone confirmed that the basic pizza orders example in the manual > still works? I was never able to get it working (see earlier post). > > I've given up on plugins for the time being and am focusing on > developing an application-independent library, as detailed here: > > http://bakery.cakephp.org/articles/view/maintaining-an-application-in... > > Tom > > On Apr 13, 7:26 pm, aranworld <[EMAIL PROTECTED]> wrote: > > > Make sure you are following the advice in the following article: > > >http://aranworld.com/article/143/cakephp-model-associations-from-with... > > > In short, I have had problems with models from the plugin not being > > automatically found, so I had to do a: > > > App::import('Model', 'Author'); > > > Before I began the class declaration for the Model that existed in the > > plugin/models directory. > > > -Aran > > > On Apr 12, 5:20 pm, klenwell <[EMAIL PROTECTED]> wrote: > > > > I had ambitious plans for a plugin that could be used by multiple > > > cakephp apps on the same server. But I can't even get the basic > > > example from the cookbook work: > > > >http://book.cakephp.org/view/114/plugins > > > > I'm using CakePHP 1.2 with Php 5 and went through the example step-by- > > > step. Still, when I go tohttp://domain.com//pizza/pizzaOrders, I get > > > the missing controller error: > > > > Error: Create the class PizzaController below in file: cake_app > > > \controllers\pizza_controller.php > > > > A couple questions: > > > > 1. Do I have to do anything special to "load" or "install" the plugin, > > > like set a route? > > > > 2. Cab changing the default directory/path settings break things? > > > Following the instructions here > > > --http://book.cakephp.org/view/32/installation#advanced-installation-35 > > > -- I customized the installation a bit. The app folder is in home/ > > > projectname/cake_app/. The setup works with regular controllers. But > > > I can't get the plugins working. > > > > Can anyone point out what I'm missing here? Thanks, > > > > Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model validation - how do you handle different rules for different forms?
Thanks, but the update vs.create distinction is not the problem here. We always want a country mandatory, whether the user is registering (ie. creating a new record), or changing his profile (ie. updating). But we don't need a country when the user logs in, or when the user requests a password change. All these forms: registration, updateProfile, login, changePassword, forgotPassword are validated against the user model. But the validation rules have to be different for each form. Perhaps a stronger example is the password: it is mandatory on the registration form, the login form, and the changePassword form; but, is not required on the forgotPassword form, or the updateProfile form. It makes sense to have the data "type" and "values" be defined at the model level, since these are characteristics of the data. However, whether the field is mandatory or not, that is often more a characteristic of the form than the data. Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---