Cake 3 Cookie - not persistent
Hello, I think I must be missing something simple. On just a simple view action in the controller: $this-loadComponent('Cookie'); $this-Cookie-config('path', '/'); $this-Cookie-config([ 'expires' = '+10 days', 'httpOnly' = true ]); $this-Cookie-write('name', 'Larry'); echo $this-Cookie-read('name'); This works and displays the value. However after commenting out the 7th line that writes the value and then a refresh, nothing is displayed. What am I missing?? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
weirdness / jquery / ajax
In controller: function new_list() { Configure::write('debug', 0); $this-autoRender = false; $this-loadModel('Menugroup'); $this-Menugroup-recursive = 1; if($this-RequestHandler-isAjax()) { $menugroups = $this-Menugroup-find('list', array('order' = array('Menugroup.order DESC'))); $result = json_encode($menugroups); // echo $result; $this-set('result', $result); } } In Jquery: $('.new_list-link').click( function () { $.post('/menus/new_list', function(result) { $('#menu_list').html(result); }); }); I get an empty list unless I uncomment that echo statement in the controller, then it works great. Why would this make a difference or even be necessary? Thanks!! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: weirdness / jquery / ajax
Thanks for the reply. If I pull the echo $result out of the controller and insert it into the view, I'm back to an empty string. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: weirdness / jquery / ajax
Working now. Thanks very much, Teddy! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
query inside model
I know I must be missing something very simple... This works in the controller: function indexadvertising($id = null) { $this-set('image_id', $this-Workpiece-query(SELECT * FROM `workpieces` WHERE work_id = 3 ORDER BY `adorder`) ); } I am trying to move the SQL out of the controller and into the model but this just returns a SQL error that my syntax is incorrect (even though the query statement is the same in both places.) This fails: In Model: function returnAdvertising() { $this-query(SELECT * FROM `workpieces` WHERE work_id = 3 ORDER BY `adorder`); } In Controller: function indexadvertising($id = null) { $this-set('image_id', $this-Workpiece-returnAdvertising() ); } Warning (512): SQL Error: 1064: You have an error in your SQL syntax; Any advice is very much appreciated. Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: query inside model
Bogdan, thanks for the reply. I agree... Probably should rethink all of it to avoid any custom queries. Still curious why it isn't working. Here is more info: $sql= returnAdvertising $error = 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'returnAdvertising' at line 1 $out= null [CORE/cake/libs/model/datasources/dbo_source.php, line 681] thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: htaccess problems.
Thanks mate! You saved me... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---