create has many link
hi folks, i have tables with 'has many' relationship. *tables* CREATE TABLE `categories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `category` varchar(255) NOT NULL, PRIMARY KEY (`id`)); CREATE TABLE `products` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `category_id` int(11) NOT NULL, PRIMARY KEY (`id`)); i want to create the link in view if someone click categories (in the left sidebar) it will show the products that have categories that have been clicked. any idea, suggestion to achieve this in cakephp? thank you very much in advance best regards -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Add items to category
hi I have two tables` items and categories /categories/ id title description /items/ id title description category_id and i want to create a function addItems, that will allow me to add items to categories, sounds too simple. Can anyone help? -- View this message in context: http://cakephp.1045679.n5.nabble.com/Add-items-to-category-tp5714898.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: odd results from auth redirect
Should the AuthComponent properties and options be declared in the targeted controller (UsersController in my case) or the AppController? Or should it make no difference? I have Auth configured in my AppController and the settings _seem_ to be ignored no matter how I alter them. Also, I notice that the beforeSave function in the User model was defined differently in the ACL tutorial and Auth tutorial. Which one is the prefered method? Thanx again, McS Server Software Apache/2.2.22 (Win32) PHP/5.4.14 CAKE_VERSION 2.3.4 public function beforeSave($options = array()) { // from acl tutorial $this-data['User']['password'] = AuthComponent::password($this-data['User']['password']); return true; } // end beforeSave($options = array()) from acl tutorial public function beforeSave($options = array()) { // from auth tutorial if (isset($this-data[$this-alias]['password'])) { $this-data[$this-alias]['password'] = AuthComponent::password($this-data[$this-alias]['password']); } return true; } // end beforeSave($options = array()) from auth tutorial On Wednesday, May 8, 2013 12:27:14 PM UTC-4, McScreech wrote: Been following the acl and auth tutorials and appear to be near working except for AuthComponent loginRedirect and logoutRedirect properties. Very bare-bones setup as listed below. Watching the DebugKit.Toolbar output I note the following: 1) on the users/login page Session Auth redirect is /pages/home, no user defined 2) form accepts username and password provided and redirects to /pages/home, Session Auth user and activeUser are defined correctly 3) also clicking the users/logout link on that page redirects to /users/login page with same conditions as 1) But I expected my setup below to assign the loginRedirect to /lots/index and logoutRedirect to /pages/home? What did I miss? MTIA, McS Server Software Apache/2.2.22 (Win32) PHP/5.4.14 CAKE_VERSION 2.3.4 ?php Controller/AppController.php: public $components = array('DebugKit.Toolbar', 'Session', 'Acl', 'Auth' = array( 'authorize'= array('Actions' = array('actionPath' = 'controllers'), 'Controller' = array('actionPath' = 'controllers')), 'loginAction'= array('controller' = 'users', 'action' = 'login'), 'loginRedirect'= array('controller' = 'lots', 'action' = 'index'), 'logoutRedirect'= array('controller' = 'pages', 'action' = 'home') ) ); public $helpers = array('Html', 'Form', 'Session'); public function beforeFilter() { // Configure AuthComponent $this-Auth-allow('login', 'logout', 'display', 'search'); // Remember user who is logged in, $this-set('activeUser', $this-Auth-user()); } // end beforeFilter() Controller/UsersController.php: public function login() { if ($this-request-is('post')) { if ($this-Auth-login()) { $this-redirect($this-Auth-redirect()); } else { $this-Session-setFlash('Your username or password was incorrect.'); } } } // end login() public function logout() { $this-Session-setFlash('Good-Bye'); $this-redirect($this-Auth-logout()); // from auth tutorial } // end logout() /View/Users/login.ctp: div class=users form ?php echo $this-Form-create('User', array('action' = 'login')); ? fieldset legendLogin/legend ?php echo $this-Form-input('username', array( 'style' = 'width: 15em; padding: 2px;' )); echo $this-Form-input('password', array( 'style' = 'width: 15em; padding: 2px;' )); ? /fieldset ?php echo $this-Form-submit('Login'); echo $this-Form-end(); ? /div !-- class=users form -- -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: WorldPay component
https://github.com/LubosRemplik/CakePHP-WorldPay-Plugin On Thursday, April 22, 2010 2:25:07 PM UTC+2, Alex Bovey wrote: Hi all, Does anyone know of a WorldPay component available for CakePHP? All I've really found is bakepay which doesn't seem to be complete: http://cakeforge.org/projects/bakepay/ Thanks all, Alex Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake...@googlegroups.comjavascript: To unsubscribe from this group, send email to cake-php+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Add items to category
You can try to use a console command like: cake bake and use it to generate the respectives MVC - automagic ;) if your database is following the conversation, you will not have problems. 2013/5/13 Lilit lilitbaku...@gmail.com hi I have two tables` items and categories /categories/ id title description /items/ id title description category_id and i want to create a function addItems, that will allow me to add items to categories, sounds too simple. Can anyone help? -- View this message in context: http://cakephp.1045679.n5.nabble.com/Add-items-to-category-tp5714898.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: odd results from auth redirect
OK, I now seem to have success by destroying all session data in login function _before_ logging in (shown below). Am I violating any cakePHP conventions in doing so? Or perhaps simply clearing some default setting that I have been overlooking so far? Thanx, McS Server Software Apache/2.2.22 (Win32) PHP/5.4.14 CAKE_VERSION 2.3.4 UsersController.php: public function login() { $this-Session-destroy(); // attempt to clear session data before login if ($this-request-is('post')) { if ($this-Auth-login()) { return $this-redirect($this-Auth-redirectUrl()); // from Auth tutorial } else { $this-Session-setFlash('Your username or password was incorrect.'); } } } // end login() On Wednesday, May 8, 2013 12:27:14 PM UTC-4, McScreech wrote: Been following the acl and auth tutorials and appear to be near working except for AuthComponent loginRedirect and logoutRedirect properties. Very bare-bones setup as listed below. Watching the DebugKit.Toolbar output I note the following: 1) on the users/login page Session Auth redirect is /pages/home, no user defined 2) form accepts username and password provided and redirects to /pages/home, Session Auth user and activeUser are defined correctly 3) also clicking the users/logout link on that page redirects to /users/login page with same conditions as 1) But I expected my setup below to assign the loginRedirect to /lots/index and logoutRedirect to /pages/home? What did I miss? MTIA, McS Server Software Apache/2.2.22 (Win32) PHP/5.4.14 CAKE_VERSION 2.3.4 ?php Controller/AppController.php: public $components = array('DebugKit.Toolbar', 'Session', 'Acl', 'Auth' = array( 'authorize'= array('Actions' = array('actionPath' = 'controllers'), 'Controller' = array('actionPath' = 'controllers')), 'loginAction'= array('controller' = 'users', 'action' = 'login'), 'loginRedirect'= array('controller' = 'lots', 'action' = 'index'), 'logoutRedirect'= array('controller' = 'pages', 'action' = 'home') ) ); public $helpers = array('Html', 'Form', 'Session'); public function beforeFilter() { // Configure AuthComponent $this-Auth-allow('login', 'logout', 'display', 'search'); // Remember user who is logged in, $this-set('activeUser', $this-Auth-user()); } // end beforeFilter() Controller/UsersController.php: public function login() { if ($this-request-is('post')) { if ($this-Auth-login()) { $this-redirect($this-Auth-redirect()); } else { $this-Session-setFlash('Your username or password was incorrect.'); } } } // end login() public function logout() { $this-Session-setFlash('Good-Bye'); $this-redirect($this-Auth-logout()); // from auth tutorial } // end logout() /View/Users/login.ctp: div class=users form ?php echo $this-Form-create('User', array('action' = 'login')); ? fieldset legendLogin/legend ?php echo $this-Form-input('username', array( 'style' = 'width: 15em; padding: 2px;' )); echo $this-Form-input('password', array( 'style' = 'width: 15em; padding: 2px;' )); ? /fieldset ?php echo $this-Form-submit('Login'); echo $this-Form-end(); ? /div !-- class=users form -- -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cake 3.0
I personally didn't bother to upgrade any production sites from 1.3 to 2 - I just started over. I found that it took just as long to convert my existing custom code than just to do it over again. I will likely do the same when 3 comes out: develop future projects in 3, maintain current ones with the current version. On Sunday, May 12, 2013 12:44:48 PM UTC-7, advantage+ wrote: Yes I would have to agree with you. Rather harsh but ohh well. It will be fun upgrading to 3. All I wanted to know was if they have 3.x in development maybe there was a way to get a jump on the change over. Something that might be backwards compatible. Still works in 2.x but in 3.x it will be this way just to get a jump start rather than waiting till the release and saying ohh wow now I need to re-do everything again. *From:* cake...@googlegroups.com javascript: [mailto: cake...@googlegroups.com javascript:] *On Behalf Of *Jamie *Sent:* Sunday, May 12, 2013 3:33 AM *To:* cake...@googlegroups.com javascript: *Subject:* Re: Cake 3.0 If not it's your code that sucks - that's a little harsh, don't you think? Sure doesn't reflect well on the professionalism of CakeDC. Upgrading from 1.3 to 2.0 is time consuming and tedious, especially for large projects. The upgrade shell helps but by no means does all the work. Going from 2 to 3 will likely be difficult as well given that the model layer is being re-written. On Saturday, May 11, 2013 5:10:30 AM UTC-7, Florian Krämer wrote: Write clean code, follow the CakePHP coding standards and use the API correcty and upgrading will be easy as it ever was in the past. CakePHP was always easy to upgrade, if not it's your code that sucks and needs a refactor anyways. On Saturday, May 11, 2013 5:37:02 AM UTC+2, advantage+ wrote: Is there any date set / expected? Is there anything we can do to current sites to anticipate the new release to get ahead of the changes? Thanks, Dave This email may contain material that is confidential, privileged and/or work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. Cake Development Corporation. -- 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+u...@googlegroups.com javascript:. To post to this group, send email to cake...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Cache Initiation
When and where during application startup does the Cache get initiated and the $_map property of App.php get set? I can't figure out where this gets initiated and a lot of my paths are misconfigured when I run a console shell. Its probably some weird configuration I have incorrectly set so I want to see how those paths that are being set in $_map are being set. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Best practice: Record associated to one or all
Hi What is the best practice to store records which are either related to one parent OR to all parents? Related to one is clear (set parent_id to id), but which method is the better approach: Set parent_id to 0 to make the record available to all parents or set it to null and make a global switch (tinyint 0/1)? In real life a document can belong to one company OR (not at the same time) to all companies. What would you do? Thanks, Frank -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to test the database connection?
You can also use a try/catch block, which detects if is possible to establish a database connection: try { ConnectionManager::getDataSource('default'); } catch(Exception *$e*){ $e-getMessage(); // or any action you need here } -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cake 3.0
As CakePHP is an open source project you can follow the development of 3.0 from the branch in the git repository - https://github.com/cakephp/cakephp/tree/3.0 I'm sure Florian didn't mean to sound out of line, he just has high expectations about anyone's code conforming to an acceptable level of quality. It's one of the key reasons he's on the team at CakeDC. On Sunday, May 12, 2013 9:44:48 PM UTC+2, advantage+ wrote: Yes I would have to agree with you. Rather harsh but ohh well. It will be fun upgrading to 3. All I wanted to know was if they have 3.x in development maybe there was a way to get a jump on the change over. Something that might be backwards compatible. Still works in 2.x but in 3.x it will be this way just to get a jump start rather than waiting till the release and saying ohh wow now I need to re-do everything again. *From:* cake...@googlegroups.com javascript: [mailto: cake...@googlegroups.com javascript:] *On Behalf Of *Jamie *Sent:* Sunday, May 12, 2013 3:33 AM *To:* cake...@googlegroups.com javascript: *Subject:* Re: Cake 3.0 If not it's your code that sucks - that's a little harsh, don't you think? Sure doesn't reflect well on the professionalism of CakeDC. Upgrading from 1.3 to 2.0 is time consuming and tedious, especially for large projects. The upgrade shell helps but by no means does all the work. Going from 2 to 3 will likely be difficult as well given that the model layer is being re-written. On Saturday, May 11, 2013 5:10:30 AM UTC-7, Florian Krämer wrote: Write clean code, follow the CakePHP coding standards and use the API correcty and upgrading will be easy as it ever was in the past. CakePHP was always easy to upgrade, if not it's your code that sucks and needs a refactor anyways. On Saturday, May 11, 2013 5:37:02 AM UTC+2, advantage+ wrote: Is there any date set / expected? Is there anything we can do to current sites to anticipate the new release to get ahead of the changes? Thanks, Dave This email may contain material that is confidential, privileged and/or work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. Cake Development Corporation. -- 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+u...@googlegroups.com javascript:. To post to this group, send email to cake...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- This email may contain material that is confidential, privileged and/or work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. Cake Development Corporation. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cake 3.0
Upgrading from 1.x to any 2.x is doable and really not that big of a deal. Mostly preg_replacing which can be automated, and some other stuff like renaming/folderstructure which also can also be automated. I use an extended upgrade shell for this - and it takes me less than 10% of the time it needed otherwise. Only some things need to be adjusted manually. But the migration guides help you here. So I dont really see the issue if you got a few days (for larger projects) - they will be worth it (think about all the improvements). You just can't expect it to work within 1 hour. Upgrading to 3.x might be a little bit more difficult. Most upgrades will also be doable with the same approaches above. Some might not. But 3.x will be a complete rewrite of model layer for example. So what would one expect? Lets just wait until it becomes clearer - and less theoretical Also, keeping in mind what will be deprecated, and what features will persist and be improved helps to code apps future-proof One aspect that came up in the past: query strings instead of named params. I wrote about it a few days back. If you - like me - start writing new apps with the 3.x way of how its done - the potential upgrade will be far less complicated. And there is usually a good reason why some things change over time and will be more important/correct in future versions. No need to cling to stuff that will not be supported or is already clear to be dropped. So you can write clean and DRY code. You can also stay up to date and use best practice approaches and switch from deprecated to new ways of doing it. Then, upgrading will be kinda quick, easy and fun. Having to recode a whole mess of code at once isn't, though. Am Montag, 13. Mai 2013 19:11:35 UTC+2 schrieb Jamie: I personally didn't bother to upgrade any production sites from 1.3 to 2 - I just started over. I found that it took just as long to convert my existing custom code than just to do it over again. I will likely do the same when 3 comes out: develop future projects in 3, maintain current ones with the current version. On Sunday, May 12, 2013 12:44:48 PM UTC-7, advantage+ wrote: Yes I would have to agree with you. Rather harsh but ohh well. It will be fun upgrading to 3. All I wanted to know was if they have 3.x in development maybe there was a way to get a jump on the change over. Something that might be backwards compatible. Still works in 2.x but in 3.x it will be this way just to get a jump start rather than waiting till the release and saying ohh wow now I need to re-do everything again. *From:* cake...@googlegroups.com [mailto:cake...@googlegroups.com] *On Behalf Of *Jamie *Sent:* Sunday, May 12, 2013 3:33 AM *To:* cake...@googlegroups.com *Subject:* Re: Cake 3.0 If not it's your code that sucks - that's a little harsh, don't you think? Sure doesn't reflect well on the professionalism of CakeDC. Upgrading from 1.3 to 2.0 is time consuming and tedious, especially for large projects. The upgrade shell helps but by no means does all the work. Going from 2 to 3 will likely be difficult as well given that the model layer is being re-written. On Saturday, May 11, 2013 5:10:30 AM UTC-7, Florian Krämer wrote: Write clean code, follow the CakePHP coding standards and use the API correcty and upgrading will be easy as it ever was in the past. CakePHP was always easy to upgrade, if not it's your code that sucks and needs a refactor anyways. On Saturday, May 11, 2013 5:37:02 AM UTC+2, advantage+ wrote: Is there any date set / expected? Is there anything we can do to current sites to anticipate the new release to get ahead of the changes? Thanks, Dave This email may contain material that is confidential, privileged and/or work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. Cake Development Corporation. -- 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+u...@googlegroups.com. To post to this group, send email to cake...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- 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
RE: Cake 3.0
Its always easier said than done…. Dry it you just baked a cake site but all sites are unique. Not just add edit save and delete you have custom functions pulling out data from the models contain all that stuff. Migration will not touch that! From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of euromark Sent: Monday, May 13, 2013 8:27 PM To: cake-php@googlegroups.com Subject: Re: Cake 3.0 Upgrading from 1.x to any 2.x is doable and really not that big of a deal. Mostly preg_replacing which can be automated, and some other stuff like renaming/folderstructure which also can also be automated. I use an extended upgrade shell for this - and it takes me less than 10% of the time it needed otherwise. Only some things need to be adjusted manually. But the migration guides help you here. So I dont really see the issue if you got a few days (for larger projects) - they will be worth it (think about all the improvements). You just can't expect it to work within 1 hour. Upgrading to 3.x might be a little bit more difficult. Most upgrades will also be doable with the same approaches above. Some might not. But 3.x will be a complete rewrite of model layer for example. So what would one expect? Lets just wait until it becomes clearer - and less theoretical Also, keeping in mind what will be deprecated, and what features will persist and be improved helps to code apps future-proof One aspect that came up in the past: query strings instead of named params. I wrote about it a few days back. If you - like me - start writing new apps with the 3.x way of how its done - the potential upgrade will be far less complicated. And there is usually a good reason why some things change over time and will be more important/correct in future versions. No need to cling to stuff that will not be supported or is already clear to be dropped. So you can write clean and DRY code. You can also stay up to date and use best practice approaches and switch from deprecated to new ways of doing it. Then, upgrading will be kinda quick, easy and fun. Having to recode a whole mess of code at once isn't, though. Am Montag, 13. Mai 2013 19:11:35 UTC+2 schrieb Jamie: I personally didn't bother to upgrade any production sites from 1.3 to 2 - I just started over. I found that it took just as long to convert my existing custom code than just to do it over again. I will likely do the same when 3 comes out: develop future projects in 3, maintain current ones with the current version. On Sunday, May 12, 2013 12:44:48 PM UTC-7, advantage+ wrote: Yes I would have to agree with you. Rather harsh but ohh well. It will be fun upgrading to 3. All I wanted to know was if they have 3.x in development maybe there was a way to get a jump on the change over. Something that might be backwards compatible. Still works in 2.x but in 3.x it will be this way just to get a jump start rather than waiting till the release and saying ohh wow now I need to re-do everything again. From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf Of Jamie Sent: Sunday, May 12, 2013 3:33 AM To: cake...@googlegroups.com Subject: Re: Cake 3.0 If not it's your code that sucks - that's a little harsh, don't you think? Sure doesn't reflect well on the professionalism of CakeDC. Upgrading from 1.3 to 2.0 is time consuming and tedious, especially for large projects. The upgrade shell helps but by no means does all the work. Going from 2 to 3 will likely be difficult as well given that the model layer is being re-written. On Saturday, May 11, 2013 5:10:30 AM UTC-7, Florian Krämer wrote: Write clean code, follow the CakePHP coding standards and use the API correcty and upgrading will be easy as it ever was in the past. CakePHP was always easy to upgrade, if not it's your code that sucks and needs a refactor anyways. On Saturday, May 11, 2013 5:37:02 AM UTC+2, advantage+ wrote: Is there any date set / expected? Is there anything we can do to current sites to anticipate the new release to get ahead of the changes? Thanks, Dave This email may contain material that is confidential, privileged and/or work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. Cake Development Corporation. -- 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+u...@googlegroups.com. To post to this group, send email to cake...@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit
Re: searching users table with token = NULL
thanks Reuben,... after all,... (in case someone needs it) this works for me: this is my form: ?php echo $this-Form-create('User', array('url' = 'find', 'div' = false)); ? span style=float: left; text-align: left; margin: 20px 5px 0 5px; width: 100px; ?php $value = array('yes' = __('yes', true), 'no' = __('no', true)); ? ?php echo $this-Form-select('activated', $value, null, array('div' = false, 'empty' = 'activated' )) ? /span div style=float: left; text-align: left; margin: 0 0 0 20px; ?php echo $this-Form-end('Search', array('div' = false)); ? /div and here is the controller code: elseif(!empty($this-data['User']['activated'])) { $this-paginate = array('User' = array('conditions' = array('User.token IS' . ($this-data['User']['activated'] == 'yes' ? '' : ' NOT') . ' ' . 'NULL' ), 'limit' = 24, 'order' = array('User.created' = 'DESC'))); $users = $this-paginate('User'); $this-set('users', $users); } the cake is Rocks !!! On Friday, May 10, 2013 8:09:39 PM UTC-7, Reuben wrote: I would advise expanding that condition code, as it's hard to read. Or just arrange it a bit differently. Currently, you'll end up with User.token LIKE IS NULL or User.token LIKE NULL, and neither of those will work with regular SQL. CakePHP is smart enough to recognise equality or inequality with nulls, so you could do the following: $this-paginate = array('User' = array('conditions' = array('User.token ' . $this-data['User']['activated'] == 'yes' ? '' : '!=' = NULL ))); Essentially, this determines what operator to use, depending on User.activated. A value of yes results in equality with null, otherwise inequality with null, and CakePHP will correctly result in User.token IS NULL or User.token IS NOT NULL. Regards Reuben Helms On Thursday, 9 May 2013 20:37:15 UTC+10, Chris wrote: hi guys,... can anyone help please,... I trying to search users table werther's user token IS NULL or NOT (what it means is user activated, confirmed or not) having some problem with coding,... $this-paginate = array('User' = array('conditions' = array('User.token LIKE'='IS'.($this-data['User']['activated'] == 'yes' ? '' : 'NOT') . ' NULL' ))); thanks in advance chris -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Cake 3.0
Nothing is forcing you to upgrade. When 3.x lands, you don't need to take your legacy site and make it 3.x compatible. Just run a legacy site on a legacy version of cake. I really hope that the Cake devs don't hold back on cool new stuff in the name of backwards compatibility - that would be a shame. On Tue, May 14, 2013 at 10:36 AM, Advantage+ movepix...@gmail.com wrote: Its always easier said than done…. ** ** Dry it you just baked a cake site but all sites are unique. Not just add edit save and delete you have custom functions pulling out data from the models contain all that stuff. Migration will not touch that! ** ** *From:* cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] *On Behalf Of *euromark *Sent:* Monday, May 13, 2013 8:27 PM *To:* cake-php@googlegroups.com *Subject:* Re: Cake 3.0 ** ** Upgrading from 1.x to any 2.x is doable and really not that big of a deal. Mostly preg_replacing which can be automated, and some other stuff like renaming/folderstructure which also can also be automated. I use an extended upgrade shell for this - and it takes me less than 10% of the time it needed otherwise. Only some things need to be adjusted manually. But the migration guides help you here. So I dont really see the issue if you got a few days (for larger projects) - they will be worth it (think about all the improvements). You just can't expect it to work within 1 hour. ** ** Upgrading to 3.x might be a little bit more difficult. Most upgrades will also be doable with the same approaches above. Some might not. But 3.x will be a complete rewrite of model layer for example. So what would one expect? Lets just wait until it becomes clearer - and less theoretical ** ** Also, keeping in mind what will be deprecated, and what features will persist and be improved helps to code apps future-proof One aspect that came up in the past: query strings instead of named params. I wrote about it a few days back. If you - like me - start writing new apps with the 3.x way of how its done - the potential upgrade will be far less complicated. And there is usually a good reason why some things change over time and will be more important/correct in future versions. No need to cling to stuff that will not be supported or is already clear to be dropped. ** ** So you can write clean and DRY code. You can also stay up to date and use best practice approaches and switch from deprecated to new ways of doing it. Then, upgrading will be kinda quick, easy and fun. Having to recode a whole mess of code at once isn't, though. Am Montag, 13. Mai 2013 19:11:35 UTC+2 schrieb Jamie: I personally didn't bother to upgrade any production sites from 1.3 to 2 - I just started over. I found that it took just as long to convert my existing custom code than just to do it over again. I will likely do the same when 3 comes out: develop future projects in 3, maintain current ones with the current version. On Sunday, May 12, 2013 12:44:48 PM UTC-7, advantage+ wrote: Yes I would have to agree with you. Rather harsh but ohh well. It will be fun upgrading to 3. All I wanted to know was if they have 3.x in development maybe there was a way to get a jump on the change over. Something that might be backwards compatible. Still works in 2.x but in 3.x it will be this way just to get a jump start rather than waiting till the release and saying ohh wow now I need to re-do everything again. *From:* cake...@googlegroups.com [mailto:cake...@googlegroups.com] *On Behalf Of *Jamie *Sent:* Sunday, May 12, 2013 3:33 AM *To:* cake...@googlegroups.com *Subject:* Re: Cake 3.0 If not it's your code that sucks - that's a little harsh, don't you think? Sure doesn't reflect well on the professionalism of CakeDC. Upgrading from 1.3 to 2.0 is time consuming and tedious, especially for large projects. The upgrade shell helps but by no means does all the work. Going from 2 to 3 will likely be difficult as well given that the model layer is being re-written. On Saturday, May 11, 2013 5:10:30 AM UTC-7, Florian Krämer wrote: Write clean code, follow the CakePHP coding standards and use the API correcty and upgrading will be easy as it ever was in the past. CakePHP was always easy to upgrade, if not it's your code that sucks and needs a refactor anyways. On Saturday, May 11, 2013 5:37:02 AM UTC+2, advantage+ wrote: Is there any date set / expected? Is there anything we can do to current sites to anticipate the new release to get ahead of the changes? Thanks, Dave This email may contain material that is confidential, privileged and/or work product for the sole use of the intended recipient. Any review, reliance or distribution by
Error message
Hi to all, how can we display error messages only one box for user form in cakephp 2.0 -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Best place for a SoapClient?
Hi I am trying to include a really complex php5 SoapClient interface with tons of objects and methods in my cake app. What do you think is the best place for the code? Controller, component, model or a DBSource? The code must not be reusable, because its very specific. Thank you for pushing me into the right direction, Frank -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.