Does locale fallback REALLY works??
HI, I'm working with the delicious Translate behaviour of Cake, release 1.2.5. The find method returns only the record in the specified locale, but if some record does not have a translation in that locale, some record are not returned. I'd like to have some working fallback mechanism, since this code won't work for me: $this-SomeModel-locale = array('ita', 'eng'); I expect this code would return the italian translation and, if not found, the english translation. Unluckily, it returns the fields in the SomeModel table instead of the records in the i18n cakephp table. ANY IDEAS OR SOLUTIONS? Thanks Dario -- 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=en.
Re: Pagination on cached data?
On 23 nov, 17:25, leberle delf.ton...@gmx.de wrote: Hi dudes, is there a way to paginate cached data? I wanna cache the result from a $controller-paginate() request an use it the next time the page is requested. But i've i bind the cached data for the view, i've the problem that paginate() wasn't called so the paginate-helper functions in the view dont work (Undefined variable: paginator). So i'm looking for something like $controller-paginate($my_cached_data); Does something like that already exist or do i've to write it? :)= Try putting something like this in your model: http://bin.cakephp.org/view/192743063 You could do the same with paginateCount so that you don't even need a db for your paginated data if the cache is populated. hth, AD ps -paginate($somethingMaybeHuge); is IMO a really bad idea/negating the point of pagination -- 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=en.
Re: CAKEPHP Country Region Combobox via AJAX
I want to filling up Casts combopbox from Religion combobox change event. Below is code for my View file. ?php echo $javascript-link('prototype'); ? tr td class=tblheight/td td colspan=2 class=tblheight/td /tr ?php echo $form-input('religion_id'); echo $form-input('cast_id'); ? br / ?php $options = array('url' = 'getCast', 'update' = 'UserCastId'); echo $ajax-observeField('UserReligionId', $options); echo $form-end(); ? Below is my controller action function getCast() { $this-set('options', $this-User-Cast-find('list', array('conditions' = array ('Cast.religion_id'=$this-data['User']['religion_id']),'group' = array('Cast.name'; $this-render('/users/update_cast_select'); } Belos is the update_cast_select result ctp file ?php foreach($options AS $k=$v) : ? option value=?php echo $k; ??php echo $v; ?/option ?php endforeach; ? I am using 3 model right now as below. CAST MODEL ?php /* * Created on Oct 7, 2009 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ class Cast extends AppModel { var $name = 'Cast'; var $BelongsTo = array('Religion','className' = 'Religion', 'foreignKey' = 'religion_id', 'conditions' = '', 'fields' = '', 'order' = ''); var $hasMany = array( 'User' = array( 'className' = 'User', 'foreignKey' = 'cast_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ) ); } ? REligion Model ?php /* * Created on Oct 7, 2009 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ class Religion extends AppModel { var $name = 'Religion'; var $hasMany = array('Cast' = array( 'className' = 'Cast', 'foreignKey' = 'religion_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ), 'User' = array( 'className' = 'User', 'foreignKey' = 'cast_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'exclusive' = '', 'finderQuery' = '', 'counterQuery' = '' ) ); } ? and USER Model ?php /* * Created on Sep 18, 2009 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ class User extends AppModel { var $name = 'User'; // var $hasOne = 'Contact'; var $belongsTo = array( 'Religion' = array( 'className' = 'Religion', 'foreignKey' = 'religion_id', 'conditions' = '', 'fields' = '', 'order' = '' ), 'Cast' = array( 'className' = 'Cast', 'foreignKey' = 'cast_id', 'conditions' = '', 'fields' = '', 'order' = '' )); - The problme is IE : when I
Re: Pass variables to Javascript
Hi, Thanks for your help. Yes, the solution that you propose works but I prefer putting my script into my PHP file so it's solved! This said, that would nice to be able to set a variable in the controller for the Javascripts, don't you think? On Nov 24, 7:33 am, oleonav o.verh...@wrg-nl.com wrote: Hi, You could always first include a short inline javascript defining your variables and after that include the external scripts. Something like this ? echo $javascript-codeblock( var someJsArr = . $someArraySetByCake . ); ? ? echo $javacript-link('someExternalJsScript.js'); ? This way you can use you variables inside your external scripts, just use the var someJsArr. By the way most of the time I place all variables needed in script into an array and use $this-set ('someArraySetByCake', json_decode($someArray)); to hand it over to the view. Succes On Nov 23, 11:09 pm,thomaustho...@saimiris.com wrote: I could do that but in my case, the images names must be dynamic so the problem would be the same. On Nov 23, 6:36 pm, Miles J mileswjohn...@gmail.com wrote: Instead of pre-loading images, just use css rollovers. On Nov 23, 9:20 am,thomaustho...@saimiris.com wrote: Thanks for your answer. I tried by putting the javascript inside the PHP script and it works fine, thanks. Nevertheless, I would like to know how to do that by using an external javascript. The solution you propose is fine as long as you call the function somewhere but in my case, I just call include the JS in the header page and never call the function in itself. So my question is : is there a way to pass variables form PHP to JS the same way the controller set variables to be used by the view this way $this-set ('lang_menu', $lang_menu); Something like $js-set('lang_menu', $lang_menu); would be nice but does it exist??? Thanks, On Nov 23, 4:41 pm, Dave davidcr...@gmail.com wrote: If you have the javascript in your php file you can interject php syntax just like html ie. $.preloadImages(?php echo $image_src; ?, img/ if your javascript is in a separate .js file you have two options 1. Change the javascript function to allow you to specify anything dynamic (ie. the images that will need to be preloaded) in a parameter which you can pass from your php file when you call the function using the method above or 2. (Not Recommended) Set up your web server to run .js files through the PHP parser. Then you can use php syntax in the .js files On Mon, Nov 23, 2009 at 6:31 AM,thomausthomas.ausse...@gmail.com wrote: Hi there, I've been using CakePHP since 6 months and never had a single problem BUT now I have one issue I can't solve. Here it is: I need to Preload some images for my website. I did it using JQuery and it perfectly works: CODE $(document).ready(function(){ // Preload $.preloadImages(img/button_home_en_over.gif, img/ button_portfolio_en_over.gif, img/button_about_en_over.gif, img/ button_contact_en_over.gif, img/button_portfolio_en_select_over.gif, img/ button_about_en_select_over.gif, img/ button_contact_en_select_over.gif, img/button_home_es_over.gif, img/button_portfolio_es_over.gif, img/button_about_es_over.gif, img/button_contact_es_over.gif, img/button_portfolio_es_select_over.gif, img/ button_about_es_select_over.gif, img/ button_contact_es_select_over.gif, img/button_home_ca_over.gif, img/button_portfolio_ca_over.gif, img/button_about_ca_over.gif, img/button_contact_ca_over.gif, img/button_portfolio_ca_select_over.gif, img/ button_about_ca_select_over.gif, img/ button_contact_ca_select_over.gif, img/button_home_fr_over.gif, img/button_portfolio_fr_over.gif, img/button_about_fr_over.gif, img/button_contact_fr_over.gif, img/button_portfolio_fr_select_over.gif, img/ button_about_fr_select_over.gif, img/ button_contact_fr_select_over.gif ); // hover $(#menu_buttons a img).hover(function() { $(this).attr(src, $(this).attr(src).split(.).join (_over.)); }, function() { $(this).attr(src, $(this).attr(src).split(_over.).join (.)); }); }); // Preload function jQuery.preloadImages = function() { for(var i = 0; iarguments.length; i++) { //alert(arguments[i]); jQuery(img).attr(src, arguments[i]); } } Now I would like to preload some of the images and not all of them cause 1) it's taking ages 2) I just need some them depending of the language I use. But in order to do so, I should be able to access some PHP variables from my JQuery script. So my question is: is there a way in CakePHP to pass variables to
Forgot passward
Hi Friends, Anybody can suggest me a good link for forget passward functionality.? Thank you Nirav -- 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=en.
Re: Serious Help Needed
Amit's code won't work as-is, because the keys are being duplicated. For example, try this in an example script: $test = array( 'Bacon' = array('Yummy'), 'Bacon' = array('Delicious') ); print_r($test); You'll see that the first declaration has disappeared. You can only use a key once in an array. For validation purposes, do it like this: var $validate = array( 'email' = array( array( 'rule' = array('email', 'isUnique'), 'required' = true, 'allowEmpty' = false, 'on' = 'create', 'message' = 'Your Error Message' ), array( 'rule' = array('email', 'isUnique'), 'allowEmpty' = false, 'on' = 'update', 'message' = 'Your Error Message' ) ), ); This way both rules will be observed as there are no duplicate keys. hth grigri On Nov 23, 4:54 am, Dave make.cake.b...@gmail.com wrote: When you put it like that its so easy to understand. I read the cookbook but your example is 100 times better and clearly explained when you lay it out like that. thank you very much. that looks like exactly what I need. Good looking out! Thanks, Dave On Nov 23, 1:29 am, Amit a...@amitvaria.com wrote: Take a look at the CakeBook -http://book.cakephp.org/view/127/One-Rule-Per-Field var $validate = array( 'email' = array( 'rule' = array('email', 'isUnique'), 'required' = true, 'allowEmpty' = false, 'on' = 'create', 'message' = 'Your Error Message' ), 'email' = array( 'rule' = array('email', 'isUnique'), 'allowEmpty' = false, 'on' = 'update', 'message' = 'Your Error Message' ), 'url' = array( 'rule' = array('url', 'isUnique'), 'required' = true, 'allowEmpty' = false, 'on' = 'create', 'message' = 'Your Error Message' ), 'url' = array( 'rule' = array('url', 'isUnique'), 'allowEmpty' = false, 'on' = 'update', 'message' = 'Your Error Message' ), ); On Nov 22, 8:45 pm, Dave make.cake.b...@gmail.com wrote: I cant figure out how to do this. I have 2 fields, an email and a url, both are required and need to be unique when a user wants to update thier info. If the user is only updating 1 field the other required will fail because its required. If they enter in the email field their current email because it says required it will come back invalid because its no longer unique. Vice versa for the url. They may only want to change one of the 2 fields information but how can you get around this? I dont want them entering in anything thats not valid for email / url so i need the validation rules. They are both required but how can they edit just 1 field? 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-...@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.
Need help, beginner
Hi fellas I'm having a tremendous difficulty to create the Blog Example I really don't know where do I have to put those files created on the exampleI do exactly as the example but when I try to access the only thing I get is that initial page Release Notes for CakePHP 1.2.4.8284.. What am I doing wrong? Please someone help me Sorry for any typos and sorry for bothering, I'm new on PHP. Thanks in advance -- 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=en.
File upload size (copy by value)
Hi, I recently implemented a file upload feature in one of my cakephp project following the guidelines in: http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/ The upload feature is working nice but the only problem is that it requires a huge amount of memory because cakephp save function and DB function pass their argument by copy so for a 42 megabyte file, for example, I get: 5 0.6854 9126724 ApplicantdataController-attachment( ) ../object.php: 118 6 0.6855 9126724 ApplicantdataController-saveAttachments( ) ../ applicantdata_controller.php:195 7 0.7750 49591836Model-save( ) ../applicantdata_controller.php:398 8 0.7761 49602268DboSource-create( )../model.php:1253 9 0.7767 49602220DboMysql-value( ) ../dbo_source.php:571 requiring a 120mega PHP request. I was wondering if it makes sense to create my own version of the save function passing by reference or maybe there is a better way to implement the file upload feature. Passing by reference should allow me to not have the 49mega copied twice. Thanks for your help, Nargiza -- 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=en.
how to tag a picture
how do i tag a picture like, exist in facebook. could any1 please tel me an idea or php code to tag a picture. -- 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=en.
Problem with Host Gator
Dear All, I have setup a project in Host Gator, its using cpanel. As I am doing normal setup, than its not displaying any page. After research, I found an article in which guidelines mentioned for cpanel, page is http://www.cakephp.co.uk/installing_cakephp_on_cpanel_server.html When I am using guidelines mentioned in above page, my home page work perfectly, but rest of pages is not working, I am getting page not found error. I appreciate your comments to give more idea about this problem. Thanks in advance ! Best Regards, Shadab -- 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=en.
Re: Problem with Host Gator
Usually if the home page is working but no others, it is because either 1. mod_rewrite is not enabled or 2. You are either missing the .htaccess files or they are not being used because the AllowOverride directive in the web server is configured improperly. On Tue, Nov 24, 2009 at 8:24 AM, Shadab Shaikh rws.sha...@gmail.com wrote: Dear All, I have setup a project in Host Gator, its using cpanel. As I am doing normal setup, than its not displaying any page. After research, I found an article in which guidelines mentioned for cpanel, page is http://www.cakephp.co.uk/installing_cakephp_on_cpanel_server.html When I am using guidelines mentioned in above page, my home page work perfectly, but rest of pages is not working, I am getting page not found error. I appreciate your comments to give more idea about this problem. Thanks in advance ! Best Regards, Shadab -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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=en.
Re: Validation Error
Should be: 'rule' = 'notEmpty' Also I don't think you should have the 'allowEmpty'. Rick On Nov 23, 11:23 pm, Dave make.cake.b...@gmail.com wrote: I have a select drop down for user to select a year. In before save I have: $this-data['Award']['year'] = $this-data['Award']['year']['year']; since when I insepect the request the data looks like [year] = Array ( [year] = 2009 ) validation rule looks like: 'year' = array( 'year-notempty' = array( 'rule' = array('notempty'), 'required' = true, 'allowEmpty' = false, 'message' = '* Please enter the year you recieved this Award.', 'last' = true) ) But i get this error: bWarning/b (2)/a: preg_match() expects parameter 2 to be string, array given [bCORE/cake/libs/validation.php/b, line b848/b] Any ideas where I am going wrong? -- 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=en.
Re: About multilingual websites
Hi, Thanks for your answer. 1) I tried to do ../cake/consol/cake i18n extract from my /MyApp/ app/ path and it says: Welcome to CakePHP v1.2.4.8284 Console --- App : app Path: /Users/thomas/Sites/MyApp/app --- What is the full path you would like to extract? Example: /Users/thomaus/Sites/MyApp/myapp [Q]uit [/Users/thomaus/Sites/MyApp/app] I don't get why it does so. 2) Is there a clear and updated tutorial or blog to do multilingual applications with CakePHP? I found this one http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent-internationalization-tutorial but it's completely out-of-date... About the plural form, is this blog correct? http://nik.chankov.net/2008/11/20/translating-plural-and-singular-forms-in-cakephp/ Thanks in advance, On Nov 23, 4:55 pm, Larry E. Masters aka PhpNut php...@gmail.com wrote: Ignore this section in the manual it in incorrect: Remember that po files are useful for short messages, if you find you want to translate long paragraphs, or even whole pages - you should consider implementing a different solution. e.g.: http://cakedc.com/uses entire paragraphs. http://cakeqs.org/is another example, the cakeqs.pot for it is located here:http://groups.google.com/group/cake-php/filesyou can open that file in an editor and around line 1735 see a msgid for an entire paragraph. the cakeqs-*.po files are the actual files we use in the app. One of the most important settings in the .po file is Plural-Forms:, if it is incorrect, your plural translations will not look right. Let me know if you need help with this, I am working to get the old translations.cakephp.org domain setup again and it will list all the different plural form expressions: Example (There are 16 forms of plurals, 2 listed below): #English, French, etc nplurals=2; plural=n1; #Japanese etc nplurals=1; plural=0; You can also dig through the test case app in the core that has all the plural forms in cake/tests/test_app/local/* Another piece of advice you may already know. Using the console you can extract these string with the following command. cake i18n extract This will create the pot file that you would use to create the .po files using a tool likewww.poedit.net /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On Mon, Nov 23, 2009 at 5:35 AM, thomaus thomas.ausse...@gmail.com wrote: Hi there, One month ago, I did a multilanguage website using CakePHP but putting all the multilangual content in my dB. From what I read today, this was the right way to display short messages in various languages with CakePHP : http://book.cakephp.org/view/162/Internationalizing-Your-Application From what I read too, po files are useful for short messages, if you find you want to translate long paragraphs, or even whole pages - you should consider implementing a different solution. Then my question is : is there a standard way to translate dynamically long paragraphs? Thanks, -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=. -- 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=en.
Re: Creating a login screen
I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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=en.
Containable query
Hey all, I have this relationship in question: User - hasOne Student - hasMany Submission I'm a bit stumped on how I can fetch all the users who do not have any submissions linked to their name. I've tried: $list = $this-User-find('all', array( 'contain' = array( 'Student' = array( 'Submission' = array( 'conditions' = array( 'Submission.student_id' = null ) ), ) ) )); I have the actAs in the model so the containable behaviour is functioning - there is just a problem with my specific query. Any ideas? thanks! -- 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=en.
Re: Creating a login screen
Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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=en.
Re: CakePHP performance 1.2 - is future any better?
I can only agree with all these suggestions and add a little beauty i was introduced to recently. X-Sendfile is a great for performance if you do any file output from php. It offloads all the actual output of the file to the webserver (nginx, Apache, lighttpd...). For me, implementing sendfile for all file output was a 10-minute job and I improved download speed by about 25% when testing to my home- computer... and the cpu load showed that receiving an email was more CPU-intenceive than sending a few dvd-image-sized files with nginx. I believe that is what they like to call low hanging fruit in corporate bullshit (that is a real language you know). (I did also spend a few minutes finding out that nginx wants paths relative to a configured folder while the other two main players take a full system path) /Martin On Nov 24, 8:12 am, Crazy crazy...@gmail.com wrote: Judging by your setup I believe you should start using a profiler, and optimize your code a bit or take a better look at why your machines perform poorly. I run a site that has around 250k hits/day and it's on one box (Core2Quad 8800 8GB RAM) with the db on the same machine + . It runs on average 75% idle. Only thing that puts it under heavy load is the cronjobs that are running. Don't know how far you've optimized everything, like ppl say, use an opcode cacher(APC in my experience is the most stable) and do other things like gzip, fix your keepalives, use cdn, etags, In cake, also don't do any find('all'), always specify the fields you need, don't use recursion if you don't have to, cache large sets of unchangeable data in memcache. Use a profiler(I use XDebug), every ms you can optimize will lower the load. From your description it sounds like an inefficient setup or code. I agree that cakephp isn't the fastest framework around, but it isn't that slow! On Nov 24, 7:37 am, j0n4s.h4rtm...@googlemail.com j0n4s.h4rtm...@googlemail.com wrote: - Clone all of your application files/code (anything besides /app/ webroot but including /app/webroot/index.php) to a ram based file system on your *nix host. - Try lazyloader:http://github.com/mcurry/lazy_loader - Never use recursive -1, make sure containable does not do multiple queries, if it does use complex find queries and joins - Use elements that are being cached, if you use requestAction make sure those are cached too On Nov 23, 10:08 pm, Pablo Viojo pvi...@gmail.com wrote: Yes, APC and Memcache is a must if you want good performance. Regards, Pablo Viojo pvi...@gmail.comhttp://pviojo.net ¿Que necesitas?http://needish.com On Mon, Nov 23, 2009 at 5:58 PM, Miles J mileswjohn...@gmail.com wrote: Haha funny you ask. The mozilla addons site actually runs CakePHP 1.1 and they recently announced they are switching to Django. All I can say is use APC for opcode caching and memcache for user caching. On Nov 23, 11:02 am, Balrog kraus.it...@gmail.com wrote: Hello! We are running quite growing social network in Poland for students at CakePHP, now 70k users and 0.5M hits a day. We have 3 app servers for it with CakePHP 1.2.5 installed on each. Servers are Quad Core i7 920 + 8G RAM, so rather good machines. DB on separate box + nginx frontend for static content on other box. Load on each machine is now 5+, i see addons.mozilla using CakePHP with far greater traffic than ours Have they released info if they have made any significant changes to the Cake core ? It is rather publicly known that Cake seems to be rather poorly comparing to RoR or Django in performance. Any good pieces of advice on how to optimize your app (the cake itself, cause app is prettily good written, db also optimized) ? Is upcoming 1.3 or 2.0 anyhow faster or less-cpu-using? Regards -- 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.comcake-php%2bunsubscr...@googlegroups.c om . For more options, visit this group at http://groups.google.com/group/cake-php?hl=. -- 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=en.
Re: CakePHP performance 1.2 - is future any better?
Hello, 1. If not installed, you should install accelerators / optimizers php code. For example php-accelerator http://eaccelerator.net or apc http://pecl.php.net/package/apc. 2. Pay attention to the settings cake-php/php (view's caching, permanent connect to mysql, the absence of unnecessary redirects and 404 pages) 3. Try using system utilities to pinpoint the bottleneck in the system. It is likely that the load creates not only php. You can use this set of utilities: http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html 4. With the help of a profiler is to find the php scripts / classes that consume the most CPU time. Do not do this on a production server, because profiler adds a serious cpu load on the server. -- Andrew Okhmat andy AT supportex.net http://Supportex.Net - linux remote installation, support, performance and security tuning. On Nov 23, 9:02 pm, Balrog kraus.it...@gmail.com wrote: Hello! We are running quite growing social network in Poland for students at CakePHP, now 70k users and 0.5M hits a day. We have 3 app servers for it with CakePHP 1.2.5 installed on each. Servers are Quad Core i7 920 + 8G RAM, so rather good machines. DB on separate box + nginx frontend for static content on other box. Load on each machine is now 5+, i see addons.mozilla using CakePHP with far greater traffic than ours Have they released info if they have made any significant changes to the Cake core ? It is rather publicly known that Cake seems to be rather poorly comparing to RoR or Django in performance. Any good pieces of advice on how to optimize your app (the cake itself, cause app is prettily good written, db also optimized) ? Is upcoming 1.3 or 2.0 anyhow faster or less-cpu-using? Regards -- 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=en.
Re: CakePHP performance 1.2 - is future any better?
CakePHP performance is really poor. To improve it you must use APC and/ or memcached On 23 nov, 16:02, Balrog kraus.it...@gmail.com wrote: Hello! We are running quite growing social network in Poland for students at CakePHP, now 70k users and 0.5M hits a day. We have 3 app servers for it with CakePHP 1.2.5 installed on each. Servers are Quad Core i7 920 + 8G RAM, so rather good machines. DB on separate box + nginx frontend for static content on other box. Load on each machine is now 5+, i see addons.mozilla using CakePHP with far greater traffic than ours Have they released info if they have made any significant changes to the Cake core ? It is rather publicly known that Cake seems to be rather poorly comparing to RoR or Django in performance. Any good pieces of advice on how to optimize your app (the cake itself, cause app is prettily good written, db also optimized) ? Is upcoming 1.3 or 2.0 anyhow faster or less-cpu-using? Regards -- 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=en.
Re: Creating a login screen
Hi dave, I have tried several urls: /users /users/login both return the same error. On Tue, Nov 24, 2009 at 9:21 AM, Dave davidcr...@gmail.com wrote: Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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=en.
Re: About multilingual websites
Hi, For 1: If Cake has trouble figuring out where your app is (for some reason). The simple workaround is to specify it with the full path: /Users/thomaus/Sites/MyApp/cake/consol/cake -app /Users/thomaus/Sites/ MyApp/app i18n extract That is the foolproof and disgustingly verbose way of making sure you target the right app (= how to call the console from cron). For part of 2: Plural forms are explained sort-of correctly in that post. The problem is that they depend greatly on the language you translate into. First is the header in the .po file which specifies how this language treats plurals. Second is the actual messages that will then need to add plural forms to match the header. But not all messages need plural forms!! Only single words that are translated in a plural-senitive way need them. Normal singular translation will likely be 99% of what you do: msgid this is just a string, no plurals needed! msgstr det här är bara en sträng, inga plurala variationer behövs! Then there will be things like date and time formatters, translated paging labels and things of that sort: msgid second msgid_plural seconds msgstr[0] sekund msgstr[1] sekunder My advice is to stay away from too many single words and plurals in your translations. My reason for this is that synonyms rarely match that well and generally the quality of the translated copy will suffer. It is a lot simpler for a translator to read entire sentences and to re-work them for the new language. Remember that you can put variables into the translation strings and that if you have more than one you should make sure their order is changeable. /Martin On Nov 24, 2:48 pm, thomaus tho...@saimiris.com wrote: Hi, Thanks for your answer. 1) I tried to do ../cake/consol/cake i18n extract from my /MyApp/ app/ path and it says: Welcome to CakePHP v1.2.4.8284 Console --- App : app Path: /Users/thomas/Sites/MyApp/app --- What is the full path you would like to extract? Example: /Users/thomaus/Sites/MyApp/myapp [Q]uit [/Users/thomaus/Sites/MyApp/app] I don't get why it does so. 2) Is there a clear and updated tutorial or blog to do multilingual applications with CakePHP? I found this onehttp://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persis... but it's completely out-of-date... About the plural form, is this blog correct?http://nik.chankov.net/2008/11/20/translating-plural-and-singular-for... Thanks in advance, On Nov 23, 4:55 pm, Larry E. Masters aka PhpNut php...@gmail.com wrote: Ignore this section in the manual it in incorrect: Remember that po files are useful for short messages, if you find you want to translate long paragraphs, or even whole pages - you should consider implementing a different solution. e.g.: http://cakedc.com/usesentire paragraphs. http://cakeqs.org/isanother example, the cakeqs.pot for it is located here:http://groups.google.com/group/cake-php/filesyoucan open that file in an editor and around line 1735 see a msgid for an entire paragraph. the cakeqs-*.po files are the actual files we use in the app. One of the most important settings in the .po file is Plural-Forms:, if it is incorrect, your plural translations will not look right. Let me know if you need help with this, I am working to get the old translations.cakephp.org domain setup again and it will list all the different plural form expressions: Example (There are 16 forms of plurals, 2 listed below): #English, French, etc nplurals=2; plural=n1; #Japanese etc nplurals=1; plural=0; You can also dig through the test case app in the core that has all the plural forms in cake/tests/test_app/local/* Another piece of advice you may already know. Using the console you can extract these string with the following command. cake i18n extract This will create the pot file that you would use to create the .po files using a tool likewww.poedit.net /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On Mon, Nov 23, 2009 at 5:35 AM, thomaus thomas.ausse...@gmail.com wrote: Hi there, One month ago, I did a multilanguage website using CakePHP but putting all the multilangual content in my dB. From what I read today, this was the right way to display short messages in various languages with CakePHP : http://book.cakephp.org/view/162/Internationalizing-Your-Application From what I read too, po files are useful for short messages, if you find you want to translate long paragraphs, or even whole pages - you should consider implementing a different solution. Then my question is : is there a standard way to translate dynamically long paragraphs? Thanks, -- You received this message because you are subscribed to the Google
Re: File upload size (copy by value)
You are looking at the problem form the wrong angle. Don't store 42MB files in the database, that's all. Files are best stored in the filesystem. Then you store the filename (and path) in your database. You will never even need to have the file in php-memory at all. /Martin On Nov 24, 7:37 am, Наргиза Саркулова snt.joc...@gmail.com wrote: Hi, I recently implemented a file upload feature in one of my cakephp project following the guidelines in: http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/ The upload feature is working nice but the only problem is that it requires a huge amount of memory because cakephp save function and DB function pass their argument by copy so for a 42 megabyte file, for example, I get: 5 0.6854 9126724 ApplicantdataController-attachment( ) ../object.php: 118 6 0.6855 9126724 ApplicantdataController-saveAttachments( ) ../ applicantdata_controller.php:195 7 0.7750 49591836 Model-save( ) ../applicantdata_controller.php:398 8 0.7761 49602268 DboSource-create( ) ../model.php:1253 9 0.7767 49602220 DboMysql-value( ) ../dbo_source.php:571 requiring a 120mega PHP request. I was wondering if it makes sense to create my own version of the save function passing by reference or maybe there is a better way to implement the file upload feature. Passing by reference should allow me to not have the 49mega copied twice. Thanks for your help, Nargiza -- 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=en.
Re: CakePHP performance 1.2 - is future any better?
Maybe someone should answer the original question: Will future versions improve performance? 1.3 - most likely not too much. 2.0 - this will likely see some more significant improvements since php4 is dropped. Any advancements after 2.0 are also likely to offer improvements as more and more code is php5 optimized. On Nov 24, 3:38 pm, Javier javier.cor...@gmail.com wrote: CakePHP performance is really poor. To improve it you must use APC and/ or memcached On 23 nov, 16:02, Balrog kraus.it...@gmail.com wrote: Hello! We are running quite growing social network in Poland for students at CakePHP, now 70k users and 0.5M hits a day. We have 3 app servers for it with CakePHP 1.2.5 installed on each. Servers are Quad Core i7 920 + 8G RAM, so rather good machines. DB on separate box + nginx frontend for static content on other box. Load on each machine is now 5+, i see addons.mozilla using CakePHP with far greater traffic than ours Have they released info if they have made any significant changes to the Cake core ? It is rather publicly known that Cake seems to be rather poorly comparing to RoR or Django in performance. Any good pieces of advice on how to optimize your app (the cake itself, cause app is prettily good written, db also optimized) ? Is upcoming 1.3 or 2.0 anyhow faster or less-cpu-using? Regards -- 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=en.
Session, Cache and Model
I am confused as to why the Session object is only available in the Controller. Shouldn't it be the Model's responsibility to cache the data? -- 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=en.
Re: CakePHP performance 1.2 - is future any better?
On Tue, Nov 24, 2009 at 9:07 AM, Martin Westin martin.westin...@gmail.comwrote: Maybe someone should answer the original question: Will future versions improve performance? Yes 1.3 - most likely not too much. Yes 1.3 already has improvements and more are being found and implemented. 2.0 - this will likely see some more significant improvements since php4 is dropped. There are other improvements that are not related specifically to dropping php 4, these changes will be back ported to 1.x series of the code to help improve performance. Any advancements after 2.0 are also likely to offer improvements as more and more code is php5 optimized. Yes -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ -- You received this message because you are subscribed to the Google Groups 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=en.
Re: Creating a login screen
Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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: Creating a login screen
Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.com wrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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: Need help, beginner
Either browse to [webroot]/posts or follow the directions here for routing: http://book.cakephp.org/view/341/Routes On Nov 24, 6:00 am, Daniel Gerep daniel.ge...@gmail.com wrote: Hi fellas I'm having a tremendous difficulty to create the Blog Example I really don't know where do I have to put those files created on the exampleI do exactly as the example but when I try to access the only thing I get is that initial page Release Notes for CakePHP 1.2.4.8284.. What am I doing wrong? Please someone help me Sorry for any typos and sorry for bothering, I'm new on PHP. Thanks in advance 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: Setting form action to something like /Accounts/Manage/?var=b73cr6xzr6zvar2=somethingelse
When doing it like this: array ('controller' = 'Accounts', 'action' = 'Manage', '?' = array ('var' = 'b73cr6xzr6z', 'var2' = 'somethingelse')) then the result will be /Accounts/Manage/? var=b73cr6xzr6zamp;var2=somethingelse On Nov 24, 6:31 am, Dr. Loboto drlob...@gmail.com wrote: You can set form action as: array ('controller' = 'Accounts', 'action' = 'Manage', '?' = array ('var' = 'b73cr6xzr6z', 'var2' = 'somethingelse')) On Nov 23, 9:22 pm, Ragnis ragnis.ar...@gmail.com wrote: I need them as GET variables. My form is at /Accounts/Manage/?var=b73cr6xzr6zvar2=somethingelse and when i submit the form, the GET variables will be gone but i want them to stay. On Nov 22, 11:39 pm, Amit a...@amitvaria.com wrote: Is there a reason you can't just include the vars in the form? $form-input('var', array('type'='hidden', 'value'= 'b73cr6xzr6z')); On Nov 22, 12:54 pm, Ragnis ragnis.ar...@gmail.com wrote: So how can i do that? And i don't want to use /Accounts/Manage/var:b73cr6xzr6z/ var2:somethingelse 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
Add hasMany record in beforeSave
Hi there, I'm having some problems adding a hasMany instance to another model in beforeSave, I'm wondering if I have the wrong end of the stick? I have a model User which hasMany EmailMessage. I have this in the add action of my controller: $this-data['EmailMessage'][0] = array( 'email_queue_id' = 1, 'email_address' = 't...@testing.com', 'send_date' = date (Y-m-d H:i:s), 'subject' = 'test subject', 'body' = 'test body'); $this-User-saveAll($this-data, array('validate' = 'first')); This works as expected. I thought I could move the creation of the EmailMessage to my beforeSave in the User model - I just copied the first line to the end of my beforeSave, just before I return 'true'. When I do this nothing is saved in the email_messages table - am I doing something wrong, or have I misunderstood something? Thanks, Toby 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: CakeFest IV - America - Help us pick a location!
Vote for central/mid-west... it makes sense (and it's where I am) Chicago or St. Louis or Indianapolis or Kansas City 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: Need help, beginner
Thanks for your help naidim...the router file solved my problem 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: Creating a login screen
Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.com wrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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 performance 1.2 - is future any better?
Straight from the source. Thanks Larry, I was mostly guessing that 2.0 would see the bigger improvements. :) On Nov 24, 4:17 pm, Larry E. Masters aka PhpNut php...@gmail.com wrote: On Tue, Nov 24, 2009 at 9:07 AM, Martin Westin martin.westin...@gmail.comwrote: Maybe someone should answer the original question: Will future versions improve performance? Yes 1.3 - most likely not too much. Yes 1.3 already has improvements and more are being found and implemented. 2.0 - this will likely see some more significant improvements since php4 is dropped. There are other improvements that are not related specifically to dropping php 4, these changes will be back ported to 1.x series of the code to help improve performance. Any advancements after 2.0 are also likely to offer improvements as more and more code is php5 optimized. Yes -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ 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: Creating a login screen
Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.com wrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.com wrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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,
Re: Session, Cache and Model
Hi! In the controller you especify if you want to use cache mode(cache time, actions cached, ...); the Model gets the data to the controller and the controller process it according to the cache settings you specify in the controller class. More info: http://book.cakephp.org/view/346/Caching-in-the-Controller I hope it can help you! 2009/11/24 RhythmicDevil rhythmicde...@gmail.com I am confused as to why the Session object is only available in the Controller. Shouldn't it be the Model's responsibility to cache the data? -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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 performance 1.2 - is future any better?
Straight from the source. Thanks Larry, I was mostly guessing that 2.0 would see the bigger improvements. :) Martin you are welcome. Here is a list of some features that are planned in 2.0 http://code.cakephp.org/cakephp2/wiki -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ 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: Creating a login screen
Hi! I tests this code and it works!!! Do you have some Router::connect in the config/routes.php related with the users_controller? I have many more ideas. 8-( 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.com wrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.comwrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com
Re: Creating a login screen
Hi Josu, Here is the contents of my routes.php file (below are the only two uncommented lines): Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); On Tue, Nov 24, 2009 at 11:34 AM, josu jauregui jos...@gmail.com wrote: Hi! I tests this code and it works!!! Do you have some Router::connect in the config/routes.php related with the users_controller? I have many more ideas. 8-( 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.comwrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.comwrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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
Re: Creating a login screen
What´s the url do you try to enter? (complete url) Are you using admin routing? 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Here is the contents of my routes.php file (below are the only two uncommented lines): Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); On Tue, Nov 24, 2009 at 11:34 AM, josu jauregui jos...@gmail.com wrote: Hi! I tests this code and it works!!! Do you have some Router::connect in the config/routes.php related with the users_controller? I have many more ideas. 8-( 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.comwrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.comwrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their
Re: Session, Cache and Model
Thank you for the reply. On Nov 24, 11:20 am, josu jauregui jos...@gmail.com wrote: Hi! In the controller you especify if you want to use cache mode(cache time, actions cached, ...); the Model gets the data to the controller and the controller process it according to the cache settings you specify in the controller class. More info:http://book.cakephp.org/view/346/Caching-in-the-Controller I hope it can help you! 2009/11/24 RhythmicDevil rhythmicde...@gmail.com I am confused as to why the Session object is only available in the Controller. Shouldn't it be the Model's responsibility to cache the data? -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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
Export to CSV... almost there... what am I missing?
I am in the process of adding an Export to CSV capability to my project. I am using the latest version of the csv helper found here: http://ifunk.net/cakephp/helpers/csv.php.txt. I have this code as ../ app/views/helpers/csv.php. I also have added Router::parseExtensions ('json', 'xml', 'csv'); to my routes.php file. In my ../app/controllers/repairorders_controller.php I have this action defined: function exportrepairorders() { Configure::write('debug', '0'); $this-layout = 'ajax'; // use the Ajax layout $data = array();// hold the data from the database /* Set up the conditions array to retrieve selected Repairorder data */ $params = array( 'order' = array( 'Repairorder.servicedate DESC', 'Repairorder.distributor_id', 'Repairorder.dealer_id' ) ); $paramsCount = array(); /* Set up for an export request, if requested */ $exportRequest = ($this-RequestHandler-ext == 'csv' || $this-RequestHandler-ext == 'xml' || ($this-RequestHandler-ext == 'json' !$this-RequestHandler-isAjax()) ); if ($exportRequest) { if ($this-RequestHandler-ext == 'csv') { $this-helpers[] = 'Csv'; } if ($this-RequestHandler-ext == 'xml') { // Do nothing, no helper needed } } /* Retrieve count of selected Repairorder and associated data and then the data */ $count = $this-Repairorder-find('count', $paramsCount); $this-Repairorder-recursive = 0; $data = $this-Repairorder-find('all', $params); // Debugger::dump($data); $this-set('total', $count);// send total to the view $this-set('repairorders', $data); // send repairorders to the view } I have a corresponding view established in ../app/views/repairorders/ csv/exportrepairorders.ctp which looks like this: ?php Configure::write('debug', 0); if (!$data['success']) { $line ='Error occurred. '; if (array_key_exists('msg', $data)) { $line .= $data['msg']; } if (array_key_exists('errors', $data)) { $line .= print_r($data['errors'], true); } $csv-addRow(array($line)); echo $csv-render('Repair Order Export ' . date('Y-m-d h:i') . '.csv'); return; } if (!array_key_exists('results', $data) || !count($data['results'])) { $csv-addRow('No data found.'); echo $csv-render('Repair Order Export ' . date('Y-m-d h:i') . '.csv'); return; } $csv-addRow(array( 'Distributor Name', 'Dealer Name', 'Advisor Name', 'Date of Service', 'Repair Order Number', 'VIN', 'Year', 'Make', 'Model', 'Odometer', 'Kms/Miles', 'Basic LOF?', 'Premier LOF?', 'Performance LOF?', 'Transmission?', 'Brakes?', 'Front Diff?', 'Rear Diff?', 'Transaxle?', 'Power Steering?', 'Transfer Case?', 'Date Created' ) ); foreach ($data['results'] as $result) { $csv-addRow( array( $result['Distributor']['name'], $result['Dealer']['name'], $result['Advisor']['name'], $result['Repairorder']['servicedate'], $result['Repairorder']['number'], $result['Repairorder']['vin'], $result['Repairorder']['year'], $result['Repairorder']['make'], $result['Repairorder']['model'], $result['Repairorder']['odometer'],
Re: Creating a login screen
I have tried iterations of the following: http://www.dannysindahlonega.com/admin/user http://www.dannysindahlonega.com/admin/users http://www.dannysindahlonega.com/admin/users/login all give the same message as stated before. On Tue, Nov 24, 2009 at 11:57 AM, josu jauregui jos...@gmail.com wrote: What´s the url do you try to enter? (complete url) Are you using admin routing? 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Here is the contents of my routes.php file (below are the only two uncommented lines): Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); On Tue, Nov 24, 2009 at 11:34 AM, josu jauregui jos...@gmail.com wrote: Hi! I tests this code and it works!!! Do you have some Router::connect in the config/routes.php related with the users_controller? I have many more ideas. 8-( 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.comwrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.comwrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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
Re: Creating a login screen
To be honest I am not sure about admin routing. Learning as I go a bit here.. :) On Tue, Nov 24, 2009 at 11:57 AM, josu jauregui jos...@gmail.com wrote: What´s the url do you try to enter? (complete url) Are you using admin routing? 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Here is the contents of my routes.php file (below are the only two uncommented lines): Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); On Tue, Nov 24, 2009 at 11:34 AM, josu jauregui jos...@gmail.com wrote: Hi! I tests this code and it works!!! Do you have some Router::connect in the config/routes.php related with the users_controller? I have many more ideas. 8-( 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.comwrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.comwrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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.comcake-php%2bunsubscr...@googlegroups.comFor more options,
Re: Creating a login screen
I haven't done admin routing either, but it looks to me as if you are using a url that indicates admin routing, but haven't set it up in your routes. Try adding this: Router::connect('/admin', array('controller' = 'pages', 'action' = 'index', 'admin' = true)); to config/routes.php On Nov 24, 5:12 pm, Dewayne Pinion dpin...@gmail.com wrote: To be honest I am not sure about admin routing. Learning as I go a bit here.. :) On Tue, Nov 24, 2009 at 11:57 AM, josu jauregui jos...@gmail.com wrote: What´s the url do you try to enter? (complete url) Are you using admin routing? 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Here is the contents of my routes.php file (below are the only two uncommented lines): Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); On Tue, Nov 24, 2009 at 11:34 AM, josu jauregui jos...@gmail.com wrote: Hi! I tests this code and it works!!! Do you have some Router::connect in the config/routes.php related with the users_controller? I have many more ideas. 8-( 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.comwrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.comwrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.comwrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at:http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.c om . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.c om . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology
Re: Creating a login screen
Do you have uncommented line Configure::write('Routing.admin', 'admin'); in core.php?? 2009/11/24 Dewayne Pinion dpin...@gmail.com To be honest I am not sure about admin routing. Learning as I go a bit here.. :) On Tue, Nov 24, 2009 at 11:57 AM, josu jauregui jos...@gmail.com wrote: What´s the url do you try to enter? (complete url) Are you using admin routing? 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Here is the contents of my routes.php file (below are the only two uncommented lines): Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); On Tue, Nov 24, 2009 at 11:34 AM, josu jauregui jos...@gmail.comwrote: Hi! I tests this code and it works!!! Do you have some Router::connect in the config/routes.php related with the users_controller? I have many more ideas. 8-( 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.comwrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.comwrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.comwrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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
Re: Export to CSV... almost there... what am I missing?
Sorry about the tabs. I though I took those out... What is also strange to me is that when core.php has 'debug' = '1' I get the 404 message. When 'debug' is set to '0', I get the prompt to create a CSV file, but not with the formatted name as defined in the exportrepairorders.ctp file. The file name being generated is exportrepairorders.csv and is empty. Thank you for your help. 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: Creating a login screen
Thanks for that. Unfortunately it didn't help. On Tue, Nov 24, 2009 at 12:17 PM, jburns jeremybu...@me.com wrote: I haven't done admin routing either, but it looks to me as if you are using a url that indicates admin routing, but haven't set it up in your routes. Try adding this: Router::connect('/admin', array('controller' = 'pages', 'action' = 'index', 'admin' = true)); -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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: Creating a login screen
I did not, but I tried uncommenting it and still got the same error. On Tue, Nov 24, 2009 at 12:22 PM, josu jauregui jos...@gmail.com wrote: Do you have uncommented line Configure::write('Routing.admin', 'admin'); in core.php?? -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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: need a little help with model::saveAll function
i had exactly the same problem and solved it by removing empty lines in the beforeFilter() of the controller responsible for saving items. In my case its very specific you could apppend your logic to make it more universal. p.s. im not sure about the following line in your example, because im not sure if !null is defined in php if (array_search(!null, $record)) $validRecords[] = $record; maybe im wrong but i dont think this filters your data correctly. --- in my app i use: class InvoicesController extends AppController { function beforeFilter() { if (!empty($this-data)) { // remove empty forms from data if (isset($this-data['InvoicesItem'])) { $data = array(); foreach ($this-data['InvoicesItem'] as $row) { if (!empty($row['quantity']) || !empty($row['price'])) { $data[] = $row; } } if (empty($data)) { unset($this-data['InvoicesItem']); } else { $this-data['InvoicesItem'] = $data; } } } } ... } On Nov 24, 4:28 pm, Ernesto e.fanz...@gmail.com wrote: A - i already have a routine that *should* to that... but it isn't working properly. here's the code function beforeValidate() { $validRecords = array(); foreach ($this-data as $model = $records) { foreach ($records as $key = $record) { if (is_numeric($key)) { if (array_search(!null, $record)) $validRecords[] = $record; } else break; $this-data[$model] = $validRecords; } } return true; } B - my saveAll is already overwritten in AppModel and atm it's working ok. i was just asking if it's possible to do that in a Behavior :) On 23 Nov, 20:52, Marcelo Andrade mfandr...@gmail.com wrote: On Mon, Nov 23, 2009 at 12:29 PM, Ernesto e.fanz...@gmail.com wrote: (..) A - user can insert just 2 or 3 rows, it's not necesasry to fill all the 10 Item rows. saveAll tries to save even empty insertions. Blank rows = validation errors. is there any way to avoid this? You'll have to loop $this-data and unset the entries when you get blank fields. B - is it pobbile to create a behavior that forces validate = first to every saveAll call? You can override the saveAll method in your AppModel, changing the validate entry in the options to 'first' always. Best regards. -- MARCELO DE F. ANDRADE Belem, PA, Amazonia, Brazil Linux User #221105 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
paginate loosing args
Hi All!! I have a problem with paginate, I'll try explicate: I have a form that method is post the result is ok in first page but if I click in other page or some order the paginate returns all rows of my table he is loosing the args and I'm using the passedArgs in View page what can i do? 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 with multiple memcached configs
Never mind answered my own question. Looks like it's a bug in the Cache class. Did you file a report? 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
Associate by condition
Hi, Is there any Cake-way to fetch data from associations by a previous condition on the main Model? I'll explain myself: Let's say I have a Product Model, which has a hasMany association with an Image Model. The Product has a field called type which defines the type of the Product. For example, by the nature of the app, I know that only Products that are Product.type='STANDARD' can have images. But when i make a find('all) cake always try to fetch the Images for every Product. For performance, it would be better to define, before the find('all'), to only apply the association on Products which their type was 'STANDARD'. Internally on a find('all') over an object A, if a hasMany association exists with a B Object, cake first gets the data of every A object, and then gets for every A object found, the associated B Objects. I mean that for what I'm looking for, that information would be there before trying to fetch the associated data. Has someone faced something similar? Thanks in advance. Vicent, 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
Properly Normalizing a Products Database to work harmoniously with Cake
Hello all! I'm a novice to CakePHP, have a rusty set of PHP skills, and am maybe a 5/10 when it comes to MySQL databases in general. I was recently hired by a company wanting to bring their catalog design and web development in-house. After digging through the existing site's raw PHP code, I've decided to rebuild it from scratch with Cake. I'm blown away by what Cake can do and how it does it! My last large-scale PHP/ MySQL project was during the php3-php4 transition when PHPLib was the hottest thing around. My company sells Widgets in the Medical field...lots of them...nearly 20,000. My largest task at hand is to build an app to both populate a Widgets database and search the data. It's a little overwhelming and I need some advice. First, all Widgets have a unique Widget Number. All Widgets can be divided into Top-Tier categories a couple different ways. For example, a Widget could fall under Forceps or Scissors or Clamps, and could also land under Cardiovascular and/or Neurospinal and/or Dental. A Clamp will always be just a Clamp, but the same Clamp could be useful in both Cardiovascular AND Neurospinal. So categorization presents a challenge. Additionally, all Widgets have a number of properties in common. They all have a Price. They all have a Name. They all have Dimensions. Here's the really tricky part that's making my brain hurt. They also all have a number of properties that are unique either to the item OR to the Widget's category. A Clamp may have a curvature with a specific radius. A set of Forceps may have an angle. A Needle Holder may be Straight or Curved, and may also have jaws that are either Stainless Steel, Tungsten Carbide Coated, or Titanium with Tungsten Carbide coating. There are also relationships between certain items that I'd want to be available for Related Widgets display on a Widget's page. For example, a Titanium Needle Holder with Tungsten Carbide Coating may be available in 6, 7, 8, 9 lengths, with jaws that are 1mm, 2mm, 3mm, 4mm wide and jaws that are Straight or Curved. I need to somehow be able to make it clear in the database structure which Widgets are related to other Widgets and how; keeping in mind refinable searches (Show me all Titanium Curved-jaw Needle Holders). Then there are things like Cases that hold predefined Sets of Widgets, Widgets with X and Y dimensions vs. Widgets with X, Y and Z dimensions.and on and on and on. Not only am I trying to figure out how to create this beast of a relational database, I'm also trying to ensure from the beginning that it's optimized for CakePHP and remains highly flexible for all the unforeseen additions and changes down the road. Brain.very.exploding. Please help! A thousand thank-yous in advance to all who read and any who respond! ~PF 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
Nice url for webroot/files
I am offering my users a link where they can download uploaded files http://www.example/app/webroot/files/[subdir]/[filename] is it possible to give a nice url using route.php like http://www.example/files/[subdir]/[filename] 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: Nice url for webroot/files
Your best bet is to use the Media view. http://book.cakephp.org/view/489/Media-Views On Nov 24, 11:49 am, RugerJ hoogervo...@gmail.com wrote: I am offering my users a link where they can download uploaded files http://www.example/app/webroot/files/[subdir]/[filename] is it possible to give a nice url using route.php likehttp://www.example/files/[subdir]/[filename] 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: paginate loosing args
in the paginate array in your view file add 'url'=$this-passedArgs On Tue, Nov 24, 2009 at 1:24 PM, Mario Cesar mario...@gmail.com wrote: Hi All!! I have a problem with paginate, I'll try explicate: I have a form that method is post the result is ok in first page but if I click in other page or some order the paginate returns all rows of my table he is loosing the args and I'm using the passedArgs in View page what can i do? 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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: Creating a login screen
if the url is /admin/users/login then Cake will look for an action called admin_login in users_controller.php . Change the name of the login function to this and let me know if that works. On Tue, Nov 24, 2009 at 12:28 PM, Dewayne Pinion dpin...@gmail.com wrote: I did not, but I tried uncommenting it and still got the same error. On Tue, Nov 24, 2009 at 12:22 PM, josu jauregui jos...@gmail.com wrote: Do you have uncommented line Configure::write('Routing.admin', 'admin'); in core.php?? -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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: Creating a login screen
And remove this from your routes.php: Router::connect('/admin', array('controller' = 'pages', 'action' = 'index', 'admin' = true)); but leave Configure::write('Routing.admin', 'admin'); uncommented in core.php On Tue, Nov 24, 2009 at 3:24 PM, Dave davidcr...@gmail.com wrote: if the url is /admin/users/login then Cake will look for an action called admin_login in users_controller.php . Change the name of the login function to this and let me know if that works. On Tue, Nov 24, 2009 at 12:28 PM, Dewayne Pinion dpin...@gmail.comwrote: I did not, but I tried uncommenting it and still got the same error. On Tue, Nov 24, 2009 at 12:22 PM, josu jauregui jos...@gmail.com wrote: Do you have uncommented line Configure::write('Routing.admin', 'admin'); in core.php?? -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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: Creating a login screen
Hi Dewayne, Just checking - do you have the opening and closing php tag? i.e. ?php class UsersController extends AppController{ var $name = 'Users'; var $components = array('Auth'); funciton login() { } function logout() { $this-redirect($this-Auth-logout()); } } ? On 24 Nov 2009, at 19:17, Dewayne Pinion wrote: Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.com wrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.com wrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller Error: UsersController could not be found. Error: Create the class UsersController below in file: app/ controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? Notice: If you want to customize this error message, create app/ views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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=en . -- 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=en . 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 -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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 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 -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com Check out the new CakePHP Questions site http://cakeqs.org and
Re: Creating a login screen
AHHH! I can't believe I overlooked that. That fixed it, thank you! I feel like a dummy about now.. lol. So for the next part of this little project, how do I default to this login page? For example, currently if you go to mysite/admin/comments, you are taken to the comments page. However, I would like to redirect the user first to the login page. Any advice or links? On Tue, Nov 24, 2009 at 3:10 PM, Martin Atukunda matl...@gmail.com wrote: Hi Dewayne, Just checking - do you have the opening and closing php tag? i.e. ?php class UsersController extends AppController{ var $name = 'Users'; var $components = array('Auth'); funciton login() { } function logout() { $this-redirect($this-Auth-logout()); } } ? On 24 Nov 2009, at 19:17, Dewayne Pinion wrote: Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.com wrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.com wrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller Error: UsersController could not be found. Error: Create the class UsersController below in file: app/ controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? Notice: If you want to customize this error message, create app/ views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en . -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en . 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com 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
Re: paginate loosing args
i tried but didn't work On Tue, Nov 24, 2009 at 6:20 PM, Dave davidcr...@gmail.com wrote: in the paginate array in your view file add 'url'=$this-passedArgs On Tue, Nov 24, 2009 at 1:24 PM, Mario Cesar mario...@gmail.com wrote: Hi All!! I have a problem with paginate, I'll try explicate: I have a form that method is post the result is ok in first page but if I click in other page or some order the paginate returns all rows of my table he is loosing the args and I'm using the passedArgs in View page what can i do? 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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: paginate loosing args
If you are using POST to send the ID of the target article then try sending it using GET On Tue, Nov 24, 2009 at 3:31 PM, Mario Cesar mario...@gmail.com wrote: i tried but didn't work On Tue, Nov 24, 2009 at 6:20 PM, Dave davidcr...@gmail.com wrote: in the paginate array in your view file add 'url'=$this-passedArgs On Tue, Nov 24, 2009 at 1:24 PM, Mario Cesar mario...@gmail.com wrote: Hi All!! I have a problem with paginate, I'll try explicate: I have a form that method is post the result is ok in first page but if I click in other page or some order the paginate returns all rows of my table he is loosing the args and I'm using the passedArgs in View page what can i do? 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- http://phpirate.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: Creating a login screen
First read this CLOSELY: http://book.cakephp.org/view/172/Authentication Then google CakePHP Auth tutorial and follow one if you need more info... A lot of people get messed up with the Auth Component so read as much as you can. One thing that will probably mess you up: You want to change your login action to not be in admin routing. It needs to be publicly accessible. Then you can use the Auth Component to deny all admin actions. It is possible to keep it in admin routing and add an exception but when you are first learning Auth it is best to follow the KISS motto until you are more comfortable. On Tue, Nov 24, 2009 at 3:30 PM, Dewayne Pinion dpin...@gmail.com wrote: AHHH! I can't believe I overlooked that. That fixed it, thank you! I feel like a dummy about now.. lol. So for the next part of this little project, how do I default to this login page? For example, currently if you go to mysite/admin/comments, you are taken to the comments page. However, I would like to redirect the user first to the login page. Any advice or links? On Tue, Nov 24, 2009 at 3:10 PM, Martin Atukunda matl...@gmail.comwrote: Hi Dewayne, Just checking - do you have the opening and closing php tag? i.e. ?php class UsersController extends AppController{ var $name = 'Users'; var $components = array('Auth'); funciton login() { } function logout() { $this-redirect($this-Auth-logout()); } } ? On 24 Nov 2009, at 19:17, Dewayne Pinion wrote: Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.com wrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.com wrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller Error: UsersController could not be found. Error: Create the class UsersController below in file: app/ controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? Notice: If you want to customize this error message, create app/ views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en . -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en . 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
Re: paginate loosing args
*I tried too * On Tue, Nov 24, 2009 at 6:36 PM, Ma'moon phpir...@gmail.com wrote: If you are using POST to send the ID of the target article then try sending it using GET On Tue, Nov 24, 2009 at 3:31 PM, Mario Cesar mario...@gmail.com wrote: i tried but didn't work On Tue, Nov 24, 2009 at 6:20 PM, Dave davidcr...@gmail.com wrote: in the paginate array in your view file add 'url'=$this-passedArgs On Tue, Nov 24, 2009 at 1:24 PM, Mario Cesar mario...@gmail.com wrote: Hi All!! I have a problem with paginate, I'll try explicate: I have a form that method is post the result is ok in first page but if I click in other page or some order the paginate returns all rows of my table he is loosing the args and I'm using the passedArgs in View page what can i do? 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- http://phpirate.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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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: Associate by condition
Couldn't you just create a method in your model which does this, using Find()? For example, FindStandard() or FindByType('STANDARD')? I believe that's Cake-y, and it keeps your controller lean and your model fat :) Ian On Nov 24, 2:18 pm, villosil villo...@gmail.com wrote: Hi, Is there any Cake-way to fetch data from associations by a previous condition on the main Model? I'll explain myself: Let's say I have a Product Model, which has a hasMany association with an Image Model. The Product has a field called type which defines the type of the Product. For example, by the nature of the app, I know that only Products that are Product.type='STANDARD' can have images. But when i make a find('all) cake always try to fetch the Images for every Product. For performance, it would be better to define, before the find('all'), to only apply the association on Products which their type was 'STANDARD'. Internally on a find('all') over an object A, if a hasMany association exists with a B Object, cake first gets the data of every A object, and then gets for every A object found, the associated B Objects. I mean that for what I'm looking for, that information would be there before trying to fetch the associated data. Has someone faced something similar? Thanks in advance. Vicent, 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
How set value for root parents using tree recover
Hello, When using recover the parent_id fields for root entries are empty. Is there a way to set a default value like -1 as parent_id for root items? Thanks Aldo 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 set value for root parents using tree recover
On 24 nov, 21:48, Aldo abombe...@gmail.com wrote: Hello, When using recover the parent_id fields for root entries are empty. Is there a way to set a default value like -1 as parent_id for root items? why 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: Creating a login screen
To redirect the user first to the login page instead of the standard home/welcome page edit app/config/routes.php and change this line: Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); to Router::connect('/', array('controller' = 'users', 'action' = 'login')); - Martin - On 24 Nov 2009, at 23:30, Dewayne Pinion wrote: AHHH! I can't believe I overlooked that. That fixed it, thank you! I feel like a dummy about now.. lol. So for the next part of this little project, how do I default to this login page? For example, currently if you go to mysite/admin/ comments, you are taken to the comments page. However, I would like to redirect the user first to the login page. Any advice or links? On Tue, Nov 24, 2009 at 3:10 PM, Martin Atukunda matl...@gmail.com wrote: Hi Dewayne, Just checking - do you have the opening and closing php tag? i.e. ?php class UsersController extends AppController{ var $name = 'Users'; var $components = array('Auth'); funciton login() { } function logout() { $this-redirect($this-Auth-logout()); } } ? On 24 Nov 2009, at 19:17, Dewayne Pinion wrote: Hi Josu, It should be enabled. I do have other pages/controllers that are working. The contents of my users_controller.php file is as follows: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth- logout()); } } On Tue, Nov 24, 2009 at 11:10 AM, josu jauregui jos...@gmail.com wrote: Hi! Is your mod_rewrite activated?. Can you send me the users_controller file to make some tests?. Bye! 2009/11/24 Dewayne Pinion dpin...@gmail.com Hi Josu, Thank you for the response. Yes, I have the file created and it is in the app/controllers directory On Tue, Nov 24, 2009 at 10:32 AM, josu jauregui jos...@gmail.com wrote: Hi!. Sorry but my english is not good. You must be sure that the name of the controller file is users_controller.php and it´s in app/controllers directory. I hope this can help you. 2009/11/24 Dave davidcr...@gmail.com Can you be more specific about when you get this error? What is the URL cake is trying to access On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller Error: UsersController could not be found. Error: Create the class UsersController below in file: app/ controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? Notice: If you want to customize this error message, create app/ views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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=en . -- 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=en . 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 -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com Check out the new CakePHP Questions site http://cakeqs.org and help others
Re: Nice url for webroot/files
On 24 nov, 20:49, RugerJ hoogervo...@gmail.com wrote: I am offering my users a link where they can download uploaded files http://www.example/app/webroot/files/[subdir]/[filename] Are you hand writing that url? is it possible to give a nice url using route.php likehttp://www.example/files/[subdir]/[filename] sure echo $html-url('/files/[subdir]/[filename]') will give you that url. 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: paginate loosing args
Please send a controller dump and your view code so we can help you On Tue, Nov 24, 2009 at 3:38 PM, Mario Cesar mario...@gmail.com wrote: *I tried too * On Tue, Nov 24, 2009 at 6:36 PM, Ma'moon phpir...@gmail.com wrote: If you are using POST to send the ID of the target article then try sending it using GET On Tue, Nov 24, 2009 at 3:31 PM, Mario Cesar mario...@gmail.com wrote: i tried but didn't work On Tue, Nov 24, 2009 at 6:20 PM, Dave davidcr...@gmail.com wrote: in the paginate array in your view file add 'url'=$this-passedArgs On Tue, Nov 24, 2009 at 1:24 PM, Mario Cesar mario...@gmail.comwrote: Hi All!! I have a problem with paginate, I'll try explicate: I have a form that method is post the result is ok in first page but if I click in other page or some order the paginate returns all rows of my table he is loosing the args and I'm using the passedArgs in View page what can i do? 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- http://phpirate.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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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.comcake-php%2bunsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- http://phpirate.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: Creating a login screen
is the admin routing in the core.php is enabled? On Tue, Nov 24, 2009 at 8:58 AM, Dewayne Pinion dpin...@gmail.com wrote: I have been following the directions there and haven't made it very far. I end up with the following error: Missing Controller *Error: * *UsersController* could not be found. *Error: * Create the class *UsersController* below in file: app/controllers/users_controller.php ?php class UsersController extends AppController { var $name = 'Users'; } ? *Notice: * If you want to customize this error message, create app/views/errors/missing_controller.ctp From my users_controller.php file: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); function login() { } function logout() { $this-redirect($this-Auth-logout()); } } login.ctp file: ?php $session-flash('auth'); echo $form-create('User', array('action' = 'login')); echo $form-input('username'); echo $form-input('password'); echo $form-end('Login'); ? any ideas? On Mon, Nov 23, 2009 at 9:47 AM, ddaffy dda...@gmail.com wrote: take a look at: http://book.cakephp.org/view/172/Authentication chnology.com http://www.trentontechnology.com -- Dewayne Pinion Web/Software Guy Trenton Technology http://www.trentontechnology.com -- 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.comcake-php%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/cake-php?hl=en. 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
Form Action URL from Router
I have an application that uses Auth and ACL to check permissions in the app_controller. I am also checking permissions on every AJAX call by using jQuery's AjaxSetup to capture the XmlHttpRequest URL. This process works perfectly for any manual AJAX call, but for Ajaxified forms the action URL contains both the CAKE and APP_DIR which messes up my ACL check because it doesn't recognize controller, CAKE or the action, APP_DIR. On top of that, my ACL check needs a camelized controller and a variablized action, and the URL sent by the form helper has put underscores in the controller name. Can anyone suggest a better way to check permissions on both static page changes AND AJAX calls without leaving the GUI? When a ACL check fails in my app_controller it redirects to a failed permissions error page. That is fine for static page changes, but in the middle of an AJAX GUI it is a nightmare. I need AJAX permission checks to respond within the AJAX framework rather than taking the user out of it to a message page. Please help! 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 set value for root parents using tree recover
I'm migrating a tree backend to cake. Unfortunately there are manay functions who depend from this value, as they look for -1 to identify a root entry. On 24 Nov., 21:50, AD7six andydawso...@gmail.com wrote: On 24 nov, 21:48, Aldo abombe...@gmail.com wrote: Hello, When using recover the parent_id fields for root entries are empty. Is there a way to set a default value like -1 as parent_id for root items? why 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: Form Action URL from Router
Solved it: function checkPermissions(){ Configure::write('debug', 0); $this-layout = 'ajax'; $user = $this-Auth-user('username'); // Sanitize URL for either development or production server if(!strrpos($this-params['url']['url'], 'cake/missio')) $url = str_replace('Users/checkPermissions//','',$this-params ['url']['url']); else $url = str_replace('Users/checkPermissions//cake/missio/','', $this-params['url']['url']); $pieces = explode('/', $url); $controller = Inflector::camelize($pieces[0]); $action = Inflector::variable($pieces[1]); $aco = $controller.'/'.$action; if($this-Acl-check($user, $aco, '*')) $perm = 'allowed'; else $perm = 'denied'; $this-set('data', $perm); } 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
How use AUTH for two sections (admin eshop, client admin)
Hi, is any idea. How use AUTH for two admin sections? First: Admin section, when user log. can add new products, and other informations. Second: Client admin: user log. can shopping, do order, check order I must use ACL or role in user and how i can do, when client login can view only views for orders, ... and admin user can use add products, kind.. but cant shopping.. THX 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 with Host Gator
Try add RewriteBase / to app/webroot/.htaccess On Nov 24, 7:24 pm, Shadab Shaikh rws.sha...@gmail.com wrote: Dear All, I have setup a project in Host Gator, its using cpanel. As I am doing normal setup, than its not displaying any page. After research, I found an article in which guidelines mentioned for cpanel, page ishttp://www.cakephp.co.uk/installing_cakephp_on_cpanel_server.html When I am using guidelines mentioned in above page, my home page work perfectly, but rest of pages is not working, I am getting page not found error. I appreciate your comments to give more idea about this problem. Thanks in advance ! Best Regards, Shadab 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: Setting form action to something like /Accounts/Manage/?var=b73cr6xzr6zvar2=somethingelse
All as you asked. And Cake properly encoded HTML entities as symbols are restricted in source and must be represented in text as amp; On Nov 24, 9:43 pm, Ragnis ragnis.ar...@gmail.com wrote: When doing it like this: array ('controller' = 'Accounts', 'action' = 'Manage', '?' = array ('var' = 'b73cr6xzr6z', 'var2' = 'somethingelse')) then the result will be /Accounts/Manage/? var=b73cr6xzr6zamp;var2=somethingelse On Nov 24, 6:31 am, Dr. Loboto drlob...@gmail.com wrote: You can set form action as: array ('controller' = 'Accounts', 'action' = 'Manage', '?' = array ('var' = 'b73cr6xzr6z', 'var2' = 'somethingelse')) On Nov 23, 9:22 pm, Ragnis ragnis.ar...@gmail.com wrote: I need them as GET variables. My form is at /Accounts/Manage/?var=b73cr6xzr6zvar2=somethingelse and when i submit the form, the GET variables will be gone but i want them to stay. On Nov 22, 11:39 pm, Amit a...@amitvaria.com wrote: Is there a reason you can't just include the vars in the form? $form-input('var', array('type'='hidden', 'value'= 'b73cr6xzr6z')); On Nov 22, 12:54 pm, Ragnis ragnis.ar...@gmail.com wrote: So how can i do that? And i don't want to use /Accounts/Manage/var:b73cr6xzr6z/ var2:somethingelse 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
Finds and Arrays
I've run into an interesting problem today. Here's the scenario. I have 3 Models: Station (model) id station_id Store (model) id station_id phase_id Phase (model) id phase And the relationships are: Store belongsTo Station -- Store belongsTo Phase Station hasOne Store Phase hasMnay Store Now whats happening is, from the Stations_Controller, I want to do a Find where I pull that Station's corresponding Store ID, and THAT Store's corresponding Phase. So my find looks like the following: $products = $this-Station-Store-find('first', array('fields' = array('Store.id', 'Phase.phase'),'conditions' = array('Station.id' = $id))); If I print_r($products) after that find, I get the following: Array ( [Store] = Array ( [id] = 1 ) [Phase] = Array ( [phase] = Building For Staging ) ) Notice that that are 2 arrays: Store, and Phase. The questions is: Is there anyway to make it so the array becomes: Array ( [Store] = Array ( [id] = 1 [phase] = Building For Staging)) 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
Blog Tutorial
I have some basic questions about the blog tutorial 1 What does edit($id = null) mean, is $id being reset tot null? 2 What does $this-Post-id = $id; then do, make it null too? 3 Why do we check again if the data is empty, the data validation prevents it from being empty? Thanks in advance! http://book.cakephp.org/view/340/Editing-Posts function edit($id = null) { $this-Post-id = $id; if (empty($this-data)) { $this-data = $this-Post-read(); } else { if ($this-Post-save($this-data)) { $this-Session-setFlash('Your post has been updated.'); $this-redirect(array('action' = 'index')); } } } 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
admin routing shows CSS when behind an SSL
Hey Everyone, This is a really odd problem and I will do my very best to explain what is happening here. As I have no idea what is happening. What I found is that we setup a SSL and this is my domain.com/.htaccess file IfModule mod_rewrite.c RewriteEngine on RewriteCond %{HTTP_HOST} ^identityalert.org [NC] RewriteRule ^(.*)$ http://www.identityalert.org/$1 [L,R=301] RewriteCond %{HTTPS} off RewriteCond %{SERVER_PORT} ^80$ RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteRule ^$ app/webroot/[L] RewriteRule (.*) app/webroot/$1 [L] /IfModule As you can see it will redirect the browser if it's not http://www. then it will redirect if it's not https://www. All that works great. My entire cake app works great too so no issues there. Problem is when I do https://www.identityalert.org/admin (go there you will see the CSS) Why does it just show the CSS? I have removed the second block (with the SSL code) in the .htaccess file and everything runs smoothly. What can I do? I'm completely stuck and baffled. If you guys need any other code let me know. Thanks! Chad 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
Export to CSV using Helper, resulting error
Hi all, I am trying to put a download link on one of my view, so when user click on that link it will automatically generate a csv file and pop up for user to download. I followed the instruction here http://blog.allmythingstodo.com/tag/cakephp/using the helper from Adam Royle ( http://bakery.cakephp.org/articles/view/csv-helper-php5) However, when I click on my link.. this is shown: Notice (8): Undefined variable: csv [APP\controllers\dispatches_controller.php, line 158] Fatal error: Call to a member function addRow() on a non-object in C:\xampp\htdocs\cake\app\controllers\dispatches_controller.php on line 158 Please help. Thank you. ** 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
Installation Issue - HELP!!! www.medfuse.com
I've been developing an app on my localhost. Now I'm trying to get CAKEPHP up and running on my webhost (Webhost4llife). Can someone take a look at www.medfuse.com? I can't figure out what the problem is, it's pulling in the default layout, but going to any of controller/ actions does not seem the work. I get an internal server error, 500 Error. I could really use some help. Anyone, any ideas? document root is set to app/webroot/ mod_rewrite is on I've spend hours trying to locate the problem. Your help would be really appreciated 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: Installation Issue - HELP!!! www.medfuse.com
The first things I would check are your .htaccess files. I faced similar issues setting up a site on a hosting service. Take a look at this http://www.jeremy-burns.co.uk/2009/08/setting-up-cakephp-on-a-11-server/ and see if it helps. On Nov 25, 5:04 am, robert matousek r.k.matou...@gmail.com wrote: I've been developing an app on my localhost. Now I'm trying to get CAKEPHP up and running on my webhost (Webhost4llife). Can someone take a look atwww.medfuse.com?I can't figure out what the problem is, it's pulling in the default layout, but going to any of controller/ actions does not seem the work. I get an internal server error, 500 Error. I could really use some help. Anyone, any ideas? document root is set to app/webroot/ mod_rewrite is on I've spend hours trying to locate the problem. Your help would be really appreciated 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: Blog Tutorial
1. edit($id = null) will set the default value of $id to null if nothing is passed into edit. If a value is passed to edit $id = null will be ignored. 2. $this-Post-id = $id will assign the value of $id to the Post model. If nothing is passed into edit() null will be assigned. 3. if(empty($this-data)) is checking the current form data. If data is empty the form hasn't been submitted. $this-data = $this-Post-read(); than pulls the Post data and assigns it to data so the form can be populated with the current Post values for editing. On Tue, Nov 24, 2009 at 4:58 PM, cakephp9 cakephp9 cakep...@gmail.com wrote: I have some basic questions about the blog tutorial 1 What does edit($id = null) mean, is $id being reset tot null? 2 What does $this-Post-id = $id; then do, make it null too? 3 Why do we check again if the data is empty, the data validation prevents it from being empty? Thanks in advance! http://book.cakephp.org/view/340/Editing-Posts function edit($id = null) { $this-Post-id = $id; if (empty($this-data)) { $this-data = $this-Post-read(); } else { if ($this-Post-save($this-data)) { $this-Session-setFlash('Your post has been updated.'); $this-redirect(array('action' = 'index')); } } } 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 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
MySQL Duplicate entry on Create Error
I was inserting new rows through my application and then suddenly I started receiving this error: Warning (512): SQL Error: 1062: Duplicate entry '127' for key 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 525] The AUTO_INCRIMENT is set to 128 on the 'id' field and it was working perfectly until now. It seems stuck on trying to create id '127'. Any ideas? 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: MySQL Duplicate entry on Create Error
It sounds like the data type of your id field is a signed tinyint, which has a maximum value of 127. The range is -127 to 127 (or something close to that). You need to change the data type. If you make it unsigned it has a range of 0 to 255. If that isn't enough you'll have to increase it to smallint. I generally use unsigned integers as I rarely need to store minus values (especially if they auto increment) and they take up less database space. When you make the change from signed to unsigned in your database clear down the size field as you do it. Depending upon the tool you are using to manage your database (I use the excellent Sequel Pro) it will default it to the smallest acceptable value. On Nov 25, 5:51 am, TimG t...@gurske.com wrote: I was inserting new rows through my application and then suddenly I started receiving this error: Warning (512): SQL Error: 1062: Duplicate entry '127' for key 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 525] The AUTO_INCRIMENT is set to 128 on the 'id' field and it was working perfectly until now. It seems stuck on trying to create id '127'. Any ideas? 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: admin routing shows CSS when behind an SSL
I had the same issue a few weeks ago. I did not have any custom htaccess or SSL installed. It was a controller issue. My controller couldn't do what I wanted it to do so it was just loading the css file. I can't remember exactly what I did to fix it... sorry. But in my case it WAS a controller issue. Also, try deleting the css file and see what happens. 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: MySQL Duplicate entry on Create Error
Thank you sir you are a miracle worker!!! 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: admin routing shows CSS when behind an SSL
I'm still trying to remember: Treat the css loading as an error. Your controller isn't liking the URL when being redirected from the htaccess file. Maybe something to do with SSL and the router/routes? Without being able to explain exactly what is going on I can suggest that you try using something like this instead of that htaccess: http://techno-geeks.org/2009/03/using-the-security-component-in-cakephp-for-ssl/ 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
How to have 2 forms on one page for same model
Hi All. I need to have 2 forms on a page that add an item to the db using the same model. The trouble is, they are setting each others validation off. How can i isolate the forms so they still use the models validation but only the form whos button has been clicked gets validated? Thanks for any guidence Will 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
retrieving contacts from an email account by php code
hey could anyone tel me how to retrieve the contacts from an email address if i have the email address and its password..tel me a way to retrieve by the by the php code.. plz anyone help me... 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