Does cakephp support transaction now?
In my application I sometimes have more than one database actions in an action, but when read the cakephp's docs I found little about this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Binding my assocation on the fly to sort through a HABTM relationship...
Well I did not have time to think much about the query, but maybe the bindModel could look like this : $this-Story-bindModel( array( 'hasAndBelongsToMany' = array( 'className'='Tag', 'finderQuery' = SELECT . Tag.id, . Tag.name, . FROM . tags AS Tag . JOIN stories_tags ON (Story.id = stories_tags.story_id) . WHERE . Tag.name = $name AND . Story.school_id = $_SESSION['school_id'] ) ) Again, I might be completely wrong and really did not test anything.. This was just to give you some hints Hope this helps On Jul 7, 8:18 pm, inVINCable [EMAIL PROTECTED] wrote: Heh, yeah I fixed it, still no dice :( No Story.tag_id field On Jul 7, 11:12 am, Tim Koschuetzki [EMAIL PROTECTED] wrote: Typo in the last line of the binding operation: 'cinditions' ; ] On 7 Jul., 19:58, inVINCable [EMAIL PROTECTED] wrote: francky06I, I think a problem would occur because the variable depending on what school_id is in their session, so if I put that in the finderQuery, would that work? It return results based upon their school only ? I was thinking about 'finderQuery' = 'where school_id = $session-read(User.school_id)' Although I guess this will not work because the model cannot be changed for every user that calls upon it? Thanks. On Jul 7, 10:49 am, francky06l [EMAIL PROTECTED] wrote: I guess the hasOne relation does not work because you do not have a tag_id in your story table. The link can't be done at this level. You could use the finderQuery parameter, maybe into the HABTM association. This thread is very helpfull for the syntax of the finderQuery : http://groups.google.com/group/cake-php/browse_thread/thread/5ac2bdec... On Jul 7, 7:37 pm, inVINCable [EMAIL PROTECTED] wrote: Hi guys, Alright, this problem has troubled me for the past four hours so I have to resort to the group : \ Ok, I have a HABTM between stories, tags, and my join table is stories_tags. I have my search function set up very simply like this in my tag controller function search($tag) { $this-Story-Tag-findAllByTag($tag)); } The search works perfect fine, the only problem is it returns the results from ALL the schools. An example of a return array of the tag computer Array ( [0] = Array ( [Tag] = Array ( [id] = 30 [tag] = Computer ) [Story] = Array ( [0] = Array ( [id] = 117 [title] = I went [body] = to the store [school_id] = 1 [user_id] = 72 [category_id] = [agree] = [disagree] = [tags] = Computer ) [1] = Array ( [id] = 118 [title] = new [body] = story [school_id] = 3 [user_id] = 72 [category_id] = [agree] = [disagree] = [tags] = Computer ) ) Notice in the returned array in the stories there is a value school_id My goal is when a user searches for the tag computer, only the tags will show up relevant to their school. So this is what I have been doing, but to no avail. I have been create a model on the fly, in my tags controller, like so: this-Tag-bindModel( array('hasOne' = array('Story'= array('className' = 'Story', 'cinditions' = 'Story.school_id = 3') I must be doing something wrong though, so if anyone could offer any tips as to what my bindModel should look like that would be great. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to
Re: UserDir Installation
Maybe the ~ character is screwing up the rewriting. Why not RewriteBase /ssharkey ? On Jul 8, 12:17 am, Scott Sharkey [EMAIL PROTECTED] wrote: Hi All, I'm trying a top-level installation into an apache UserDir. I've read the documentation, which says to put a RewriteBase directive in the /~user/public_html/.htaccess file. This does not seem to be working for me. Here's what I know: 1) Mod_Rewrite is loaded and working fine on the server. I have a cake install in the main server root which is working fine. 2) the server ishttp://devel.mysite.com, and that top level is a cake app. 3) I'm trying to create ahttp://devel.mysite.com/~ssharkeywhich is a copy of the above site (for devel/debugging). 4) I have unpacked a clean cake 1.1.15.5144 into /home/ssharkey/public_html, and have Apache UserDir public_html configured. 5) If I put an index.php in that /home/ssharkey/public_html, everthing works as expected. 6) I have added RewriteBase /~ssharkey as the 2nd line in /home/ssharkey/public_html/.htaccess (just after RewriteEngine on). This appears to be serving the raw content, but the css file is not being found, nor are any images or cake-generated links on the page. The apache log shows requests for /css/cake.generic.css, and files in /img. I would think these should be /~ssharkey/css/cake.generic.css, etc. Any suggestions would be welcomed! -scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Quick admin routes question
Router::connect('/admin/', array(CAKE_ADMIN = true, 'controller' = 'photos', 'action' = 'index')); 2007/7/8, [EMAIL PROTECTED] [EMAIL PROTECTED]: I need to route '/admin' to '/admin/photos/index' in my routes table. Is this possible? I'm using CakePHP admin routes. Router::connect('/admin', array('controller' = 'photos', 'action' = 'admin_index')); For me, it generates the 'Trying to access private method in class' error. I've read the manual and searched the group to find the answer but didn't locate it. I also tried: Router::connect('/admin', array('controller' = 'admin/photos', 'action' = 'index')); Among others. Anyone done this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake, Ajax, and jquery
First of all,please google or use the search funktion for you question in the futur! And please read the fucking manual! ( http://manual.cakephp.org/chapter/controllers ) Read: http://groups.google.com/group/cakephp-de/browse_thread/thread/b1416e1a146ba5d7 We love to help you BUT not to write YOUR code! On 8 Jul., 02:26, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm trying to use cake with jquery, and I am wondering how to automatically render certain controller actions as empty, or without any layout, just html snippets, automatically. since jquery doesn't add the same header to its ajax calls as does prototype, is this possible? Or, do I just create an empty layout and use it to return my snippets of html with ajax Thanks, Brian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL
Thanks but http://bakery.cakephp.org/articles/view/real-world-access-control is for 1.1 and i wrote i am on 1.2 but for beginners a very good article which explains the acl logic! I already figured it out how to do it! $aro = $this-Acl-Aro; $aro-create(array('model' = 'User', 'foreign_key' = 1, 'alias' = 'Admin') ); $aro-save(); for $aco the same stuff... If you dont know how something works on cakephp read the fucking api code X'D On 7 Jul., 23:11, Chris Hartjes [EMAIL PROTECTED] wrote: On 7/7/07, citrus [EMAIL PROTECTED] wrote: I'm not sure, but in my opinion, ACL in Cake 1.2 doesn't work properly. Correct me if I'm wrong. I guess it's a matter of what you mean by it doesn't work properly. What parts of it are you having difficulty with? -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: Just build it, damnit! @TheBallpark -http://www.littlehart.net/attheballpark @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Does cakephp support transaction now?
Read the fucking manuall! if you want to use more models in your application read http://manual.cakephp.org/chapter/models On 8 Jul., 11:29, hi and hello [EMAIL PROTECTED] wrote: In my application I sometimes have more than one database actions in an action, but when read the cakephp's docs I found little about 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 -~--~~~~--~~--~--~---
Strange url's
Hi there, I was hoping someone can help me with this. I've developed a nice cake-based website which works just fine locally. However when i publish put the website online i get some really strange url's: www.mywebsite.com/chapters/view/1?CAKEPHP= For most of the site this is no problem (other then that it doesn't look that nice!) but the forms on my website just don't work as they should. My host: www.startlogic.com I really hope someone can help me out on this. Thanx! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Does cakephp support transaction now?
On 7/8/07, sTb [EMAIL PROTECTED] wrote: Read the fucking manuall! Wow what a word ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: UserDir Installation
The ~ is unix notation for home directory of, ie, in this case, home directory of ssharkey. It's standard notation for user_dir installations. In other words, the ~ is what clue's Apache to go look up that user's home directory (whereever it is) and then look in a specified directory (relative to home) for the content to serve. Thanks! -Scott francky06l wrote: Maybe the ~ character is screwing up the rewriting. Why not RewriteBase /ssharkey ? On Jul 8, 12:17 am, Scott Sharkey [EMAIL PROTECTED] wrote: Hi All, I'm trying a top-level installation into an apache UserDir. I've read the documentation, which says to put a RewriteBase directive in the /~user/public_html/.htaccess file. This does not seem to be working for me. Here's what I know: 1) Mod_Rewrite is loaded and working fine on the server. I have a cake install in the main server root which is working fine. 2) the server ishttp://devel.mysite.com, and that top level is a cake app. 3) I'm trying to create ahttp://devel.mysite.com/~ssharkeywhich is a copy of the above site (for devel/debugging). 4) I have unpacked a clean cake 1.1.15.5144 into /home/ssharkey/public_html, and have Apache UserDir public_html configured. 5) If I put an index.php in that /home/ssharkey/public_html, everthing works as expected. 6) I have added RewriteBase /~ssharkey as the 2nd line in /home/ssharkey/public_html/.htaccess (just after RewriteEngine on). This appears to be serving the raw content, but the css file is not being found, nor are any images or cake-generated links on the page. The apache log shows requests for /css/cake.generic.css, and files in /img. I would think these should be /~ssharkey/css/cake.generic.css, etc. Any suggestions would be welcomed! -scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Does cakephp support transaction now?
On 7/8/07, sTb [EMAIL PROTECTED] wrote: Read the fucking manuall! if you want to use more models in your application read http://manual.cakephp.org/chapter/models I don't think it was the most polite way of replying to the original poster, and besides you didn't understand his question. He asked how to handle atomic database transactions in CakePHP (for which I don't know the answer to), not how to use more than one model. - Gonzalo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
save 'modified' field doesn't update
Hey there, I'm executing the save() method on my model, but the 'modified' field in the database table simply doesn't update. It should update automatically, right? If so...what could be the cause of this? I'll be digging into the code shortly. Just want to hear what you have to say. Best, Antonie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from 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 generates Wrong query in PHP4?
Hello Samuel, I did it and now it works in php 4 and php 5. I posted this problem because previously, after replacing findByUserId with findByUser_Id it was giving an error like it was not finding user__id in table. However I am not capable of reproducing the problem. If it happens, I will post the error, (at most I will use find( $criteria = 'user_id' = $user_id ) ) Thanks - Michele On Jul 7, 11:50 pm, Samuel DeVore [EMAIL PROTECTED] wrote: I am fairly sure that in php 4 you have to do FindByUser_Id I know this used to be the case due to limitations in php 4 seehttps://trac.cakephp.org/ticket/1567for a ticket on the manual for this. I hope that one of the Cake Devs can confirm or deny this Sam D On 7/7/07, M [EMAIL PROTECTED] wrote: CakePHP version: : 1.1.15.5144. Hello, the Bankaccount model belongs to User model. Now, in BankaccountsController::view method I have this statement: $data = $this-Bankaccount-findByUserId( $user_id ); In PHP 5 it works fine. In PHP 4.4.7 it gives this error: Query: SELECT `Bankaccount`.`id`, `Bankaccount`.`user_id`, `Bankaccount`.`credits`, `Bankaccount`.`created`, `Bankaccount`.`modified`, `User`.`id`, `User`.`username`, `User`.`password`, `User`.`name`, `User`.`email`, `User`.`telno`, `User`.`race`, `User`.`sex`, `User`.`level`, `User`.`hp`, `User`.`hpmax`, `User`.`str`, `User`.`strmax`, `User`.`dex`, `User`.`dexmax`, `User`.`int`, `User`.`intmax`, `User`.`cha`, `User`.`chamax`, `User`.`energy`, `User`.`credits`, `User`.`last_visit`, `User`.`group_id`, `User`.`active`, `User`.`token`, `User`.`created`, `User`.`modified` FROM `bankaccounts` AS `Bankaccount` LEFT JOIN `users` AS `User` ON (`Bankaccount`.`user_id` = `User`.`id`) WHERE `Bankaccount`.`userid` = 5 LIMIT 1 Warning: SQL Error: 1054: Unknown column 'Bankaccount.userid' in 'where clause' in ...cake/libs/model/datasources/dbo_source.php on line 463 Fatal error: Call to undefined method: bankaccount-onerror() in .../ cake/libs/model/datasources/dbo_source.php on line 596 have I done something wrong or there is an incompatibility? Thanks -- M -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cakephp generates Wrong query in PHP4?
Hello Samuel, I did it and now it works in php 4 and php 5. I posted this problem because previously, after replacing findByUserId with findByUser_Id it was giving an error like it was not finding user__id in table. However I am not capable of reproducing the problem. If it happens, I will post the error, (at most I will use find( $criteria = 'user_id' = $user_id ) ) Thanks - Michele On Jul 7, 11:50 pm, Samuel DeVore [EMAIL PROTECTED] wrote: I am fairly sure that in php 4 you have to do FindByUser_Id I know this used to be the case due to limitations in php 4 seehttps://trac.cakephp.org/ticket/1567for a ticket on the manual for this. I hope that one of the Cake Devs can confirm or deny this Sam D On 7/7/07, M [EMAIL PROTECTED] wrote: CakePHP version: : 1.1.15.5144. Hello, the Bankaccount model belongs to User model. Now, in BankaccountsController::view method I have this statement: $data = $this-Bankaccount-findByUserId( $user_id ); In PHP 5 it works fine. In PHP 4.4.7 it gives this error: Query: SELECT `Bankaccount`.`id`, `Bankaccount`.`user_id`, `Bankaccount`.`credits`, `Bankaccount`.`created`, `Bankaccount`.`modified`, `User`.`id`, `User`.`username`, `User`.`password`, `User`.`name`, `User`.`email`, `User`.`telno`, `User`.`race`, `User`.`sex`, `User`.`level`, `User`.`hp`, `User`.`hpmax`, `User`.`str`, `User`.`strmax`, `User`.`dex`, `User`.`dexmax`, `User`.`int`, `User`.`intmax`, `User`.`cha`, `User`.`chamax`, `User`.`energy`, `User`.`credits`, `User`.`last_visit`, `User`.`group_id`, `User`.`active`, `User`.`token`, `User`.`created`, `User`.`modified` FROM `bankaccounts` AS `Bankaccount` LEFT JOIN `users` AS `User` ON (`Bankaccount`.`user_id` = `User`.`id`) WHERE `Bankaccount`.`userid` = 5 LIMIT 1 Warning: SQL Error: 1054: Unknown column 'Bankaccount.userid' in 'where clause' in ...cake/libs/model/datasources/dbo_source.php on line 463 Fatal error: Call to undefined method: bankaccount-onerror() in .../ cake/libs/model/datasources/dbo_source.php on line 596 have I done something wrong or there is an incompatibility? Thanks -- M -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Digg (Pligg) CakePHP clone?
Hi everyone! Does anybody know some simple Digg/Pligg CMS clone written in CakePHP? I need to make something simmilard, but maybe somebody knows a good base for project like this? 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: Strange url's
Looks like the session id going along as a GET parameter, maybe you could start checking if you have disabled cookies. On 8 jul, 14:55, cakedude [EMAIL PROTECTED] wrote: Hi there, I was hoping someone can help me with this. I've developed a nice cake-based website which works just fine locally. However when i publish put the website online i get some really strange url's: www.mywebsite.com/chapters/view/1?CAKEPHP= For most of the site this is no problem (other then that it doesn't look that nice!) but the forms on my website just don't work as they should. My host:www.startlogic.com I really hope someone can help me out on this. Thanx! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Does cakephp support transaction now?
On 7/8/07, sTb [EMAIL PROTECTED] wrote: Read the fucking manuall! if you want to use more models in your application read http://manual.cakephp.org/chapter/models This will be the first and only warning, let it happen again and I will ban you. There is no reason to use this language in the group. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake, Ajax, and jquery
On 7/8/07, sTb [EMAIL PROTECTED] wrote: First of all,please google or use the search funktion for you question in the futur! And please read the fucking manual! ( http://manual.cakephp.org/chapter/controllers ) Goodbye... -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange url's
it could be that your install of php has the session.use_trans_sid setting to true, if you do not have access to the php.ini file your can try adding php_flag session.use_trans_sid Off to your .htaccess file and it should clear it up. Sam D On 7/8/07, Gorka [EMAIL PROTECTED] wrote: Looks like the session id going along as a GET parameter, maybe you could start checking if you have disabled cookies. On 8 jul, 14:55, cakedude [EMAIL PROTECTED] wrote: Hi there, I was hoping someone can help me with this. I've developed a nice cake-based website which works just fine locally. However when i publish put the website online i get some really strange url's: www.mywebsite.com/chapters/view/1?CAKEPHP= For most of the site this is no problem (other then that it doesn't look that nice!) but the forms on my website just don't work as they should. My host:www.startlogic.com I really hope someone can help me out on this. Thanx! -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Undefined Variable Problem
/ view */ div class=product form action=?php echo $html-url('/ShoppingCarts/add/'); ? method=post ?php echo $html-hidden('Product/id')? h2?php echo $product['Product']['name']?/h2 ?php echo $html-image('sundaymorning_cover.jpg', array('class' = 'product_img')); ? dl dt?php echo $product['Product']['name']? - $?php echo $product['Product']['price']?/dt ddQty. /dd dd?php echo $product['Product']['description']?/dd dd?php echo $html-submit('Add to Cart'); ?/dd /dl /form /div /*** stripped down controller ***/ ?php class ShoppingCartsController extends AppController { function add($id = null) { if(empty($this-data)) { $this-render(); } /* Line 12 */ $product_id = $this-$data['Product']['id']; $product = $this-Product-find(product_id = '$product_id'); $this-Session-write('Product', $product['Product']); $this-redirect('/shopping_carts/show/'); } } i keep getting a syntax error: Notice: Undefined variable: data in C:\apache2triad\htdocs\sonsofmaxwell\som\app\controllers \shopping_carts_controller.php on line 12 Fatal error: Cannot access empty property in C:\apache2triad\htdocs\sonsofmaxwell\som\app \controllers\shopping_carts_controller.php on line 12. anyone know why this error is being generated or perhaps what i'm doing wrong 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 -~--~~~~--~~--~--~---
Re: Undefined Variable Problem
change: $product_id = $this-$data['Product']['id']; to: $product_id = $this-data['Product']['id']; -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On 7/8/07, r557 [EMAIL PROTECTED] wrote: / view */ div class=product form action=?php echo $html-url('/ShoppingCarts/add/'); ? method=post ?php echo $html-hidden('Product/id')? h2?php echo $product['Product']['name']?/h2 ?php echo $html-image('sundaymorning_cover.jpg', array('class' = 'product_img')); ? dl dt?php echo $product['Product']['name']? - $?php echo $product['Product']['price']?/dt ddQty. /dd dd?php echo $product['Product']['description']?/dd dd?php echo $html-submit('Add to Cart'); ?/dd /dl /form /div /*** stripped down controller ***/ ?php class ShoppingCartsController extends AppController { function add($id = null) { if(empty($this-data)) { $this-render(); } /* Line 12 */ $product_id = $this-$data['Product']['id']; $product = $this-Product-find(product_id = '$product_id'); $this-Session-write('Product', $product['Product']); $this-redirect('/shopping_carts/show/'); } } i keep getting a syntax error: Notice: Undefined variable: data in C:\apache2triad\htdocs\sonsofmaxwell\som\app\controllers \shopping_carts_controller.php on line 12 Fatal error: Cannot access empty property in C:\apache2triad\htdocs\sonsofmaxwell\som\app \controllers\shopping_carts_controller.php on line 12. anyone know why this error is being generated or perhaps what i'm doing wrong 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 -~--~~~~--~~--~--~---
Re: Undefined Variable Problem
AHH, can't believe i missed that!!! On Jul 8, 2:12 pm, Larry E. Masters aka PhpNut [EMAIL PROTECTED] wrote: change: $product_id = $this-$data['Product']['id']; to: $product_id = $this-data['Product']['id']; -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On 7/8/07, r557 [EMAIL PROTECTED] wrote: / view */ div class=product form action=?php echo $html-url('/ShoppingCarts/add/'); ? method=post ?php echo $html-hidden('Product/id')? h2?php echo $product['Product']['name']?/h2 ?php echo $html-image('sundaymorning_cover.jpg', array('class' = 'product_img')); ? dl dt?php echo $product['Product']['name']? - $?php echo $product['Product']['price']?/dt ddQty. /dd dd?php echo $product['Product']['description']?/dd dd?php echo $html-submit('Add to Cart'); ?/dd /dl /form /div /*** stripped down controller ***/ ?php class ShoppingCartsController extends AppController { function add($id = null) { if(empty($this-data)) { $this-render(); } /* Line 12 */ $product_id = $this-$data['Product']['id']; $product = $this-Product-find(product_id = '$product_id'); $this-Session-write('Product', $product['Product']); $this-redirect('/shopping_carts/show/'); } } i keep getting a syntax error: Notice: Undefined variable: data in C:\apache2triad\htdocs\sonsofmaxwell\som\app\controllers \shopping_carts_controller.php on line 12 Fatal error: Cannot access empty property in C:\apache2triad\htdocs\sonsofmaxwell\som\app \controllers\shopping_carts_controller.php on line 12. anyone know why this error is being generated or perhaps what i'm doing wrong 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 -~--~~~~--~~--~--~---
Re: UserDir Installation
Then why not /home/ssharkey ? Tip: Try /cake/scripts/bake.php cake bake help Helps to set up things fast. Tip2: 1.2 version promising and highly stable, just FYI On Jul 8, 5:08 pm, Scott Sharkey [EMAIL PROTECTED] wrote: The ~ is unix notation for home directory of, ie, in this case, home directory of ssharkey. It's standard notation for user_dir installations. In other words, the ~ is what clue's Apache to go look up that user's home directory (whereever it is) and then look in a specified directory (relative to home) for the content to serve. Thanks! -Scott francky06l wrote: Maybe the ~ character is screwing up the rewriting. Why not RewriteBase /ssharkey ? On Jul 8, 12:17 am, Scott Sharkey [EMAIL PROTECTED] wrote: Hi All, I'm trying a top-level installation into an apache UserDir. I've read the documentation, which says to put a RewriteBase directive in the /~user/public_html/.htaccess file. This does not seem to be working for me. Here's what I know: 1) Mod_Rewrite is loaded and working fine on the server. I have a cake install in the main server root which is working fine. 2) the server ishttp://devel.mysite.com, and that top level is a cake app. 3) I'm trying to create ahttp://devel.mysite.com/~ssharkeywhichis a copy of the above site (for devel/debugging). 4) I have unpacked a clean cake 1.1.15.5144 into /home/ssharkey/public_html, and have Apache UserDir public_html configured. 5) If I put an index.php in that /home/ssharkey/public_html, everthing works as expected. 6) I have added RewriteBase /~ssharkey as the 2nd line in /home/ssharkey/public_html/.htaccess (just after RewriteEngine on). This appears to be serving the raw content, but the css file is not being found, nor are any images or cake-generated links on the page. The apache log shows requests for /css/cake.generic.css, and files in /img. I would think these should be /~ssharkey/css/cake.generic.css, etc. Any suggestions would be welcomed! -scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Outputting Session Data
in my function: function show() { $this-set('products', $this-Session-read('Product')); } i take the current session data and assign it to products. in the show view, this is the code: table ?php foreach ($products as $product): ? tr td?php echo $product['id']; ?/td td?php echo $product['name']; ?/td td?php echo $product['description']; ?/td td?php echo $product['price']; ?/td td?php echo $product['virtual']; ?/td td?php echo $product['active']; ?/td td?php echo $product['sort_order']; ?/td td?php echo $product['created']; ?/td td?php echo $product['modified']; ?/td /tr ?php endforeach; ? /table which i figure should loop through the variable i set. but i'm getting a wierd result. this is the source being generated: table tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td7/td td7/td td7/td td7/td td7/td td7/td td7/td td7/td td7/td /tr tr tdU/td tdU/td tdU/td tdU/td tdU/td tdU/td tdU/td tdU/td tdU/td /tr tr tdB/td tdB/td tdB/td tdB/td tdB/td tdB/td tdB/td tdB/td tdB/td /tr tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td2/td td2/td td2/td td2/td td2/td td2/td td2/td td2/td td2/td /tr tr td2/td td2/td td2/td td2/td td2/td td2/td td2/td td2/td td2/td /tr tr tdN/td tdN/td tdN/td tdN/td tdN/td tdN/td tdN/td tdN/td tdN/td /tr /table when doing a ?php print_r($products); ? in the view, it generates Array ( [id] = 1 [category_id] = 7 [name] = Uphill Battle [description] = Blah Blah Blah [price] = 1.00 [virtual] = 1 [active] = 1 [sort_order] = 1 [created] = 2007-06-24 13:59:27 [modified] = 2007-06-24 13:59:27 [image] = NONE ). so, how is this view generating such an odd result? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Does cakephp support transaction now?
Hello For CakePHP 1.2 you can use my model behavior http://bakery.cakephp.org/articles/view/transaction-behavior (Should work with most databases, though it was developed for MySQL innodb) If you do not wish to use it (Might be overkill for some people), you should be able to do just $this-ModelName-begin(); $this-ModelName-commit(); $this-ModelName-rollback(); Since the overloaded php4/5 model base class is using the magic method __call that just pass unknown commands for the model directly to the SQL server as a command --- Christian Jippi Winther http://docs.cakephp.nu (Unofficial CakePHP API) http://logs.cakephp.nu (Unofficial CakePHP IRC log) From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Larry E. Masters aka PhpNut Sent: 8. juli 2007 18:37 To: cake-php@googlegroups.com Subject: Re: Does cakephp support transaction now? On 7/8/07, sTb [EMAIL PROTECTED] wrote: Read the fucking manuall! if you want to use more models in your application read http://manual.cakephp.org/chapter/models This will be the first and only warning, let it happen again and I will ban you. There is no reason to use this language in the group. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL
On 7/8/07, sTb [EMAIL PROTECTED] wrote: Thanks but http://bakery.cakephp.org/articles/view/real-world-access-control is for 1.1 and i wrote i am on 1.2 but for beginners a very good article which explains the acl logic! Acl hasn't really changed in 1.2, so those links still apply. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: Just build it, damnit! @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: SWFUpload with CakePHP 1.1.x
Hi, I am about to cross this bridge now. I know that Flash does not use the same session as the browser, so you have to append the session id to the post url - I expect SWFUpload lets you specify the URL to upload files to - you need to append the session id to this, then there are some other posts that tell you how to hack the Cake core. http://groups.google.com/group/cake-php/browse_thread/thread/5cedbe5a1718e9ce/3924743d44746f42?lnk=gstq=swfuploadrnum=1 This is a big issue with Flash 8, not sure that it has been resolved for 9, but from what I have been reading recently, it ps a lot of people off. Glen On Jul 8, 1:52 am, NicoE [EMAIL PROTECTED] wrote: Hello everybody. I am using SWFUpload with CakePHP (based on the article written by James Revillini) and I have some problems regarding session issues. After uploading a file, the current session gets deleted. I have already read some articles about this problem and found that CakePHP handles sessions differently. Any ideas? Regards! Nicolas.- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
sqlite3
Anybody using cakephp with sqlite3? If so could you please outline the steps involved in adding sqlite3 support? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: UserDir Installation
Kunthar wrote: Then why not /home/ssharkey ? Guys, I appreciate the attempts to help, but the ~ssharkey syntax is dictated by Apache, and is NOT optional. That's what USERDIR means... Is there anyone out there who has made this kind of an installation and can offer some kind of authoritative answer? Tip: Try /cake/scripts/bake.php cake bake help Helps to set up things fast. Baking has NOTHING to do with the problem, but thanks. Sorry to sound a bit frustrated... I thought this was a relatively simple installation problem, but apparently there are not too many out there who have done this, I guess. Thanks -Scott Tip2: 1.2 version promising and highly stable, just FYI On Jul 8, 5:08 pm, Scott Sharkey [EMAIL PROTECTED] wrote: The ~ is unix notation for home directory of, ie, in this case, home directory of ssharkey. It's standard notation for user_dir installations. In other words, the ~ is what clue's Apache to go look up that user's home directory (whereever it is) and then look in a specified directory (relative to home) for the content to serve. Thanks! -Scott francky06l wrote: Maybe the ~ character is screwing up the rewriting. Why not RewriteBase /ssharkey ? On Jul 8, 12:17 am, Scott Sharkey [EMAIL PROTECTED] wrote: Hi All, I'm trying a top-level installation into an apache UserDir. I've read the documentation, which says to put a RewriteBase directive in the /~user/public_html/.htaccess file. This does not seem to be working for me. Here's what I know: 1) Mod_Rewrite is loaded and working fine on the server. I have a cake install in the main server root which is working fine. 2) the server ishttp://devel.mysite.com, and that top level is a cake app. 3) I'm trying to create ahttp://devel.mysite.com/~ssharkeywhichis a copy of the above site (for devel/debugging). 4) I have unpacked a clean cake 1.1.15.5144 into /home/ssharkey/public_html, and have Apache UserDir public_html configured. 5) If I put an index.php in that /home/ssharkey/public_html, everthing works as expected. 6) I have added RewriteBase /~ssharkey as the 2nd line in /home/ssharkey/public_html/.htaccess (just after RewriteEngine on). This appears to be serving the raw content, but the css file is not being found, nor are any images or cake-generated links on the page. The apache log shows requests for /css/cake.generic.css, and files in /img. I would think these should be /~ssharkey/css/cake.generic.css, etc. Any suggestions would be welcomed! -scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL
On 7/8/07, Chris Hartjes [EMAIL PROTECTED] wrote: Acl hasn't really changed in 1.2, so those links still apply. I beg do differ. The Tree Behavior has been introduced in ACL in 1.2 this makes it very much different. I myself tried to use the Real world access control article in 1.2 and it did diddley-squat. @sTb: Thanks for finding out the right way m8 !! And BTW I just filed a ticket on track about missing {} on the Tree Behavior, let's see if it gets fixed so we don't have problem inserting nodes under parents. I almost went crazy trying to find why a } that was on 2 of the UPDATE statements after inserting a child node to a parent... -- Gustavo Carreno --- If you know Red Hat you know Red Hat, If you know Slackware you know Linux --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Autocomplete options in 1.2 messes up my field.
Hey, Well I have been using an autocomplete field for quite some time and everything has worked fine. Although I just tried to add this onto the end 'afterUpdateElement' = 'getSelectionId') ?php echo $ajax-autocomplete('User.school_id', '/users/ autocomplete', array('afterUpdateElement' = 'getSelectionId')); ? /then i have this function to alert the user of the selection id script type=text/javascript function getSelectionId(text, li) { alert (li.id); } /script This is a very strange problem, everything works fine until I add that last bit, and a small grey line appears below the autocomplete field. I'm sure there is a simple fix to this, and my autocomplete view looks like this btw. I am trying to automatically input the ID of the selecton in the form. ul ?php foreach($schools as $school): ? li id=?php echo $school['School']['id'];??php echo $school['School']['name']. 'br / ' .'span class=informal'.$school['School']['city'].', ' . $school['School']['state']. '/span'; ? /li ?php endforeach; ? /ul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL
In 1.2 there is an AclBehavior, which I use to create Group Access. It is very simple to use. I am in the process of making a User Management Plugin for 1.2 which I am very nearly finished. However the basics of Acl in 1.2 have not changed. To use the behaviour it is as simple as using var $actsAs = array('Acl') and then you need a function called parentNode. Here is my entire Group model which allows me to provide Group based ACL. class Group extends UsersAppModel { var $name = 'Group'; var $actsAs = array('Acl'); /** * Finds the parent of the current Group ARO node. This function is required * for AclBehavior * * @return mixed null for root, int for other nodes */ function parentNode(){ if (!$this-id) { return null; } $data = $this-read(); if (!$data['Group']['parent_id']){ return null; } else { return $data['Group']['parent_id']; } } } You can also do the same for user level access on your user model. As i said, I will be posting an article on this soon, along with how to use the Auth component, both of which I rely on in my Users plugin, which will also be released very soon. Geoff -- http://lemoncake.wordpress.com On Jul 9, 7:35 am, Gustavo Carreno [EMAIL PROTECTED] wrote: On 7/8/07, Chris Hartjes [EMAIL PROTECTED] wrote: Acl hasn't really changed in 1.2, so those links still apply. I beg do differ. The Tree Behavior has been introduced in ACL in 1.2 this makes it very much different. I myself tried to use the Real world access control article in 1.2 and it did diddley-squat. @sTb: Thanks for finding out the right way m8 !! And BTW I just filed a ticket on track about missing {} on the Tree Behavior, let's see if it gets fixed so we don't have problem inserting nodes under parents. I almost went crazy trying to find why a } that was on 2 of the UPDATE statements after inserting a child node to a parent... -- Gustavo Carreno --- If you know Red Hat you know Red Hat, If you know Slackware you know Linux --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: SWFUpload with CakePHP 1.1.x
I tried hacking the Cake core but then I found that it´s not necessary. I solved it adding the line $this-Session-del('Config'). I found the info @ http://www.pagebakers.nl/2006/12/19/swfupload-part-ii Thanks anyway. On 8 jul, 16:49, Ski [EMAIL PROTECTED] wrote: Hi, I am about to cross this bridge now. I know that Flash does not use the same session as the browser, so you have to append the session id to the post url - I expect SWFUpload lets you specify the URL to upload files to - you need to append the session id to this, then there are some other posts that tell you how to hack the Cake core. http://groups.google.com/group/cake-php/browse_thread/thread/5cedbe5a... This is a big issue with Flash 8, not sure that it has been resolved for 9, but from what I have been reading recently, it ps a lot of people off. Glen On Jul 8, 1:52 am, NicoE [EMAIL PROTECTED] wrote: Hello everybody. I am using SWFUpload with CakePHP (based on the article written by James Revillini) and I have some problems regarding session issues. After uploading a file, the current session gets deleted. I have already read some articles about this problem and found that CakePHP handles sessions differently. Any ideas? Regards! Nicolas.-- Ocultar texto de la cita - - Mostrar texto de la cita - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Outputting Session Data
Because the print_r should be generating Array ([0] = Array([id] not just Array([id] Basically you only have one product in the session not multiple products, so when you go to do the loop, you are actually looping over the product details. Geoff -- http://lemoncake.wordpress.com On Jul 9, 5:04 am, r557 [EMAIL PROTECTED] wrote: in my function: function show() { $this-set('products', $this-Session-read('Product')); } i take the current session data and assign it to products. in the show view, this is the code: table ?php foreach ($products as $product): ? tr td?php echo $product['id']; ?/td td?php echo $product['name']; ?/td td?php echo $product['description']; ?/td td?php echo $product['price']; ?/td td?php echo $product['virtual']; ?/td td?php echo $product['active']; ?/td td?php echo $product['sort_order']; ?/td td?php echo $product['created']; ?/td td?php echo $product['modified']; ?/td /tr ?php endforeach; ? /table which i figure should loop through the variable i set. but i'm getting a wierd result. this is the source being generated: table tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td7/td td7/td td7/td td7/td td7/td td7/td td7/td td7/td td7/td /tr tr tdU/td tdU/td tdU/td tdU/td tdU/td tdU/td tdU/td tdU/td tdU/td /tr tr tdB/td tdB/td tdB/td tdB/td tdB/td tdB/td tdB/td tdB/td tdB/td /tr tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td td1/td /tr tr td2/td td2/td td2/td td2/td td2/td td2/td td2/td td2/td td2/td /tr tr td2/td td2/td td2/td td2/td td2/td td2/td td2/td td2/td td2/td /tr tr tdN/td tdN/td tdN/td tdN/td tdN/td tdN/td tdN/td tdN/td tdN/td /tr /table when doing a ?php print_r($products); ? in the view, it generates Array ( [id] = 1 [category_id] = 7 [name] = Uphill Battle [description] = Blah Blah Blah [price] = 1.00 [virtual] = 1 [active] = 1 [sort_order] = 1 [created] = 2007-06-24 13:59:27 [modified] = 2007-06-24 13:59:27 [image] = NONE ). so, how is this view generating such an odd result? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL
Hi Geoff I am looking forward to seeing your article. Regards, Langdon snip You can also do the same for user level access on your user model. As i said, I will be posting an article on this soon, along with how to use the Auth component, both of which I rely on in my Users plugin, which will also be released very soon. Geoff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Outputting Session Data
It seems that you only have one product object in session and you're looping through it as if there were many product objects in session. Thats why you're getting the weird results like U', B, N', etc. Its turning the words into an array and printing the first letter. Try this: function show() { $this-set('product', $this-Session- read('Product')); } table tr td?php echo $product['id']; ?/td td?php echo $product['name']; ?/td td?php echo $product['description']; ?/td td?php echo $product['price']; ?/td td?php echo $product['virtual']; ?/td td?php echo $product['active']; ?/td td?php echo $product['sort_order']; ?/td td?php echo $product['created']; ?/td td?php echo $product['modified']; ?/td /tr /table --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL
@Langdon It might be a few days yet, I've got payed work that tends to get in the way :). I will also see if I can get it submitted to the Bakery as it has better support for code listings than my freebie wordpress account. Geoff -- http://lemoncake.wordpress.com On Jul 9, 9:33 am, Langdon Stevenson [EMAIL PROTECTED] wrote: Hi Geoff I am looking forward to seeing your article. Regards, Langdon snip You can also do the same for user level access on your user model. As i said, I will be posting an article on this soon, along with how to use the Auth component, both of which I rely on in my Users plugin, which will also be released very soon. Geoff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL
Hi Geoff It might be a few days yet, I've got payed work that tends to get in the way :). I know the feeling :-) No hurry here, just interested to get a feel for the improvements to ACL and Cake in 1.2 I use ACL heavily at the moment in 1.1.x apps so am looking for good reasons to upgrade some of them. I really appreciate the effort that you and others on the list put into writing these articles, and want to show my support for your efforts. Regards, Langdon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: save 'modified' field doesn't update
Have you turned on debugging and checked what the generated SQL looks like, does it have the correct value? If not, then print out what data array before the save and check that its set. Failing that, post your code here. Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Struggling with creating a function and search an array then outputting data based upon results...
You could write a component for checking if the user_id is contained in the data array. So something like: ?php class VoteInfoComponent extends Object { function userVoted($data, $userid) { if (is_array($data) ) { foreach($data as $story) { foreach($story as $votes) { if ($votes['user_id'] == $userid) return 1; } } } return 0; } } ? I haven't tested the above! Include this in your controller and then call as $this-voteinfo-userVoted($data, 74); It would be easy to extend this to check if a user responsed to a particular story. Also you have an error in the following: ?php $user ? 'returnedtruecss' : 'returnedfalsecss'; ? should be ?php echo $user ? 'returnedtruecss' : 'returnedfalsecss'; ? Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake, Ajax, and jquery
Excuse me? I was responding to someone who was being ignorant to you. This was the second post I have read from this user who used the type of language he did in this post. That user was in no way affiliated with the project other than being a user like yourself. The goodbye was because I banned him from this list. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On 7/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I read the manual. It is a shame that you guys don't spend as much time writing thorough documentation as you do cursing at people that ask questions, sorry I didn't really grasp how much is automatic and how much I need to do by setting the layout or ajax parameters. In the future, just don't respond, that would be just fine. I'm new to the open source work, what a bunch of elitist jerks, I hope all open-source developers are not like this. On Jul 8, 11:41 am, Larry E. Masters aka PhpNut [EMAIL PROTECTED] wrote: On 7/8/07, sTb [EMAIL PROTECTED] wrote: First of all,please google or use the search funktion for you question in the futur! And please read the fucking manual! ( http://manual.cakephp.org/chapter/controllers ) Goodbye... -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Quick admin routes question
Gracias hellbot. W On Jul 8, 7:17 am, Hellbot [EMAIL PROTECTED] wrote: Router::connect('/admin/', array(CAKE_ADMIN = true, 'controller' = 'photos', 'action' = 'index')); 2007/7/8, [EMAIL PROTECTED] [EMAIL PROTECTED]: I need to route '/admin' to '/admin/photos/index' in my routes table. Is this possible? I'm using CakePHP admin routes. Router::connect('/admin', array('controller' = 'photos', 'action' = 'admin_index')); For me, it generates the 'Trying to access private method in class' error. I've read the manual and searched the group to find the answer but didn't locate it. I also tried: Router::connect('/admin', array('controller' = 'admin/photos', 'action' = 'index')); Among others. Anyone done this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Quick admin routes question
Hmmm. Actually I couldn't get this to work for me. Perhaps, it's because I'm on 1.2x. Anyone else got a way they do this? I'll dig in the source a bit. Thanks, Wilson On Jul 8, 7:17 am, Hellbot [EMAIL PROTECTED] wrote: Router::connect('/admin/', array(CAKE_ADMIN = true, 'controller' = 'photos', 'action' = 'index')); 2007/7/8, [EMAIL PROTECTED] [EMAIL PROTECTED]: I need to route '/admin' to '/admin/photos/index' in my routes table. Is this possible? I'm using CakePHP admin routes. Router::connect('/admin', array('controller' = 'photos', 'action' = 'admin_index')); For me, it generates the 'Trying to access private method in class' error. I've read the manual and searched the group to find the answer but didn't locate it. I also tried: Router::connect('/admin', array('controller' = 'admin/photos', 'action' = 'index')); Among others. Anyone done this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Struggling with creating a function and search an array then outputting data based upon results...
Hey mate! Thanks for your help but I solved the problem a couple of hours ago. What I did was first get the items, then I simply extracted the data, in this case the votes, from those items, then after that I set a variable to the funciton in_array. Then depending on the outcome of that the css file is set. Thanks for your help though ! On Jul 8, 5:21 pm, wralph [EMAIL PROTECTED] wrote: You could write a component for checking if the user_id is contained in the data array. So something like: ?php class VoteInfoComponent extends Object { function userVoted($data, $userid) { if (is_array($data) ) { foreach($data as $story) { foreach($story as $votes) { if ($votes['user_id'] == $userid) return 1; } } } return 0; }} ? I haven't tested the above! Include this in your controller and then call as $this-voteinfo-userVoted($data, 74); It would be easy to extend this to check if a user responsed to a particular story. Also you have an error in the following: ?php $user ? 'returnedtruecss' : 'returnedfalsecss'; ? should be ?php echo $user ? 'returnedtruecss' : 'returnedfalsecss'; ? Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Quick admin routes question
Ah, got it! Router::connect('/admin', array('controller'='photos','action'='index', CAKE_ADMIN = CAKE_ADMIN)); On 8 Jul, 21:30, wilson [EMAIL PROTECTED] wrote: Hmmm. Actually I couldn't get this to work for me. Perhaps, it's because I'm on 1.2x. Anyone else got a way they do this? I'll dig in the source a bit. Thanks, Wilson On Jul 8, 7:17 am, Hellbot [EMAIL PROTECTED] wrote: Router::connect('/admin/', array(CAKE_ADMIN = true, 'controller' = 'photos', 'action' = 'index')); 2007/7/8, [EMAIL PROTECTED] [EMAIL PROTECTED]: I need to route '/admin' to '/admin/photos/index' in my routes table. Is this possible? I'm using CakePHP admin routes. Router::connect('/admin', array('controller' = 'photos', 'action' = 'admin_index')); For me, it generates the 'Trying to access private method in class' error. I've read the manual and searched the group to find the answer but didn't locate it. I also tried: Router::connect('/admin', array('controller' = 'admin/photos', 'action' = 'index')); Among others. Anyone done 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 -~--~~~~--~~--~--~---
one to one (controller to model) ?
Hi There, Is a controller need to map one to one with a model ? Can I create a controller with no associated model ? Regards, Feris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: one to one (controller to model) ?
On 7/9/07, Feris Thia [EMAIL PROTECTED] wrote: Hi There, Is a controller need to map one to one with a model ? Can I create a controller with no associated model ? Yes you can. Just add var $uses = null; to your controller vars. Cheers, Gustavo Carreno --- If you know Red Hat you know Red Hat, If you know Slackware you know Linux --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: one to one (controller to model) ?
On 7/9/07, Gustavo Carreno [EMAIL PROTECTED] wrote: On 7/9/07, Feris Thia [EMAIL PROTECTED] wrote: Hi There, Is a controller need to map one to one with a model ? Can I create a controller with no associated model ? Yes you can. Just add var $uses = null; to your controller vars. Ah great... thank you Gustavo ! Cheers, Gustavo Carreno --- Regards, Feris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: one to one (controller to model) ?
On 7/9/07, Feris Thia [EMAIL PROTECTED] wrote: Ah great... thank you Gustavo ! You're welcome. But next time I'll wave the RTFM sign at you :) Cheers, Gustavo Carreno --- If you know Red Hat you know Red Hat, If you know Slackware you know Linux --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: one to one (controller to model) ?
On 7/9/07, Gustavo Carreno [EMAIL PROTECTED] wrote: On 7/9/07, Feris Thia [EMAIL PROTECTED] wrote: Ah great... thank you Gustavo ! You're welcome. But next time I'll wave the RTFM sign at you :) Ah that words. Ok, next time only if the manual doesn't have any solution then I'll posted here. Again, Thanks Gustavo! You're my man :) Cheers, Gustavo Carreno --- Regards, Feris If you know Red Hat you know Red Hat, If you know Slackware you know Linux --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---