Re: Pretty URLs don't work without .htaccess ?
Some web hosting companies do not allow the use of htaccess on shared servers, and sometimes they allow you to use it on linux machines not windows! I think Marcelo has the right answer for this kind of situation 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-php@googlegroups.com 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?hl=en
Re: Trigger howto
AFAIK, triggers in MySQL do not behave like a bomb(timer), I may be wrong, but this is what I know so far! As for the solution of your problem, I think every time a new user registers, do a simple query to delete the old registered users that are not activated yet and where there registration date is more than 24 hours ago... just keep it simple man. have a nice baking day On Jan 20, 9:08 am, amarradi radis...@googlemail.com wrote: Hello, i need nelp by development an trigger. I've an app were you can get an registration. So if you ask for one you get an email with a link an the status is reserve. If you don't click the link in the next 24h you will no be registrated. Your reservation is killed ;) The first time i think i do the job direct on the MySQL Database. But the Problem i don't have rights on the webspace from my shared hoster. What can i do to trigger it? many greetings Marcus Radisch 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-php@googlegroups.com 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?hl=en
Re: highest traffic cakePHP 1.2 sites?
just trust cake... because it deserves On Jan 17, 7:38 am, keymaster ad...@optionosophy.com wrote: So far, the short list of cake's absolutely largest known sites, is: addons.mozilla.com == ranked 308 worldwide by alexa:http://www.alexa.com/siteinfo/mozilla.org#trafficstats (rumored to be changing to a python based platform). hotscripts.com == ranked 2,022 worldwide by alexa:http://www.alexa.com/siteinfo/hotscripts.com mitfahrgelegenheit.de == averaging over 1.1 million page views/day- not ranked by alexa since it's in Germany rekentuin.nl == averaging over 600K page views/day Any other takers? On Jan 15, 12:58 am, Miles J mileswjohn...@gmail.com wrote: Oh I also forgot, Hotscripts runs Cake. http://hotscripts.com On Jan 14, 12:19 am, Matt Bianco msied...@mfz24.de wrote: It's a German car pooling / ride sharing platform:www.mitfahrgelegenheit.de Thanks to cake we can easily do our roll outs to other countries (e.g.www.pamemazi.grwhereweare already live), others will follow in the next weeks. On 13 Jan., 13:41, Jon Bennett jmbenn...@gmail.com wrote: We serve 35M PVs (2M visits) per month. Who/what is 'we'? j -- jon bennett -www.jben.net-blog.jben.net 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-php@googlegroups.com 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?hl=en
Re: CakePHP 1.3-beta has landed
It takes very few minutes to upgrade from 1.3-alfa to 1.3-beta. On Jan 17, 3:15 pm, red mbu...@gmail.com wrote: As always, thank you and keep up good work! On 17 Sty, 05:25, mark_story mark.st...@gmail.com wrote: The CakePHP development team is happy to announce the release the CakePHP 1.3-beta. We've been hard at work implementing new features and fixing issues in existing features in the 1.3 branch. Since 1.3- alpha there have been more than 600 commits and more than 43 tickets have been closed. A number of new features have been implemented most notably, Model virtualFields[1], changes to the plugin and theme assets [2], improvements to TimeHelpers ability to output i18n friendly formats, and a refactored test suite harness[3]. When upgrading to 1.3-beta it is recommended that you replace app/webroot/test.php with the one in the repository and check out the Migration Guide[4] as well as the new features guides [5] for changed and new features in 1.3. In other project news, all the previous stable release points for 1.2 have been retagged and are available in github. We've brought on two new team members in the past few months as well, both ADmad, and jose_zap have joined the CakePHP team and are helping with all aspects of the project. Moving forward with 1.3 we are not planning on adding changes that break backwards compatibility. Any methods currently generating errors will be removed in the first Release Candidate. It is important that you listen to the warnings, as they will become fatal errors in the future. If you would like to help with the ongoing development of 1.3, you can do so in a number of ways. Firstly, filing clear and concise tickets for any issues helps get the issues resolved quickly. Secondly, you can also contribute by forking the CakePHP project on github and implementing fixes, tests cases and features on your forks. You can use pull requests or tickets to notify core team members about your changes. Finally, we'd like to thank you the community for the their greatly increased and ongoing support and contributions. Since our move to github and lighthouse the volume of community contributions has had a dramatic increase, and we'd like to thank the many contributors for their help in improving CakePHP. Download a packaged release [6] View the changelog [7] [1]http://cakephp.lighthouseapp.com/projects/42648/13-new-features-virtu... [2]http://cakephp.lighthouseapp.com/projects/42648/13-new-features-plugi... [3]http://cakephp.lighthouseapp.com/projects/42648/1-3-new-features-test... [4]http://cakephp.lighthouseapp.com/projects/42648/13-migration-guide [5]http://cakephp.lighthouseapp.com/projects/42648/13-new-features [6]http://github.com/cakephp/cakephp1x/downloads [7]http://cakephp.lighthouse.com/projects/42648/changelog-1-3-0-beta 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-php@googlegroups.com 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?hl=en
Re: Auth Permission Based System
Solution is not very simple like 5 min minimal setup, and is not really complex as ACL is! 5 min is very weak because it is hard-coded (bad coding) ACL is an overkill as you know, especially if it is not for a record- level-based permission system 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-php@googlegroups.com 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?hl=en
Re: A simple User Management Plugin
thanks for sharing us your work. It was a very good start. some quick notes: 1)after signup user should receive an activation link to activate his account not to activate the account by default. in this case use should autologin 2)user should be able to login using the password with (either his username or his email) 3)user should not be able to change his username in edit mode, but he could change always his email address in edit mode, in this case his account will be deactivated(banned) until he verifies that he is the owner of the new email address 4)the resetpassword link should be used only for one reset password operation, for security reason. same for activation link 5)after successfully resetting the password, or activating the account user should autologin to the system 6) user life cycle: created,activated,banned then ,activated,banned, activated,banned, activated,banned,activated,banned, etc... so just three status is enough. 7)in case you have either user or admin account for the user record, is_admin is enough, otherwise a light or heavy weight permission system should be required 8)cookies should always be a user choice that developer could not ignore it 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-php@googlegroups.com 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?hl=en
Re: A simple User Management Plugin
Azril, believe me you did a very good job. just keep trusting yourself / be yourself and you are the winner soon or later Dear BrendonKoz, I agree with you, some points are application specific. On Jan 13, 5:04 pm, BrendonKoz brendon...@hotmail.com wrote: I disagree with 1-3, 5, and 8. These are all project specific requirements that may change depending on the project. Obviously 4 and 6 can be argued as project specific as well, but much less often do I see these fluctuate. 7 is good because you mentioned that if further permissions are needed, an entirely different system should be used. ;) There is no single right or wrong approach. If it works, it should help *at least* one other person! :) Good job on your first plugin attempt, Azril Nazli! On Jan 13, 8:05 am, robustsolution i...@robustsolution.net wrote: thanks for sharing us your work. It was a very good start. some quick notes: 1)after signup user should receive an activation link to activate his account not to activate the account by default. in this case use should autologin 2)user should be able to login using the password with (either his username or his email) 3)user should not be able to change his username in edit mode, but he could change always his email address in edit mode, in this case his account will be deactivated(banned) until he verifies that he is the owner of the new email address 4)the resetpassword link should be used only for one reset password operation, for security reason. same for activation link 5)after successfully resetting the password, or activating the account user should autologin to the system 6) user life cycle: created,activated,banned then ,activated,banned, activated,banned, activated,banned,activated,banned, etc... so just three status is enough. 7)in case you have either user or admin account for the user record, is_admin is enough, otherwise a light or heavy weight permission system should be required 8)cookies should always be a user choice that developer could not ignore it 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-php@googlegroups.com 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?hl=en
Re: highest traffic cakePHP 1.2 sites?
1)I always encourage developers to code globally the assets in cakePHP, so instead of loading 6-non gzipped javascript files, you load one gzipped javascript file (dont bother yourself with minification). 2)If you are using the Auth components, be aware to not load the User model when the user is still a guest (not logged in), your application will feel shame if the load of the User Model will load most of the models in the app!!!, one of the weak point of the Auth component is that it loads obligatory the User model even if you do not use it for the current page!!! 3)Use a custom file engine to cache your heavy-weight queries as an array in a .php file 4)Use plugins as semi-app not as requestAction call, otherwise use elements 5)build your own tracking system, that logs guests requests, the logged-in users, and also after they logout, to make a real/exact estimation of the traffic on your web server/application 6)if you have a permission system in your application (ACL or any equivalent), try to make a caching of the permissions once the user is logs in, with an admin push from the admin, to refresh/recalculate/ reload the caching of these permissions. 7)do not overestimate the persistModel, it is a joke 8) try to avoid ACL (not a cake fault) if its not for record level permissions, use any equivalent permission system. anything is better than ACL for non-record-level permissions system. 9) if you want to use captcha, use it smartly without loosing the form data when user put a wrong code 10) caching is amazing just when you update the web site on a regular basis, otherwise it will be a nightmare. 11) and many more On Jan 8, 12:33 pm, keymaster ad...@optionosophy.com wrote: This is not meant to be a post on evaluating cake's performance or anything like that. I use cake alot and have no issues. I also know that for those who utilize cake 1.2's various features for performance optimization to the fullest, there are very few issues of performance remaining even for the busiest apps. So, this is really just a curiosity question. The kind of thing one thinks about when one doesn't feel like working :-) By chance, does anyone have a feel for which sites (other than addons.mozilla.org which is cakePHP1.1 anyways) might be among the highest traffic'ed cakePHP 1.2 sites ? 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-php@googlegroups.com 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?hl=en
Re: How to setup relationships in model User has a Status
AFAIK, In general we have three statuses for every account created but not active (0) activated (1) banned (-1) It is better to stick to one table (users), so this table have an indexed integer field called status. As for Active, ''Banned, etc... It is just a convention and 9X% of the queries around the users table do not need those strings. just because I don't want to say 100% (because I hate the number 100) On Dec 28, 1:24 am, Brettski brettsk...@gmail.com wrote: Hi, Just learning CakePHP now. I have a simple question, hopefully its a simple answer :) I'm trying to get my models setup right, so I have a user model, and a status model, for example.. Status = Active or Cancelled etc. I can't seem to get the associations right. How do you set each of these up so that I return an array of status's to the user model. I thought it would be User hasOne Status, Status hasMany Users but that doesn't work, it looks for a Status.user_id which isn't a field (as it doesn't make sense). b 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-php@googlegroups.com 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?hl=en
Re: coding practices with models
in your previous code, you are not instantiating the banana, you are only looking for the banana record with the specific id. As for the Banana Model Class, you can define custom methods. You can do hat ever you want but, If you want to know how do I think? I do not put a method in the model unless I know It is going to be called from more than one controller, otherwise I put it as private method in the controller On Dec 28, 2:14 am, Christian cdamiani...@gmail.com wrote: When i come across situations that I feel needs to be coded inside the model I'm not sure whether (form the perspective of the controller or a different model) to treat a model as an object, or just as a collection of class methods. For example: If I want to peel a banana.. Is it correct to instantiate the Banana $this-Banana-read(null,$id); and then call the method $this-Banana-peel(); and in banana.php: function peel() { //since this method was called on a specific instance //it should have access to it's private variables (tuple from the database) } OR do i just call the method on the id and sort that out in the model $this-Banana-peel($id); then... function peel($id) { //need to instantiate the banana first before we can operate on it $this-Banana-read(null,$id); } I'm curious about the practices of some of you regular cakers. thanks 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-php@googlegroups.com 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?hl=en
Re: Problem Prototype / jQuery
the order I use is 1)prototype 2)scriptaculous 3)jquery then in the first line of the body section I use script type=text/javascript$j = jQuery.noConflict();/script and It works... so for non jQuery plugins I use either the $j keyword or the jQuery keyword for jQuery plugins you may use the the $ keyword as it is encasulated inside a function happy new year On Dec 27, 3:34 pm, Dr. Loboto drlob...@gmail.com wrote: Ask on JavaScript forums. It is not Cake-related problem. On Dec 26, 12:58 pm, thomaus tho...@saimiris.com wrote: Hi, I tried it this way: ?php echo $javascript-link('/js/scriptaculous-js-1.8.3/lib/prototype'); echo $javascript-link('/js/scriptaculous-js-1.8.3/src/ scriptaculous'); // jQuery echo $javascript-link('/js/jquery-1.3.2.min.js'); ? script jQuery.noConflict(); // Put all your code in your document ready area jQuery(document).ready(function($){ // Do jQuery stuff using $ $(div).hide(); }); // Use Prototype with $(...), etc. $('someid').hide(); /script ?php // jQuery configuration echo $javascript-link('/js/simpla.jquery.configuration.js'); // Facebox jQuery Plugin echo $javascript-link('/js/facebox.js'); // jQuery WYSIWYG Plugin echo $javascript-link('/js/jquery.wysiwyg.js'); ? !-- Internet Explorer .png-fix -- !--[if IE 6] ?php echo $javascript-link('/js/DD_belatedPNG_0.0.7a.js'); ? script type=text/javascript DD_belatedPNG.fix('.png_bg, img, li'); /script ![endif]-- I also tried to put it just after the simpla.jquery.configuration and still, it doesn't work. Thanks, On Dec 25, 12:58 pm, Dr. Loboto drlob...@gmail.com wrote: jQuery.noConflict() must be called immediately after initial jQuery include. On Dec 24, 11:08 pm,thomaustho...@saimiris.com wrote: Hi there, I have an issue using both Prototype and jQuery in my app. Here is my JS includes in my head folder: ?php echo $javascript-link('/js/scriptaculous-js-1.8.3/lib/prototype'); echo $javascript-link('/js/scriptaculous-js-1.8.3/src/ scriptaculous'); // jQuery echo $javascript-link('/js/jquery-1.3.2.min.js'); // jQuery configuration echo $javascript-link('/js/simpla.jquery.configuration.js'); // Facebox jQuery Plugin echo $javascript-link('/js/facebox.js'); // jQuery WYSIWYG Plugin echo $javascript-link('/js/jquery.wysiwyg.js'); ? !-- Internet Explorer .png-fix -- !--[if IE 6] ?php echo $javascript-link('/js/DD_belatedPNG_0.0.7a.js'); ? script type=text/javascript DD_belatedPNG.fix('.png_bg, img, li'); /script ![endif]-- script jQuery.noConflict(); // Put all your code in your document ready area jQuery(document).ready(function($){ // Do jQuery stuff using $ $(div).hide(); alert('jquery'); }); // Use Prototype with $(...), etc. $('someid').hide(); /script and no luck : when I comment jQuery, my Prototype paginator works, and when I comment Prototype, my jQuery tabs don't work. Can someone help me I also tried the other solution commented here :http://docs.jquery.com/Using_jQuery_with_Other_Librariesbyputting jQuery include before the Prototype include and... no luck. Just a thought : why on Earth Cake Ajax helper is based on the old fashioned Prototype and not on the great jQuery??? Thanks. 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-php@googlegroups.com 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?hl=en
Re: Logout link in layout
in you app_controller.php, put this public function beforeRender() { if (!array_key_exists('requested', $this-params)) { $user = $this-Session-read($this-Auth-sessionKey); $this-set(compact('user')); } } and in the layout put this if (!empty($user)) echo $html-link('Logout', array('controller' = 'Users', 'action'='logout')); and the happy new year On Dec 24, 4:46 am, emmexx emmeics...@gmail.com wrote: I'd like to put a logout link in my default layout. The link should be there only when a user has already logged in. I put the following code in my app/views/layouts/default.ctp: if ($this-Auth-user()) echo $html-link('Logout', array('controller' = 'Users', 'action'='logout')); but, of course, cake didn't like and screamed in horror: Notice (8): Undefined property: View::$Auth [APP/views/elements/ logout.ctp, line 3] Fatal error: Call to a member function user() on a non-object in /app/ views/elements/logout.ctp on line 3 Is there a way to accomplish that? Thank you and Merry Christmas! maxx 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-php@googlegroups.com 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?hl=en
Re: using the session object
you ask a great question I forget about putting in database because it should be treated as permanent storage not temporary/volatile storage now about file caching. either you use session or you create your own cache engine. if the arrays are large I prefer create my own cache engine but instead of file_get_contents the cahced version I include it. so this is the defference between session (serialized data), and cutom cache engine (that creates a normal PHP script file to be included later) and the happy new year On Dec 23, 10:24 pm, Josh joshs.silver...@gmail.com wrote: I have a fairly large array that I would like to access across http requests in a given session. Is there a performance disadvantage to putting this in the session object? The other option it seems is to put the data in the db, but I have no need for this data to persist across sessions, so it seems unnecessary. Thanks. 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-php@googlegroups.com 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?hl=en
Re: Merry Christmas
it will be only in your and my dream happy new year 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-php@googlegroups.com 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?hl=en
Re: Multilanguage routes
I think the smart guy teknoid has a full article on this 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-php@googlegroups.com 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?hl=en
Re: Caching a pagination data
hi HK, Aren't you the cache helper in the controller? because AFAIK it should be used also. caching view is something server-side (done on the server), it caches the whole (browser request)'s page answer (the html source code) caching images is another thing, it is something done on the client side (in the browser cache), you may treat the image as an asset file (like css files or js files) to force caching it in the client side. as for caching just the returned value of the $this-paginate, you may use this amazing link http://book.cakephp.org/complete/764/Cache have a nice baking day On Dec 18, 7:56 am, HK hkosm...@gmail.com wrote: Hello all, I have a function in my controller which reads about 4000-8000 images (depending on the event viewed) and then return a pagination. Since those images don't change per event I would like to cache them. First of all can I use view cache? I enabled cache in core.php, and use $this-cacheAction=true in my action. app/tmp is writable (chmod -R 777) but no page appears on tmp/cache/ view only the empty file. Is it because I use $this-paginate()? Can pagination work with cache? Another solution would be to cache $this-paginate() so not to fetch data on every request. Can this be done, and how? thanks a lot 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-php@googlegroups.com 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?hl=en
Re: Caching a pagination data
I meant why arent you using the cache helper...etc On Dec 18, 8:58 am, robustsolution i...@robustsolution.net wrote: hi HK, Aren't you the cache helper in the controller? because AFAIK it should be used also. caching view is something server-side (done on the server), it caches the whole (browser request)'s page answer (the html source code) caching images is another thing, it is something done on the client side (in the browser cache), you may treat the image as an asset file (like css files or js files) to force caching it in the client side. as for caching just the returned value of the $this-paginate, you may use this amazing linkhttp://book.cakephp.org/complete/764/Cache have a nice baking day On Dec 18, 7:56 am, HK hkosm...@gmail.com wrote: Hello all, I have a function in my controller which reads about 4000-8000 images (depending on the event viewed) and then return a pagination. Since those images don't change per event I would like to cache them. First of all can I use view cache? I enabled cache in core.php, and use $this-cacheAction=true in my action. app/tmp is writable (chmod -R 777) but no page appears on tmp/cache/ view only the empty file. Is it because I use $this-paginate()? Can pagination work with cache? Another solution would be to cache $this-paginate() so not to fetch data on every request. Can this be done, and how? thanks a lot 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-php@googlegroups.com 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?hl=en
Re: Plugin callbacks and controller hooks
AFAIK, plugin could be used -1-to be a ~~~separate application : example the blog plugin, the auth plugin, the forum plugin, etc... -2-to be called from anywhere by using a requestAction: example captcha plugin is used to be called via requestAction to import the prove that you are human image choose the option you need (you may use number 2) and have a nice baking day On Dec 18, 12:53 pm, Aargh dra...@secured.ro wrote: I would like to know if there is any official (or at least supported / under development) mechanism that would allow me to create hooks so that i can hook certain plugin functions into a controller. What would be sweet : Controller hooks For example let-s say we have a two statistics plugins. One checks the ip, one checks the searchphrase. They both basically work with the same data, and could be hooked into the afterFilter or smth. So the idea would be to be able to register a hook, and then (using naming conventions ??), certain (plugin) functions to be called. View hooks Would be great such thing to also exist for the views, let-s say we register a viewHook called product_addons, so if we develop a rate the product plugin, the view would take a ctp from the plugin and render the stars and the rating form in that hook. And of course when disabling the plugin, searching for the things to be rendered there will return empty. Whatever. I've seen something like (controllerHooks) this at Tarique Sani's Cheesecake, in his hitStats plugin. It has some AppInit component that will do the hooks. I'm not sure how it works, I've not investgated further as the software seems to be quite old (1.1 framework version I think). There was another implementation like this called SpliceIt, but is not mantained, and seems quite old also. Is there any reccomended way of actually plugging/unplugging custom logic ? Because the plugins seem more like separate apps (that can use the main's app logic, and not the other way arround, which is ok after all) to me. Maybe I missed something, but I can't find a way to elegantly plug in/out custom logic into the controllers. For plugging in/out custom elements/views i didn't find anything :(. Probably doing this in models is wrong by design. Maybe I have some brain damage from other apps I modified. But there are plenty of components and helpers that make development a breeze, until you need to actually do a plugin that can also easly plug out. This is one of the reasons I think apps like wordpress, prestashop and similar have a bigger community than any cakephp based app outhere (for example CheeseCake is a good photoblog, but without other (spam filtering for example) plugins is not to be considered by most photographers out there, and noone is willing to create one if there is no standard way to develop plugins in cakphp, and everytime you have to rediscover how the developer implemented the hooks). I think this would make easier for us to port plugins from one app to another, thus making creation of feature rich software easier. Is very hard to do anything but custom software on cakephp, as for example creating a good shopping cart will essentially rule out 3'rd parties from developing payment or shipping plugins. Most of those payment plugins for example do the same thing, but using different apis. From the cart's point of view they all act the same, send a form, receive an answer, update the cart's status. But there is no elegant way to plug in/out these modules. And the funny thing is most of them do not even need a table, just a form and a way to validate the answer and change cart's status. Some time ago I developed some publishing software with cake (1.1). It was great, until it came to statistics. I had to add lots of requestActions in the before and afterFilters. Right now is some kind of mess (as removong a plugin would also mean to remove the added logic into the main apps controllers and views). The next thing I develop I would like to not become so messy. (Btw, sluggable behaviour, bindable behaviour, meio upload and magick resize helper spared me a lot of work, 10x god the community is strugling to add cool functionality to the framework). I searched about this topics, but I didn't find much. I checked various apps for ideas, but most of them are outdated. Is there anything like this in plan ? Is there any component that already do that ? 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-php@googlegroups.com 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?hl=en
Re: Database encryption security
of course you are talking about two-way encryption not hashing (one way). by the way what do you mean by the database owner? either the guy have a full access to the database or a custom access. if you are the one who has full access, give him a mysql account with custom access to all tables except the tables that have sensitive info. otherwise an alternative solution should be required here. 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-php@googlegroups.com 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?hl=en
Re: Plugin callbacks and controller hooks
m sorry, captcha plugin is also considered as a very small separate application plugin, I gave a wrong example. but you still have the option number 2 but you need to specify the plugin key/prefix in the url array/string On Dec 18, 1:54 pm, robustsolution i...@robustsolution.net wrote: AFAIK, plugin could be used -1-to be a ~~~separate application : example the blog plugin, the auth plugin, the forum plugin, etc... -2-to be called from anywhere by using a requestAction: example captcha plugin is used to be called via requestAction to import the prove that you are human image choose the option you need (you may use number 2) and have a nice baking day On Dec 18, 12:53 pm, Aargh dra...@secured.ro wrote: I would like to know if there is any official (or at least supported / under development) mechanism that would allow me to create hooks so that i can hook certain plugin functions into a controller. What would be sweet : Controller hooks For example let-s say we have a two statistics plugins. One checks the ip, one checks the searchphrase. They both basically work with the same data, and could be hooked into the afterFilter or smth. So the idea would be to be able to register a hook, and then (using naming conventions ??), certain (plugin) functions to be called. View hooks Would be great such thing to also exist for the views, let-s say we register a viewHook called product_addons, so if we develop a rate the product plugin, the view would take a ctp from the plugin and render the stars and the rating form in that hook. And of course when disabling the plugin, searching for the things to be rendered there will return empty. Whatever. I've seen something like (controllerHooks) this at Tarique Sani's Cheesecake, in his hitStats plugin. It has some AppInit component that will do the hooks. I'm not sure how it works, I've not investgated further as the software seems to be quite old (1.1 framework version I think). There was another implementation like this called SpliceIt, but is not mantained, and seems quite old also. Is there any reccomended way of actually plugging/unplugging custom logic ? Because the plugins seem more like separate apps (that can use the main's app logic, and not the other way arround, which is ok after all) to me. Maybe I missed something, but I can't find a way to elegantly plug in/out custom logic into the controllers. For plugging in/out custom elements/views i didn't find anything :(. Probably doing this in models is wrong by design. Maybe I have some brain damage from other apps I modified. But there are plenty of components and helpers that make development a breeze, until you need to actually do a plugin that can also easly plug out. This is one of the reasons I think apps like wordpress, prestashop and similar have a bigger community than any cakephp based app outhere (for example CheeseCake is a good photoblog, but without other (spam filtering for example) plugins is not to be considered by most photographers out there, and noone is willing to create one if there is no standard way to develop plugins in cakphp, and everytime you have to rediscover how the developer implemented the hooks). I think this would make easier for us to port plugins from one app to another, thus making creation of feature rich software easier. Is very hard to do anything but custom software on cakephp, as for example creating a good shopping cart will essentially rule out 3'rd parties from developing payment or shipping plugins. Most of those payment plugins for example do the same thing, but using different apis. From the cart's point of view they all act the same, send a form, receive an answer, update the cart's status. But there is no elegant way to plug in/out these modules. And the funny thing is most of them do not even need a table, just a form and a way to validate the answer and change cart's status. Some time ago I developed some publishing software with cake (1.1). It was great, until it came to statistics. I had to add lots of requestActions in the before and afterFilters. Right now is some kind of mess (as removong a plugin would also mean to remove the added logic into the main apps controllers and views). The next thing I develop I would like to not become so messy. (Btw, sluggable behaviour, bindable behaviour, meio upload and magick resize helper spared me a lot of work, 10x god the community is strugling to add cool functionality to the framework). I searched about this topics, but I didn't find much. I checked various apps for ideas, but most of them are outdated. Is there anything like this in plan ? Is there any component that already do that ? 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
Re: autocomplete with id and value
the idea about autocomplete is for listing values with or without relevance not with or without ids. otherwise a hack should be done. 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-php@googlegroups.com 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?hl=en
Re: the essential mix of cakephp tips (community edition)
Hi teknoid, DO NOT HACK THE CORE AT ANY RATE, AND THIS IS FOR FORWARD COMPATIBILITY / MIGRATION PURPOSES, FOR EXAMPLE : AVOID ADDING AN ADDITIONAL CALLBACK BECAUSE YOU ALMOST ALWAYS DO NOT NEED TO CREATE IT 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-php@googlegroups.com 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?hl=en
Re: To Sanitize or not? :: Public Opinion
you may sanitize somtimes, but you should always validate inputs (forms... urls http requests) -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-...@googlegroups.com. 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?hl=.
Re: Using multiple criteria to login a user. Email or Username.
Dear Ahmed, how are you? It is very very simple, you dont need to change anything in the Auth component, anything in the login form you just need to put this in the beforeFilter() callback of the users controller if ($this-params['action']=='login' !array_key_exists ('requested',$this-params) !empty($this-data[$this-Auth- userModel])) { $this-data[$this-Auth-userModel]=array_map('trim',$this-data [$this-Auth-userModel]); if(!empty($this-data[$this-Auth-userModel][$this-Auth-fields ['username']]) !empty($this-data[$this-Auth-userModel][$this- Auth-fields['password']])) { if (Validation::email($this-data[$this-Auth-userModel][$this- Auth-fields['username']])) { $this-data[$this-Auth-userModel]['email']=mb_strtolower($this- data[$this-Auth-userModel][$this-Auth-fields['username']]); unset($this-data[$this-Auth-userModel][$this-Auth-fields ['username']]); $this-Auth-fields['username']='email'; } } } please, have a nice baking day -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-...@googlegroups.com. 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?hl=.
Re: javascript files loading order
you can work on the layout variable $scripts_for_layout it contains the css files and the js files On Nov 8, 5:40 pm, emmexx emmeics...@gmail.com wrote: I use many javascript files in one application. Some file is linked in the layout view, other are linked in a model view. Some of those files depend on the other (e.g.: file foo.js depends on prototype). The html file created by cake contains the script tags ordered in the wrong way (1st foo.js, 2nd prototype) so I get some javascript errors. Is there a way to force the loading order of javascript files? thank you maxx --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help Getting Model name
u may use the PHP function key() that returns the index element of the current array position. On Nov 8, 5:26 pm, Dave make.cake.b...@gmail.com wrote: Is there a simple way to get the model name from something like this? This is the data that's sent to cake. data[Contact][email] t...@something.com data[Account][email] te...@fake.com Debug will get me Array( [Contact] = array( [Email] = t...@something.com ) ) Where I simply need 'Contact' or 'Account' Thanks Dave --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: javascript alert after auth login
javascript? alert? after Auth m sorry m not a fan of this kind of debugging issues m not a fan of classic javascript validation... alert...etc On Nov 8, 8:47 pm, Marcelo Andrade mfandr...@gmail.com wrote: Hi there, Maybe it's a newbie question, but what's the proper way to show a javascript alert after a successfull auth login? Best regards. -- MARCELO DE F. ANDRADE Belem, PA, Amazonia, Brazil Linux User #221105 --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component does not logout via URL
m really sorry for the delay but I really misunderstood the question I don't know if you mean this http://book.cakephp.org/view/431/disableCache On Nov 4, 3:40 pm, Prof. No Time libertylivingst...@gmail.com wrote: Thanks very very much RobustSolution, I have applied your logic. Its ok though I didn't use the famous remember me here checkbox. I have studied the issue and finally discovered that it is a fault of the BUGGY INTERNET EXPLORER that keeps CACHING the page instead of visiting the SERVER for proper details (Stupid Explorer!!!). Please can you help me out on how to prevent caching of the LOGOUT page by such browsers? Cheers in ADV. On Nov 2, 3:29 pm, robustsolution i...@robustsolution.net wrote: Prof.NoTime try to take a coffee cup and get relaxed, this is my current solution/ tips/tricks for the moment 1)put this in your AppController class final protected function _logout() { if (!empty($this-Cookie)) { //this ensures if you were using the Cookie component along with the Auth component (the famous remember me checkbox) //and you have saved the credentials inside cookie //you should delete the credentials from the cookie when you log out //noneed to verify if you have already saved the credentials inside cookie,noerror is thrown $this-Cookie-del($this-Auth-sessionKey); } return $this-Auth-logout(); } 2)your UsersController class logout() method should be now like this public function logout() { $this-redirect($this-_logout()); } 3)your UsersController class beforeFilter() method/callback should be now like this public function beforeFilter() { ... parent::beforeFilter(); //please specify the always allowed actions... logout should be the first one of course $this-Auth-allow ('logout','forgotpassword','resetpassword','activate','register'/* put here any other always-allowed action*/); if ($this-Auth-user()) { if (in_array($this-params['action'],array ('forgotpassword','resetpassword','register','activate'))) { //if you are forgetting your password, //if you resetting your password, //if you are registering as a new user, //or if you are activating you new accout via url //you should not be logged in ... yea this is logic $this-_logout(); } elseif($this-params['action']=='login') { //you are already logged in,noneed to login again $this-redirect($this-Auth-redirect()); } } elseif ($this-params['action']=='logout') { //you are already logged out,noneed to log out again $this-redirect($this-Auth-redirect()); } ... } now have a nice baking day --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: question about Request Handler
request handler deals with reading request header and setting response header as for manipulation of the data as I know the cake 'Xml' library can do it for xml data... example for parsing xml data as array App::import('Xml'); $xml_instance = new Xml(); if ($xml_instance-load($xml_data)) { $xml_parsed_as_array = Set::reverse($xml_instance); debug($xml_parsed_as_array); } as for json manipulation through at server side u can use the basic json_encode/json_decode famous functions to convert PHP to json and vice versa, and you can use the js helper or the javascript helper as an alternative On Nov 5, 10:44 pm, Paulos23 paulitosthe...@gmail.com wrote: Hi people, I am bulding an app which supports web services,where the returned data may be XML or JSON.My idea is to create a component to handle both types of data.In particular i use HttpSocket to hit the specific url,then i take the data and finally i pass them to view.Now the question i have is if i can use RequestHandler Component for this approach,coz i don't want to generate XML, JSON but manipulate it and set it to view. Any help would ne nice! --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Hot out of the oven CakePHP 1.3 alpha
I started (today) exploring this 1.3 piece. for the first while I like it but I think I will ...fall in love with this new sweet cake thanks mark for your support/work and for these great newss --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: saveAll and update issue across multiple models
Dear appel268576, It seems your edit form does not include the id of each child record, that is why when you submit, new records are creating as if you are in create mode!!! have a nice baking day --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Hide Link with username and password using CakePHP
this depends on how the other php site (the server site) is prepared to receive credentials... in general it is a bad practice to pass credentials through URL for many security reasons... On Nov 2, 2:22 am, badz lee bad...@gmail.com wrote: Hi CakeTeam, Need your guys advice how to encapsulate link or hide link that contain username and password. For example : I need to pass a text, username and password to another www site.php , how i do encrypt this . http://www.passparemetersite.com/sms.aspx?login=usernamepassword=the... how are u Thanks.. Badli --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Component does not logout via URL
Prof.No Time try to take a coffee cup and get relaxed, this is my current solution/ tips/tricks for the moment 1)put this in your AppController class final protected function _logout() { if (!empty($this-Cookie)) { //this ensures if you were using the Cookie component along with the Auth component (the famous remember me checkbox) //and you have saved the credentials inside cookie //you should delete the credentials from the cookie when you log out //no need to verify if you have already saved the credentials inside cookie, no error is thrown $this-Cookie-del($this-Auth-sessionKey); } return $this-Auth-logout(); } 2)your UsersController class logout() method should be now like this public function logout() { $this-redirect($this-_logout()); } 3)your UsersController class beforeFilter() method/callback should be now like this public function beforeFilter() { ... parent::beforeFilter(); //please specify the always allowed actions... logout should be the first one of course $this-Auth-allow ('logout','forgotpassword','resetpassword','activate','register'/* put here any other always-allowed action*/); if ($this-Auth-user()) { if (in_array($this-params['action'],array ('forgotpassword','resetpassword','register','activate'))) { //if you are forgetting your password, //if you resetting your password, //if you are registering as a new user, //or if you are activating you new accout via url //you should not be logged in ... yea this is logic $this-_logout(); } elseif($this-params['action']=='login') { //you are already logged in, no need to login again $this-redirect($this-Auth-redirect()); } } elseif ($this-params['action']=='logout') { //you are already logged out, no need to log out again $this-redirect($this-Auth-redirect()); } ... } now have a nice baking day --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Hosting - Who is the best?
I have a linux based hosting account on fasthosts.co.uk and PHP is working as it should be. even though I am using it right now for testing from time to time and it is fine. I think the things we should ask about are: -is htaccess enabled and is Apache allowing mod rewrite rule? -since most of us (even many java developers) are mysql fans, is the mysql server on the same backbone of the network that contains the Apache server, because as you know cakePHP divides complex queries into a slightly big number of simple queries which may make the time latency important if the apache is in London and the mysql is in New York... funny huh? -is your application gonna use some windows specific component? excel, access, bla bla... -what do they mean by unlimited? shared hosting and unlimited... this is a joke... I would like the community to make this topic sticky... because it is really important... we can share knowledge together about cakephp hosting and take advantage of everyone's experience have a nice baking day --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Hosting - Who is the best?
I meant cakePHP is working as it should be On Nov 2, 2:56 pm, robustsolution i...@robustsolution.net wrote: I have a linux based hosting account on fasthosts.co.uk and PHP is working as it should be. even though I am using it right now for testing from time to time and it is fine. I think the things we should ask about are: -is htaccess enabled and is Apache allowing mod rewrite rule? -since most of us (even many java developers) are mysql fans, is the mysql server on the same backbone of the network that contains the Apache server, because as you know cakePHP divides complex queries into a slightly big number of simple queries which may make the time latency important if the apache is in London and the mysql is in New York... funny huh? -is your application gonna use some windows specific component? excel, access, bla bla... -what do they mean by unlimited? shared hosting and unlimited... this is a joke... I would like the community to make this topic sticky... because it is really important... we can share knowledge together about cakephp hosting and take advantage of everyone's experience have a nice baking day --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Sanitize:: clean help
nice approach... euromark. On Nov 1, 9:23 am, euromark (munich) dereurom...@googlemail.com wrote: way to complicated dont sanitize it and use h() for output (text, varchar) that is way more handy than any other approach On 1 Nov., 06:44, Kyle Decot kdec...@gmail.com wrote: Try echo $form-input(description,array(value=html_entity_decode(@ $this-data[Model][description]))); On Oct 31, 5:29 pm, Dave make.cake.b...@gmail.com wrote: Can someone help me out with this fairly simple question. I am doing: $clean = new Sanitize(); $this-data = $clean-clean($this-data); Now if a user enters quotes brackets or what not it gets converted to lt;scriptgt; which is fine for saving to the db I suppose. But when they go back to edit the entry the input is lt;scriptgt; how can i convert it back to what it was before? So it is readable. I want the data to be safe for the db but also be able to be editable by the end user. I tried echo $form-input(html_entity_decode('description'));but still comes out all mangled Thanks Dave --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP Application Design Help
you dont need to create a controller class for the settings table just create a model for the settings table In case user is not created with its settings (in the same add form), do the following in the User model put this function afterSave($created) { if($created) { $this-Setting-create(); $data['Setting']['user_id']=$this-id; $this-Setting-save($data); } } have a nice baking day --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to retrieve validation errors on model save?
Dear will, it seems you are validating from the controller http://book.cakephp.org/view/410/Validating-Data-from-the-Controller On Oct 29, 9:08 pm, Will Poillion lorew...@gmail.com wrote: Simple question: I'm attempting to save a model, and the data to be saved is not passing the validation rules. How do I retrieve the validation error? if ($this-Ingredient-IngredientImage-save($this-data)) { //success $this-Session-setFlash(__('The Ingredient Image has been saved', true));} else { // retrieve validation error and return to view } Also, am I correct in assuming that setFlash is useless in an ajax call? I know I'm a noob but I'm not sure how I would use the setflash and flash functionality in an ajax call. Any clue as to how to do this would be most appreciated. Thanks! Will --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Inefficient SQL queries with hasMany/belongsTo relationship
the question why do you want to paginate comments while you are paginating posts? in general when you paginate the main model (Post), you just include summary fields from the associated models example -last commented by commenter name -last comment title... not body... (text) -last commented in (date) -total number of comments (number) -total number of visits (number) etc... so either these fields are redundant in the posts table just for performance issue (many question marks here maybe) or you do custom pagination queries to retrieve the last things for each post (in the current pagination of course... the current page I mean) --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cakephp auth component allow problem
Dear @Zahidur, to allow any kind of requestAction from within your AppController do this in the beforeFilter() callback if (array_key_exists('requested',$this-params)) { $this-Auth-allow($this-params['action']); } this is a quick solution for now. and it works for me with no error. --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Howto include a View into another View?
Dear @jayarjo just read this http://cakedc.com/eng/developer/mark_story/2009/02/27/benchmarking-requestaction --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Before render being called twice?
Dear @Amit, use this snippet in your app controller beforefilter callback if (!array_key_exists('requested', $this-params)) { //anything you put here will be called just one time } have a nice baking day --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: The Cake is still rising
good luck for them, they were robust. as for the great CakePHP framework, I want to see PHP4 in the hell as soon as possible. --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Howto include a View into another View?
Dear @Jayarjo If I understand very well your Question, I think you should read a little bit about requestAction with 'return' extra parameter On Oct 22, 2:13 pm, jayarjo jaya...@gmail.com wrote: I'm getting a huge View and I'm thinking now of splitting it into separate pieces and include them into the main View, as I will need them. I know I can create Elements and include them, but the problem is that those smaller Views that I'd like to create are specific to this main View only. So that I'd rather store them inside that folder named after the Controller of the main View rather then clutter Elements folder with unnecessary files. Is there any widespread solution to this? There should be some. --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: E-mail validation without model
Dear Céryl, I use this whenever someone registers (to create a new account) or uses a contact us form for feedbacks App::import('Core', array('Validation')); if(Validation::email($email, true)) { /* it verifies $email synrax it verifies availability of the host (after the @) */ } have a nice baking day --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Models, Tables, and Database Normalization
Dear jonlyles In general and if you stick to MVC then M is required for each T (table) C is for ZERO or more M V is for 1 or more A (action) A requires ZERO or 1 view a for particular cases, I need more information --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Models, Tables, and Database Normalization
as for particular cases, I need more information On Oct 18, 6:13 pm, robustsolution i...@robustsolution.net wrote: Dear jonlyles In general and if you stick to MVC then M is required for each T (table) C is for ZERO or more M V is for 1 or more A (action) A requires ZERO or 1 view a for particular cases, I need more information --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth component and which fields must be saved in session
you have two choices either you hack your customized/personalized \app\controllers \components\auth.php file (not recommened if you are not expert and if you do not need it as in this case) ORR you have to put it in a controller callback so a check done one time if (!array_key_exists('requested', $this-params)) { /* do here a test on one of the non required (auth user session key) field if it is still available if so delete all the non required */ } On Oct 17, 3:26 pm, marco.rizze...@gmail.com marco.rizze...@gmail.com wrote: Hi I use the Auth component to login in my application. I have noted that when the login is correct all fields of User model are saved in the session. How can I do so only some fields are saved in session and the other not? Thanks Marco --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What kind of Model-methods do you write?
I think I understand your question. yes by default it seems that CRUD/FIND are row level. but for custom pagination query or for one to many relationships (threads vs posts) it is not the same I liked $this-id=; In case of a single item/SSTabs, I would use the containable behavior. In case of pagination I use exactly the custom pagination query technique without using the built in query() method because it is slower. I integrate a prepared class and I use the same loaded connection instance that cake is already using otherwise I create it In case of anything else I try to mimic the cake way that transforms a complex query to a set of simple queries. I hate parameters and I don't know why but in general I tries to put (as much as possible) the crud/search functions in the controller and use the models as aggregated things. I try as much as possible to do the things the cake way, but when I see a loss in performance (as in custom pagination query), I integrate my favorite PHP classes as vendors inside the application. appmodel is very important man... abuse it On Oct 17, 6:45 pm, Martin Westin martin.westin...@gmail.com wrote: Dumb question? I hope not. I wanted to see which is the most popular way of writing methods in models. And by which way and what kind I am referring to if the methods assume and require a loaded row from the database or not. Better use an example. Drawing from the ever present blog tutorial, assume you want to change a post from draft to published. That is: a simple method that operated on the model data. Would you write: function publish() { $this-saveField('published', 1); } or function publish($id) { $this-id = $id; $this-saveField('published', 1); } Note: both very condensed and without any returns or error-checking just to keep things short. The important bit is wether you prefer to write methods that assume $this = the table or $this = a row. Variations of save and find will always be table-level methods but a lot of other methods could be written either way. Row-level methods would be more natural in something like rails since results are objects. From the controller the first method above would be called like this: $this-Post-read($id); // or find('first',..) $this-Post-publish(); and the second: $this-Post-publish($id); Possibly the example is a poor one but I hope you can discern what I am driving at. I have tried writing both ways. I like writing row-level methods but they can be problematic because of Cake's data handling. /Martin --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Refresh page on login / out
Dear Dave, The logoutredirect deletes the session key of the auth component not the other session keys... Let the logout() method delete all the session keys that you create since you have logged in have a nice baking day On Oct 15, 7:58 am, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I have a login module on the side of each page if not logged in. Problem is when a user logs in or out from the home page which is the $this-Auth-loginRedirect and $this-Auth-logoutRedirect it still shows logged in or login. How can i refresh the page or something so the page updates correctly? If i manually refresh the page the correct look is there but that's not going to work in a live environment. Ideas how to fix this? Dave On Oct 15, 7:58 am, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I have a login module on the side of each page if not logged in. Problem is when a user logs in or out from the home page which is the $this-Auth-loginRedirect and $this-Auth-logoutRedirect it still shows logged in or login. How can i refresh the page or something so the page updates correctly? If i manually refresh the page the correct look is there but that's not going to work in a live environment. Ideas how to fix this? Dave --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Still no answer on how to do this...
Dear Kyte sorry for the delay, I forgot! Solution just add this code in the beginning of the app\config\routes.php file $singleton_router = Router::getInstance(); if(!in_array('q',$singleton_router-named['default'])) $singleton_router-named['default'][]='q'; the problem is that the default named parameters in CakePHP routing are 'page', 'fields', 'order', 'limit', 'recursive', 'sort', 'direction', 'step' that's why we need to add this 'q' named parameter otherwise cakePHP will not detect the route you have defined have a nice baking day On Oct 11, 12:34 am, Kyle Decot kdec...@gmail.com wrote: I'm using $html-link() not $html-url(); I don't know why I typed that. I don't know what you mean by the first part of your response On Oct 10, 5:29 pm, robust solution i...@robustsolution.net wrote: Dear Kyle Decot I think whenever you define a route in the routes.php you should not repeat the route parameters in every url you want to show... the shortcut is enough this is first... secondly -url is for url for hyperlink use -link On Oct 10, 11:21 pm, Kyle Decot kdec...@gmail.com wrote: Can someone please help me with this? I've tried posting on here and on the IRC channel and no one can seem to figure this out...it this just not possible with cake? All I am trying to do is creating a link using reverse routing and having named params in the URL. On Oct 9, 10:38 pm, Kyle Decot kdec...@gmail.com wrote: I want to set up my website so I can have urls like: sample.com/search/ sample.com/search/q:search+terms/ sample.com/search/country:us/region:oh/ ..etc.. I also want to be able to do reverse routing w/ my links. I have my routes.php set up like: Router::connect('/search/*', array('controller' = 'model', 'action' = 'index')); and then I print a link like: echo $html-url(search,array (controller=model,action=index,q=search terms go here)); but the link comes out as: /model/index/q:search/ What am I doing wrong? I have tried to get an answer to this question before but nobody can seem to tell me the correct way of doing this. Any help you can give me is EXTREMELY appreciated!- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: about cake php layout
Dear Lan Always think like this on the client side HTML/layout in for structuring CSS is for styling/representing Javascript is for behaving cake comes with a default layout for html/php pages it is called default.ctp and it is located in the cakefolder\cake\libs\view\layouts the first thing you have to do is to copy it to your cakefolder\app \views\layouts and edit it. whay it is called 'default', because cake autodetects it, if cake dosent find it in the cakefolder\app\libs\view\layoutsit will try to detect it in the cakefolder\cake\libs\view\layouts In general we stick to this convention 'default.ctp', but at any time you can create a new layout in the cakefolder\app\views\layouts called for example 'default2.ctp', but cake will not autodetect it as it did with default.ctp layout, so you have to do it explicitly from the controller by doing like this $this-layout='default2'; I general (but not always) one page layout has one and only one css stylesheet, stick to this convention also, the conventions of cake are exactly what should every one of us think. this was an intro, for more info, read the cookbook On Oct 15, 11:26 am, lan lane...@gmail.com wrote: Sir i want add my own style to cake php.So please give an idea about this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: retrieve online status of a user while logged in
remember that this issue should be on demand not every period of time. it is better to do it usin javascript/ajax John Andersen said the truth... the last activity time... but the 5 minutes is something too long... heheh I do like the way On Oct 15, 12:22 am, DigitalDude e.blumsten...@googlemail.com wrote: Hey, that sounds nice, I think I'll give it a try and make an example of this. I think most apps use a separate Javascript-Client for these purposes, but I have to look for infos about that a little longer the next few weeks... Regards, DD On 13 Okt., 07:39, John Andersen j.andersen...@gmail.com wrote: Add a last activity time field, and update it whenever the user does something on the site. If the user has not done anything for 5 min, show the usersonlinestatusas away. If the user has not done anything for 10 min, show the usersonlinestatusas offline. If a user has a contact (friend) relationship with another user, and the other user logs in, then using the contact relationship, add a note to the user, that the other user has logged in and delete the note when it has been presented. Best wishes, John On Oct 12, 4:07 am, DigitalDude e.blumsten...@googlemail.com wrote: Hey, I need to figure out a solution for a problem. Let's say I have an app which is controlled beiAuthand ACL, so the user can log in into a system and do stuff. Everyone knows from several social networks or chat clients that when a user is logged in, and one or more friends areonline, too, the statusof these users is shown. The question is, how could I do such a thing in Cake? Is there any chance to retriebe thestatusof a user, and flag it so another user (which is his/her friend or so) can see that he's actually online? I think I could use a flag in the user's table like online with 1 or 0 as flag, and set the online-statusto 1 as a user logs in. But if a user does not log out, maybe because he just closes the browser, there is no way to set thestatusback to 0 so an indicator could show the user as offline (which means, that the field online would be set back to 0). I'm very interested in solutions for such problems, so if you have any suggestions, please let me know. Regards, DD- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RequestHandler component thinks Google Chromium isAjax
Dear Dave, Let me tell you that I am convinced that isAjax() is something fake and falsified (it is just a client side input) and it is not a standard yet, I am talking about the 'X-Requested-With' header. I would create a custom controller for the ajax requests or a custm action in a certain controller, and without cheking I use it as ajax ... layout ajax etc... This is my approach for the moment On Oct 16, 2:03 am, Dave davidcr...@gmail.com wrote: Hi everyone, I am just seeing if anyone else has run into this problem before attempting to report it as a bug. Basically when I navigate to my site which uses the Request Handler component to switch to a blank layout for ajax requests (automagically), using the Google Chromium version 4.0.220.0 browser, I receive a blank layout. I assume this is because the RequestHandler is misinterpreting the user-agent string, but I really don't know I am pretty new to this. Thanks everyone, Dave ps. In case people aren't familiar Google Chromium is a linux build of Google Chrome,http://code.google.com/chromium/ --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: gwoo Leaving CakePHP??
If this is true good luck for him and for everyone in this great community. everyday I discover that cake is something that should be delivered as a curriculum in the academic institutes like cisco and c# On Oct 15, 1:18 am, Adam adam.pars...@pearson.com wrote: [gwoo] resigned from the Cake Software Foundation and cakephp project. Thank you all for 4 great years. Best of luck to the team and community. https://www.ohloh.net/accounts/gwoo/messages Is this true? Any reason behind this decision? Who will step up and manage this great project? In the event it is true, Garrett you did a fantastic job! I love CakePHP and thank you for your time and dedication. --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---