Re: $model-save - which id is used?
on edit it uses the id of the record you pulled up. on add it uses the next auto-incremented id. On May 8, 11:18 am, Jonathan jst...@image.dk wrote: Here is a pretty simple save example from the manual: function edit($id) { if(!empty($this-data)) { if($this-Recipe-save($this-data)) { ... } } } Somehow save knows which Recipe id to update, but we never tell it - and it is not part of $this-data. How does save know it? Regards Jonathan --~--~-~--~~~---~--~~ 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: css problem
your syntax seems ok but when you load firebug and expand the + on the css line do you see it loading an html page (missing method/ controller)? if so your file is in the wrong spot. make sure it's in / webroot/css On May 9, 6:56 pm, Paulos23 paulitosthe...@gmail.com wrote: Hello guys. i am having a trouble with css.In particular i started creating my own layouts and css files and when i tried to load the page the css didnt load.I used firebug and i realize that no css file is applied for the layout. Inside the layout which is named user.ctp i linked the css file with --- ?php echo $html-css('style') ? And i create a similar css file to cake.generic.css.Is there any problem with mod rewrite and cake cant load this .css? Any help would be amazing! Thx in advance. Paulos --~--~-~--~~~---~--~~ 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: Foreign Key
technically i believe foreign keys just have to have the same data type as the related primary key. but i didn't google it. On May 8, 5:10 am, Miles J mileswjohn...@gmail.com wrote: If you want a slug, you still would need an id. I do this all the times, for example my table: Category: id, slug, title ID is used internally, where as slug would just be for URLs. --~--~-~--~~~---~--~~ 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: Splitting a Controller in two?
Hi! Could you write how to configure cake to have admin section in separate class? Thanks. On 3 Bal, 01:05, Miles J mileswjohn...@gmail.com wrote: There isn't really any disadvantages. For a few of my projects, I made the admin a completely separate application and had both apps share the same cake libs and models. --~--~-~--~~~---~--~~ 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: css problem
ty james for your reply.I finally found it :) 2009/5/10 JamesF usaexportexpe...@gmail.com your syntax seems ok but when you load firebug and expand the + on the css line do you see it loading an html page (missing method/ controller)? if so your file is in the wrong spot. make sure it's in / webroot/css On May 9, 6:56 pm, Paulos23 paulitosthe...@gmail.com wrote: Hello guys. i am having a trouble with css.In particular i started creating my own layouts and css files and when i tried to load the page the css didnt load.I used firebug and i realize that no css file is applied for the layout. Inside the layout which is named user.ctp i linked the css file with --- ?php echo $html-css('style') ? And i create a similar css file to cake.generic.css.Is there any problem with mod rewrite and cake cant load this .css? Any help would be amazing! Thx in advance. Paulos --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
New Komodo Macro -- CakePHP Toggle
I just wanted to announce a new CakePHP macro I created for Komodo Edit. It is compatible with CakePHP 1.2+. Please check it out if you're a Komodo user. I've pasted the features below: The general purpose of the macro is to allow easy navigation between CakePHP model/view/controller files. It should work cross-platform as I did all directory path parsing using 'os.sep'. It is defaulted to be activated by CTRL+SHIFT+Z Activating the macro does the following depending on your current open file in Komodo: * If in a MODEL, it opens the corresponding CONTROLLER * If in a VIEW, it opens the corresponding CONTROLLER and moves the cursor to the function block that calls said VIEW * If in a CONTROLLER, one of 2 actions is taken: o If the cursor is on a line that declares a function associated to a view, that view will be opened. If that view does not exist, you will be prompted to create the view file automatically. o If the cursor is on a line that does not declare a function, it opens the associated MODEL Available At: http://community.activestate.com/forum/cakephp-toggle-eases-cakephp-navigation --~--~-~--~~~---~--~~ 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: Poll: what do you hate about CakePHP?
Don't quite understood... You can always unbind relationships and select the fields you want with find On May 8, 6:00 am, gaurav.v.sharma gaurav.v.sha...@gmail.com wrote: if one could modify the amount of data that cake fetches during any operation. For example the action index fetches more result than needed thereby making the application a bit slower... and improved tutorials on advanced techniques used in cake like acl.. On May 8, 3:29 am, Nate nate.ab...@gmail.com wrote: Well, maybe hate's a strong word. Let's say, what do you like the least? Kind of an odd question, I know, but since we've kick-started development of a new version, I'd like to know what the most frustrating things with the framework are, even if they're things we can't fix right away. I'll get us started: PHP 4 support. Who's next? TIA for the input. --~--~-~--~~~---~--~~ 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: No multiple select. Why?
If you don't want to add them by hand ever time. I've written a function that will do it for you: http://www.richardathome.com/blog/cakephp-auto-populating-foreign-key-dropdown-fields On May 8, 3:16 pm, brian bally.z...@gmail.com wrote: Did you fetch a list of Users in your controller? FormHelper can only work with what's already set in your $viewVars. On Fri, May 8, 2009 at 5:34 AM, GetIT david.bruen...@t-online.de wrote: I want checkboxes displaying all users in my database. For example: In my app some users can add new documents and they can choose which users have the right to see the docs. So in my fileupload form I want to add checkboxes showing all users. But this doesn´t work. In the documentation of CakePHP I see that: # $form-input('Model.field', array( 'type' = 'select', 'multiple' = 'checkbox' )); So I put this code in my app: echo $form-input('User.name', array( 'label' = 'Users', 'type' = 'select', 'multiple' = 'checkbox' )) . \n; But the output only is the value of the label: Users What´s the failure? --~--~-~--~~~---~--~~ 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: Default value of INT NOT NULL fields
My suggestion, as far as I understood you, cakephp inserts NULL instead of '0' right? Set your database to default '0' as it should work. - If it does not add function beforeSave() { /* ... */ } to your YourModelWithLotsOfInts - Within that check if a variable is a.) or empty or NULL or whatever your want to test again - ...As well if it is your desired INT - check var $_schema for that. - You can do that in a loop against the data array. - If the constrains are right just change those values before saving. --~--~-~--~~~---~--~~ 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: $model-save - which id is used?
On May 10, 8:25 am, JamesF usaexportexpe...@gmail.com wrote: on edit it uses the id of the record you pulled up. Thanks for your reply, - but I don't pull up anything before I call save... The id of the record to be modified is only present as a parameter to the edit function. In some auto-magic way, the model learns about this id. But how? Regards Jonathan --~--~-~--~~~---~--~~ 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: Permission problem in baking script
On May 9, 7:30 am, zarbizade zarbizad...@gmail.com wrote: The error is something like this Web Server has not Permission To create file in /var/www/app/temp . Is there any Solution to These problem.If i try to give permission using my root user will be work or not? No guarantee, but the /app/tmp directory must be writable by the web- server, so I guess that will work (see http://book.cakephp.org/view/31/Permissions). Regards Jonathan --~--~-~--~~~---~--~~ 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: New Komodo Macro -- CakePHP Toggle
On May 9, 6:58 pm, shaggz tyler.scha...@gmail.com wrote: I just wanted to announce a new CakePHP macro I created for Komodo Edit. It is compatible with CakePHP 1.2+. Hi shaggz, Interesting stuff, why not take a look at writing a komodo wrapper for the cakemate plugin (http://thechaw.com/cakemate) which puts most of the logic in a cake shell. In this way your marco would only need to construct the right parameters for a cake-console call, and be able to parse the result. E.g, here's the vim equivalent for opening the model of whatever you're currently editing: http://thechaw.com/cakemate/source/vendors/vim/plugins/cakephp.vim#239 AD --~--~-~--~~~---~--~~ 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: Lang in url and named parameters
I want to keep the :lang parameter in the url for SEO purposes. This way each ressource of my app will have a different url and my pages will be indexed in all the available languages (seems logical as their content will be different). On 8 mai, 18:55, John Andersen j.andersen...@gmail.com wrote: Thanks :) My question then is, why do you carry along this parameter in the url? In my opinion, it should just be remembered in the session, until the user chooses another language (if ever). Is it for other reasons, that you want to carray the parameter in the url? John On May 8, 4:03 pm, Pixelastic timcc.pe...@gmail.com wrote: Yes, that is the purpose of this parameter. On May 8, 2:16 pm, John Andersen j.andersen...@gmail.com wrote: Is the purpose of the named parameter (lang) for you to be able to present content in the specified language? John [snip] --~--~-~--~~~---~--~~ 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: Authentication problem
But the problem still goes on. The saved password in database is hashed. But they always shows 'login error' while trying to log in. On May 9, 8:51 pm, brian bally.z...@gmail.com wrote: Auth hashes the password automatically. On Fri, May 8, 2009 at 11:39 PM, carlito towhid...@gmail.com wrote: I m using auth component in my project.In my beforesave() function in user.php i used this to hash password. if(isset($this-data[$this-alias]['password'])) $this-data[$this-alias]['password'] = Security::hash($this-data [$this-alias]['password'], null, true); But it login error still remains. I think i need to hash the password i give as input. If that's right then how to do it?? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Folder structure
One thing I don't like of CakePHP is the way the folder structure is done. When working on one particular resource, you have to navigate on three different folders: (models, controllers, and views/resource). If the folder structure were resource-oriented, one could have a folder for every resource, and contain the model, controller and view files. You can even use this configuration to give Cake some mtadata about the resource (just a thought). --~--~-~--~~~---~--~~ 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: hasOne relationship problem
Looking through cake/libs/model/model.php I don't see anywhere in saveAll where a check is done for a hasone association. (May have missed it). I don't see how it could do this by default in any case. It could recognize the hasone association but then how would it verify uniqueness. It couldn't use the ID since that is unique for every record. And it doesn't know which field to use to check uniqueness. Since username should be unique I would say that you should add a validate for isUnique for the username. This will prevent mulitiple users with the same name and therefore enforce one profile per user. in the User model add this: var $validate = array( 'username' = = array( 'rule' = 'isUnique', 'message' = 'The user name has already been taken', 'required' = true)); On May 9, 3:22 pm, Robin robin2...@gmail.com wrote: Anyone ... pls a little help will be appreciated in the following part.. , but testing the application i was able to create a second profile for one user. I was guessing if thehasOneassociation should check that and return an error, or I am missing something? Thnx On May 5, 5:51 pm, Robin robin2...@gmail.com wrote: Thanks Paulos for your advice. I could certainly add some manual checking before adding a child record. The question I am having in my mind is that should duplicate check be done by thehasOnerelationship or is it possible. Am I missing anything here? Robin On May 5, 2:27 am, paulos nikolo paulitosthe...@gmail.com wrote: Hi Robin.I am not an expert coz i am trying to build a similar app of yours so i ll tell you my opinion.As i saw your tables format i think you should set depentent=true in user model and the exslusive field in profile model true.The 1st one will delete the associated profile if the user has been deleted and the 2nd (i think) is what u search for.Alternatively , you can set the add profile link to invisible when a user has already a profile so that the rest CRUD functions can be shown. 2009/5/4 Robin robin2...@gmail.com Hello, i'm new both to php and cake, so please excuse me if this is another obvious noob question. I was trying to understand how associations work by building up the example in the manual section of cakephp.org, i was able to build it up using bake with no much effort. The thing is, i have a users table and a profiles table, they look like this: CREATE TABLE `profiles` ( `id` int(11) NOT NULL auto_increment, `name` varchar(100) collate utf8_unicode_ci NOT NULL, `header_color` varchar(100) collate utf8_unicode_ci NOT NULL, `user_id` int(11) NOT NULL, PRIMARY KEY (`id`), ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `first_name` varchar(100) collate utf8_unicode_ci NOT NULL, `last_name` varchar(100) collate utf8_unicode_ci NOT NULL, `username` varchar(100) collate utf8_unicode_ci NOT NULL, `password` varchar(100) collate utf8_unicode_ci default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; using bake i was able to create the models and to define the following associations User: var $hasOne= array('Profile' =array('className' = 'Profile', 'foreignKey' = 'user_id', 'conditions' = '', 'fields' = '', 'order' = '', 'dependent' = ''),); Profile: var $belongsTo = array('User' =array('className' = 'User', 'foreignKey' = 'user_id', 'conditions' = '', 'fields' = '', 'order' = '', 'counterCache' = ''),); Which seems good to me, but testing the application i was able to create a second profile for one user. I was guessing if thehasOneassociation should check that and return an error, or I am missing something? On the other hand, i builded the tables based on my own understanding of the example, maybe they are wrong, and so the whole example. I was thinking of adding an UNIQUE clause on the user_id so forcing only one profile per user but doing that causes the application to show an ugly error database message, which is correct and obviously i can take care of it, but not seems to follow the elegant and simple rules of the rest of the application. Thanks in advance Robin --~--~-~--~~~---~--~~ You received this
Re: $model-save - which id is used?
Take a look at $this-Recipe. I think it is in there. debug($this-Recipe); On May 10, 7:33 am, jstein jst...@image.dk wrote: On May 10, 8:25 am, JamesF usaexportexpe...@gmail.com wrote: on edit it uses the id of the record you pulled up. Thanks for your reply, - but I don't pull up anything before I call save... The id of the record to be modified is only present as a parameter to the edit function. In some auto-magic way, the model learns about this id. But how? Regards Jonathan --~--~-~--~~~---~--~~ 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: Email Component Help: smtpError
Hello mscdex, thanks a lot for your answer I haven't used the Email component yet, but I did notice that with the newest version of cake (1.2.3.8166) there was a fix for the Email component. Specifically, instead of sending a hardcoded HELO cake, this newest version will send HELO and then the value of the 'host' smtpOption. This may or may not fix your problem, but I thought it might be worth mentioning since it seems like it may be comparing that HELO string against their host name. I did not understand what you meant with the HELO cake, where does your observation applies? About the from, I'm going to try removing it see how that goes and post back. Thanks! --~--~-~--~~~---~--~~ 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: XML rendering
AAron: I am not sure what your adding to app/xml/data.ctp for. This should be handled like any other view. You need; The parse xml extensions config (which you have) A controller action (your's looks good) An XML view (app/views/CONTROLLERNAME/xml/CONTROLLERACTION.xml Here's an article I wrote after implementing RSS feeds on one of my sites., http://edwardawebb.com/programming/php-programming/cakephp/add-rss-feed-cakephp-models On May 8, 5:54 pm, Aaron Torres tcb...@gmail.com wrote: First off, sorry if this is a duplicate, I submitted a post an hour ago and it still hasn't shown up so I thought I'd try one more time. I'm having extreme difficulty getting cakephp to render xml for me. I've looked through the google groups, the docs, and blog posts via google and as far as I can tell I've done everything that has been suggested. In my routes file: Router::parseExtensions(xml); In my controller: var $components = array('RequestHandler'); function data(){ $message = 'Testing'; $this-set('message', $message); } I've verified that app/data.xml tries to render views/app/xml/data.ctp and also views/layouts/xml/default.ctp (if I create it) In views/app/xml/data.ctp: test case?php echo $message; ?/case /test However, when I navigate to app/data.xml this is what is returned: ?xml version=1.0 encoding=utf-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head title/title /head body Testing !-- 0.1864s -- /body /html I've ran out of ideas, does anyone have any suggestions to get this working? Thanks in advance for any insights you can provide and again, sorry if this posts twice. --~--~-~--~~~---~--~~ 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: $model-save - which id is used?
The id can be found in $this-data. $this-data is automatically filled by the submitted form data and the form sends the id with the post data. The action parameter $id is only used to load the model and fill in the form. Hope that answers your question. - Enrique On 8 Mai, 12:18, Jonathan jst...@image.dk wrote: Here is a pretty simple save example from the manual: function edit($id) { if(!empty($this-data)) { if($this-Recipe-save($this-data)) { ... } } } Somehow save knows which Recipe id to update, but we never tell it - and it is not part of $this-data. How does save know it? Regards Jonathan --~--~-~--~~~---~--~~ 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: Update a DIV jQuery
And you should always keep a good Cheatsheet under your pillow: http://www.gscottolson.com/weblog/2008/01/11/jquery-cheat-sheet/ - Enrique On 9 Mai, 17:19, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: As i drop prototype and move forward with jQuery i need to find replacements for the AJAX i have in my app. How do I update DIV? Originally I had used the update with prototype which ran a function and replaced the div content with the data retrieved from the function. What is the replacement for that with Jquery? Looking thru Google and jquery site but cant seem to find what i would need. Can someone point me in a general direction for the equivalent of prototypes update? Thanks, Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Bug? Plugin and controller with same name
Experience a bug with cake_1.2.3.8166 where I have a Posts plugin that has a controller with same name. When I try to redirect to the index function cake adds :controller in the end. I get this url: http://localhost/~gerhard/gersh.no/admin/posts/:controller Anybody who knows if thats a bug? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
confirm message
Hi peeps, Well i am creating some nice crud functionality and i use some images.All working perfect but i have problem with the delete action coz i want a confirm message to appear when user tries to delete.What am i doing wrong?Here is my example code: ?php echo $html-image(delete.png, array(alt = Delete,title=Delete,'url' = array('controller' = 'users', 'action' = 'delete',$user['User']['id'],array(),Are you sure to delete user? )));? The action works fine but no message displayed! Any help would be nice. Ty 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-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: confirm message
The url array is only that: an URL array, i.e. there is no confirm parameter here. What I would do is putting the image in a $html-link() and use it's confirm parameter and disable the HTML escape (to output the image tag correctly). Maybe there is another way, looking at the cake HTML helper source code often helps (how the parameters are passed through) ;-) On 10 Mai, 14:13, Paulos23 paulitosthe...@gmail.com wrote: Hi peeps, Well i am creating some nice crud functionality and i use some images.All working perfect but i have problem with the delete action coz i want a confirm message to appear when user tries to delete.What am i doing wrong?Here is my example code: ?php echo $html-image(delete.png, array(alt = Delete,title=Delete,'url' = array('controller' = 'users', 'action' = 'delete',$user['User']['id'],array(),Are you sure to delete user? )));? The action works fine but no message displayed! Any help would be nice. Ty 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-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 -~--~~~~--~~--~--~---
I eliminated the default pages routing and now my controllers won't load
I wanted my URLs to look like: www.website.com/some_content Instead of the cakephp default: www.website.com/pages/some_content So I edited the router.php to this Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); #Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); Router::connect('/(.*)', array('controller' = 'pages', 'action' = 'display')); But now my controllers are not loading. It's asking for views instead. Also, when I type: ?php e($html-link('Somelink', 'somelink')); ? It still puts /pages in the url. How do I get rid of it? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
user preferences on a social site
On an social site, users may change preferences on whether their profiles are open for strangers, or whether their actions are posted to the newsfeed section. In cake, what's the best practice for implementing this functionality? Will ACL work well on this? Or is there any other solutions? Many thanks! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
user preferences on a social site
On a social site, users may change preferences on whether their profiles are open for strangers. In cake, what's the best practice for implementing this functionality? Will ACL work well on this? Or is there any other solutions? Many thanks! --~--~-~--~~~---~--~~ 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: user preferences on a social site
On Sun, May 10, 2009 at 1:33 PM, park park@gmail.com wrote: On an social site, users may change preferences on whether their profiles are open for strangers, or whether their actions are posted to the newsfeed section. In cake, what's the best practice for implementing this functionality? Will ACL work well on this? Or is there any other solutions? I don't think this would be a good use of ACL. If a user's profile is either open to all or to none, it'd be simpler to set a flag in the model (thus, table). And the newsfeed pref doesn't really square with ACL at all. Again, just set a flag in the User (or Profile) table. --~--~-~--~~~---~--~~ 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: confirm message
I tried to use html-link as you said but i can't make it work.I wonder what is the solution. 2009/5/10 Enrique enrique.jaco...@gmail.com The url array is only that: an URL array, i.e. there is no confirm parameter here. What I would do is putting the image in a $html-link() and use it's confirm parameter and disable the HTML escape (to output the image tag correctly). Maybe there is another way, looking at the cake HTML helper source code often helps (how the parameters are passed through) ;-) On 10 Mai, 14:13, Paulos23 paulitosthe...@gmail.com wrote: Hi peeps, Well i am creating some nice crud functionality and i use some images.All working perfect but i have problem with the delete action coz i want a confirm message to appear when user tries to delete.What am i doing wrong?Here is my example code: ?php echo $html-image(delete.png, array(alt = Delete,title=Delete,'url' = array('controller' = 'users', 'action' = 'delete',$user['User']['id'],array(),Are you sure to delete user? )));? The action works fine but no message displayed! Any help would be nice. Ty 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-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: Add dynamic CSS to head from element?
I actually have that already - care to elaborate on why you mentioned it though? Thanks, Toby On May 9, 5:26 am, Ketan Shah ketan.s...@gmail.com wrote: add this ?php echo $scripts_for_layout ;? in your head tag of the layout file. -Ketan.www.propertyjungle.inwww.innovatechnologies.in On May 8, 8:56 pm, toby1kenobi toby.math...@gmail.com wrote: Ah, no it doesn't - it does seem strange. On May 8, 2:29 pm, brian bally.z...@gmail.com wrote: On Fri, May 8, 2009 at 4:41 AM, toby1kenobi toby.math...@gmail.com wrote: Sorry, yes it has the inline argument in its definition, but I couldn't see how to get it to actually render the style tags themselves (only the content that would go between them) - am I missing something? Maybe we both are :-) It's not creating a style block? It should, afaik. --~--~-~--~~~---~--~~ 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: Add dynamic CSS to head from element?
It's slightly odd eh? Coincidentally, I've just run int0: ...So it's not as strange as, say, the $inline param for the css() method. Now *that* makes no sense. What is going on there?! According to the docs it seems like I should be able to create a link tag in the head of my document by setting inline to false, but this appears to result in nothing being rendered at all...a 'feature'?! On May 8, 5:24 pm, brian bally.z...@gmail.com wrote: On Fri, May 8, 2009 at 11:56 AM, toby1kenobi toby.math...@gmail.com wrote: Ah, no it doesn't - it does seem strange. Good gravy! It doesn't. It just returns the data as CSS rules. I was about to say that this seems absolutely useless, except to waste the PHP parser's time, but then realised that it's meant to be used internally when building tags. So it's not as strange as, say, the $inline param for the css() method. Now *that* makes no sense. Sorry, I was sure I'd used style() before but I just checked the app I was thinking of and realise now that I didn't. I guess you could create your own helper. Look at the css() method and how it uses tag(), then does: $view = ClassRegistry::getObject('view'); $view-addScript($out); --~--~-~--~~~---~--~~ 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: confirm message
Try this: echo $html-link($html-image(delete.png,array (alt=Delete,title=Delete)),$html-url(array (controller=users,action=delete)),array(),Are you sure to delete user?,false); On May 10, 2:09 pm, paulos nikolo paulitosthe...@gmail.com wrote: I tried to use html-link as you said but i can't make it work.I wonder what is the solution. 2009/5/10 Enrique enrique.jaco...@gmail.com The url array is only that: an URL array, i.e. there is no confirm parameter here. What I would do is putting the image in a $html-link() and use it's confirm parameter and disable the HTML escape (to output the image tag correctly). Maybe there is another way, looking at the cake HTML helper source code often helps (how the parameters are passed through) ;-) On 10 Mai, 14:13, Paulos23 paulitosthe...@gmail.com wrote: Hi peeps, Well i am creating some nice crud functionality and i use some images.All working perfect but i have problem with the delete action coz i want a confirm message to appear when user tries to delete.What am i doing wrong?Here is my example code: ?php echo $html-image(delete.png, array(alt = Delete,title=Delete,'url' = array('controller' = 'users', 'action' = 'delete',$user['User']['id'],array(),Are you sure to delete user? )));? The action works fine but no message displayed! Any help would be nice. Ty 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-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: user preferences on a social site
I agree w/ Brian. On my site, I have all my user preferences stored in my profiles table. On May 10, 1:57 pm, brian bally.z...@gmail.com wrote: On Sun, May 10, 2009 at 1:33 PM, park park@gmail.com wrote: On an social site, users may change preferences on whether their profiles are open for strangers, or whether their actions are posted to the newsfeed section. In cake, what's the best practice for implementing this functionality? Will ACL work well on this? Or is there any other solutions? I don't think this would be a good use of ACL. If a user's profile is either open to all or to none, it'd be simpler to set a flag in the model (thus, table). And the newsfeed pref doesn't really square with ACL at all. Again, just set a flag in the User (or Profile) table. --~--~-~--~~~---~--~~ 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: Add dynamic CSS to head from element?
This is how the style (and script) tags are added to your layout. I think Ketan didn't realise that your problem is that you're trying to add a style *block* to your page. On Sun, May 10, 2009 at 3:26 PM, toby1kenobi toby.math...@gmail.com wrote: I actually have that already - care to elaborate on why you mentioned it though? Thanks, Toby On May 9, 5:26 am, Ketan Shah ketan.s...@gmail.com wrote: add this ?php echo $scripts_for_layout ;? in your head tag of the layout file. -Ketan.www.propertyjungle.inwww.innovatechnologies.in On May 8, 8:56 pm, toby1kenobi toby.math...@gmail.com wrote: Ah, no it doesn't - it does seem strange. On May 8, 2:29 pm, brian bally.z...@gmail.com wrote: On Fri, May 8, 2009 at 4:41 AM, toby1kenobi toby.math...@gmail.com wrote: Sorry, yes it has the inline argument in its definition, but I couldn't see how to get it to actually render the style tags themselves (only the content that would go between them) - am I missing something? Maybe we both are :-) It's not creating a style block? It should, afaik. --~--~-~--~~~---~--~~ 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: $model-save - which id is used?
On May 10, 4:35 pm, Rick will...@gmail.com wrote: Take a look at $this-Recipe. I think it is in there. debug($this-Recipe); Yes - $this-Recipe-id is set to the correct id - but then again: How? Regards Jonathan --~--~-~--~~~---~--~~ 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: $model-save - which id is used?
Thats how CakePHP is built, wonderful right? --~--~-~--~~~---~--~~ 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: Lang in url and named parameters
I would suggest prefix routing: http://book.cakephp.org/view/46/Routes-Configuration#Prefix-Routing-544 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
jQuery help
I am trying to do something so simple and just cant get it. I have a link... click it and it runs a function in the controller returning the success/fail message from the controller function into a div (saved or unable to save please try again) but I am having absolutely no luck with it. Do I use a normal ?php echo $html-link(__('Save this page!', true), '#', array('rel' = $note[Post]['key'])); ? with $(.save_me).click(function(){$(#saved).load(??);}); For the URL i tried bookmarks/quicksave = Page can not be found Ideas? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $model-save - which id is used?
On May 10, 5:52 pm, Enrique enrique.jaco...@gmail.com wrote: The id can be found in $this-data. No. My first thought was that the form helper would insert a hidden field with the id - but it doesn't (and debug($this-data) shows that the id is not present in the data). Now I did some investigations, and I guess that if a controller uses only one model, this model is initialized with the id set to the first parameter passed to the action. So if you call /tests/action/123, then $this-Test-id will be 123. This seems to be done in the controllers constructClasses() method: http://api.cakephp.org/view_source/controller/#line-426 Please correct me if I'm wrong - otherwise I'll see if I can add a note to the documentation. Regards Jonathan --~--~-~--~~~---~--~~ 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: confirm message
Ty you help me in most important part...After your solution there was an error and i found it.the complete is: ?php echo $html-link($html-image(delete.png,array(alt=Delete,title=Delete)),$html-url(array(controller=users,action=delete,$user['User']['id'])),array(),Are you sure to delete user?,false);? Ty again m8! 2009/5/10 Kyle Decot kdec...@gmail.com Try this: echo $html-link($html-image(delete.png,array (alt=Delete,title=Delete)),$html-url(array (controller=users,action=delete)),array(),Are you sure to delete user?,false); On May 10, 2:09 pm, paulos nikolo paulitosthe...@gmail.com wrote: I tried to use html-link as you said but i can't make it work.I wonder what is the solution. 2009/5/10 Enrique enrique.jaco...@gmail.com The url array is only that: an URL array, i.e. there is no confirm parameter here. What I would do is putting the image in a $html-link() and use it's confirm parameter and disable the HTML escape (to output the image tag correctly). Maybe there is another way, looking at the cake HTML helper source code often helps (how the parameters are passed through) ;-) On 10 Mai, 14:13, Paulos23 paulitosthe...@gmail.com wrote: Hi peeps, Well i am creating some nice crud functionality and i use some images.All working perfect but i have problem with the delete action coz i want a confirm message to appear when user tries to delete.What am i doing wrong?Here is my example code: ?php echo $html-image(delete.png, array(alt = Delete,title=Delete,'url' = array('controller' = 'users', 'action' = 'delete',$user['User']['id'],array(),Are you sure to delete user? )));? The action works fine but no message displayed! Any help would be nice. Ty 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-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 -~--~~~~--~~--~--~---
CakePHP 1.2 AdminAuth Problem
Hi Everyone, I did migrate to CakePHP 1.2 and with the older version, I could init the AdminAuth this way in the app_controller file : //init the admin component... $this-AdminAuth-msgError = Erro ao efetuar seu login. Tente novamente.; $this-AdminAuth-init($this); in the beforeFilter method, now it says that it's missing a method, when I use the code $this-AdminAuth-init($this); With the older version that was never a problem. What could I do? Should I change the code? I did saw some changes between the versions like model, controller etc. Regards, --~--~-~--~~~---~--~~ 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: $model-save - which id is used?
Yes its all done in the initializing of the controllers/models, not within the forms. --~--~-~--~~~---~--~~ 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: social networking script with CakePHP
Have not tried Noserub, http://www.addthis.com looks kind of cool. There is also a social bookmark helper on the bakery. On May 9, 1:21 pm, Dardo Sordi Bogado dardoso...@gmail.com wrote: have you seen Noserub ? On Sat, May 9, 2009 at 12:31 PM, Liran liran...@gmail.com wrote: Hi there! :) I want to add some social networking capabilities to my website. I'm look for a good social networking script with CakePHP (I can pay if I have to). Does anybody know a good social networking script with CakePHP? Thanks guys Liran --~--~-~--~~~---~--~~ 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: New Komodo Macro -- CakePHP Toggle
On May 10, 7:07 am, AD7six andydawso...@gmail.com wrote: Hi shaggz, Interesting stuff, why not take a look at writing a komodo wrapper for the cakemate plugin (http://thechaw.com/cakemate) which puts most of the logic in a cake shell. In this way your marco would only need to construct the right parameters for a cake-console call, and be able to parse the result. AD Thanks for the feedback, Andy. I will take a look at the cakemate plugin and see what it offers. At first glance, it does seem to be the 'right' way to do something like this to keep it extensible. One thing that is confusing at first glance is the statement that CakeMate 'is designed to work in conjunction with the Textmate bundle, and *will not* work as a standalone.' When I looked at the textmate bundle sources, I didn't see any cakephp files..only textmate snippets and code completion helpers. I guess I don't understand the dependency between CakeMate and the Cake Textmate bundle if one were using vim (or in this case, a komodo wrapper). Thanks --~--~-~--~~~---~--~~ 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: XML rendering
Ah, that file path was actually a typo: app/views/controllername/xml/data.ctp (same name as the controller action) actually contains: test case?php echo $message; ?/case /test I accidentally omitted controllername from the full path, but it's definitely correct and I'm getting the same results. What's bothering me is where is the html in the end result coming from? It seems that it's incorrectly rendering an xhtml layout with an xml tag ( ?xml version=1.0 encoding=utf-8? ) at the top. I'll take a look at your article in more detail tomorrow when I have access to the code again. For now, does anyone else have any idea what might be going on? On May 10, 9:17 am, Smelly Eddie ollit...@gmail.com wrote: AAron: I am not sure what your adding to app/xml/data.ctp for. This should be handled like any other view. You need; The parse xml extensions config (which you have) A controller action (your's looks good) An XML view (app/views/CONTROLLERNAME/xml/CONTROLLERACTION.xml Here's an article I wrote after implementing RSS feeds on one of my sites., http://edwardawebb.com/programming/php-programming/cakephp/add-rss-fe... On May 8, 5:54 pm, Aaron Torres tcb...@gmail.com wrote: First off, sorry if this is a duplicate, I submitted a post an hour ago and it still hasn't shown up so I thought I'd try one more time. I'm having extreme difficulty getting cakephp to render xml for me. I've looked through the google groups, the docs, and blog posts via google and as far as I can tell I've done everything that has been suggested. In my routes file: Router::parseExtensions(xml); In my controller: var $components = array('RequestHandler'); function data(){ $message = 'Testing'; $this-set('message', $message); } I've verified that app/data.xml tries to render views/app/xml/data.ctp and also views/layouts/xml/default.ctp (if I create it) In views/app/xml/data.ctp: test case?php echo $message; ?/case /test However, when I navigate to app/data.xml this is what is returned: ?xml version=1.0 encoding=utf-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head title/title /head body Testing !-- 0.1864s -- /body /html I've ran out of ideas, does anyone have any suggestions to get this working? Thanks in advance for any insights you can provide and again, sorry if this posts twice. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Validation question
Throughout my application i have about 100 various input fields in forms. Most use the same validation rules max min alphanumeric and so on Is it possible to define a set of validation rules in app_model that can be used in the other models rather than adding the same rules over and over to every model? Example 'program' = array( 'rule' = 'alphaNumeric', 'message' = 'Must only contain letters and numbers.' ), could that be defined as $alphaNumRule in app_model and in the model calling validation use something like 'program' = array( 'rule' = $alphaNumRule, ), Or something similar to that? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Validation question
Well you could place the validation array on the $validate property within AppModel. --~--~-~--~~~---~--~~ 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: I eliminated the default pages routing and now my controllers won't load
make sure when usings reverse routing to use verbose linking...ie you have to link like this echo $html-link('link text', array('controller'='your_controller', 'action'='your_action')); On May 10, 1:21 pm, Bankai hgnelso...@gmail.com wrote: I wanted my URLs to look like:www.website.com/some_content Instead of the cakephp default:www.website.com/pages/some_content So I edited the router.php to this Router::connect('/', array('controller' = 'pages', 'action' = 'display', 'home')); #Router::connect('/pages/*', array('controller' = 'pages', 'action' = 'display')); Router::connect('/(.*)', array('controller' = 'pages', 'action' = 'display')); But now my controllers are not loading. It's asking for views instead. Also, when I type: ?php e($html-link('Somelink', 'somelink')); ? It still puts /pages in the url. How do I get rid of it? --~--~-~--~~~---~--~~ 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: confirm message
I think it is good solution for your error correction .Please follow this code: ?php echo $html-link(__('Delete', true), array('action'='delete', $user['User']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ? On Mon, May 11, 2009 at 3:37 AM, paulos nikolo paulitosthe...@gmail.comwrote: Ty you help me in most important part...After your solution there was an error and i found it.the complete is: ?php echo $html-link($html-image(delete.png,array(alt=Delete,title=Delete)),$html-url(array(controller=users,action=delete,$user['User']['id'])),array(),Are you sure to delete user?,false);? Ty again m8! 2009/5/10 Kyle Decot kdec...@gmail.com Try this: echo $html-link($html-image(delete.png,array (alt=Delete,title=Delete)),$html-url(array (controller=users,action=delete)),array(),Are you sure to delete user?,false); On May 10, 2:09 pm, paulos nikolo paulitosthe...@gmail.com wrote: I tried to use html-link as you said but i can't make it work.I wonder what is the solution. 2009/5/10 Enrique enrique.jaco...@gmail.com The url array is only that: an URL array, i.e. there is no confirm parameter here. What I would do is putting the image in a $html-link() and use it's confirm parameter and disable the HTML escape (to output the image tag correctly). Maybe there is another way, looking at the cake HTML helper source code often helps (how the parameters are passed through) ;-) On 10 Mai, 14:13, Paulos23 paulitosthe...@gmail.com wrote: Hi peeps, Well i am creating some nice crud functionality and i use some images.All working perfect but i have problem with the delete action coz i want a confirm message to appear when user tries to delete.What am i doing wrong?Here is my example code: ?php echo $html-image(delete.png, array(alt = Delete,title=Delete,'url' = array('controller' = 'users', 'action' = 'delete',$user['User']['id'],array(),Are you sure to delete user? )));? The action works fine but no message displayed! Any help would be nice. Ty in advance! -- Regards, Mohammad Arif Hossen Junior Web Developer United Group International(UGIBD) Mobile: +88 01714355911 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Validate postal
In the cookbook 4.1.4.23 postal validating postal codes How can you validate the zip/postal if you don't know if its Canadian, American or one of the others? Can you attempt to validate if it in American format then Canadian then others and if any of them pass is fine if not return false? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Lang in url and named parameters
Ok, then maybe a Sitemap should be considered instead of the lang paramater! See http://en.wikipedia.org/wiki/Sitemap for more information. Enjoy, John On May 10, 4:25 pm, Pixelastic timcc.pe...@gmail.com wrote: I want to keep the :lang parameter in the url for SEO purposes. This way each ressource of my app will have a different url and my pages will be indexed in all the available languages (seems logical as their content will be different). On 8 mai, 18:55, John Andersen j.andersen...@gmail.com wrote: Thanks :) My question then is, why do you carry along this parameter in the url? In my opinion, it should just be remembered in the session, until the user chooses another language (if ever). Is it for other reasons, that you want to carray the parameter in the url? John On May 8, 4:03 pm, Pixelastic timcc.pe...@gmail.com wrote: Yes, that is the purpose of this parameter. On May 8, 2:16 pm, John Andersen j.andersen...@gmail.com wrote: Is the purpose of the named parameter (lang) for you to be able to present content in the specified language? John [snip] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---