Re: Trouble with installation
Nigel, could it be a permission related issue? Did you check file and folders permissions of this new Cake installation? Regards Cristian Nigel ha scritto: I use Ubuntu 9.04 and I installed apache, mysql, and php5. I did the blog tutorial successfully with everything working. After that I deleted the folder cake and installed it again for the next tutorial. I cleared the database. Now, the Cake page is not displaying properly as though there is some trouble with apache mod_rewrite, but I checked it out and its fine. What am I missing here? --~--~-~--~~~---~--~~ 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: Best way to accomplish acl for database records owned by a user
Thanks for your answers!! @brian: It looks rather complex to accomplish such a easy task so I think there must be an easier way to get the same result... @Rick: Your solution is the one I used before but I thought that there must be a solution that is integrated into the ACO/ACL concept... It's always the same problem with every framework; simple tasks are easy; real world scenarios are big challenges. It would be interesting to know how the developers of cakePHP/ACL-system would accomplish this task... regards, rOger On 24 Sep., 16:09, Rick will...@gmail.com wrote: I know that globals are bad but... I just set a global $gblCurrentUser when the user logs in. Then accessing that in models, I can add a select condition for that user in the beforeFind etc.. You get the idea? Rick On Sep 24, 12:20 am, brian bally.z...@gmail.com wrote: I did something similar to this. However, I was so overwhelmed by the contradictory and/or incomplete information I found about Cake's ACL (mostly because it was quite dated) that I really don't know for sure that I did it the best way. My app is an extranet that has several different Groups. The navigation consists of many Sections that are stored as a tree (MPTT). Some Sections may not be seen by certain Groups. So, to display this navigation tree, I called this method in my SectionsController: public function nav($group_id = null) { if (is_null($group_id)) { if (!$this-params['admin']) { $group_id = $this-Auth-user('group_id'); } } $this-Session-write('group_id_for_nav', $group_id); /* try getting the nodes from the cache */ $sections = Cache::read(group_sections_${group_id}, 'default'); if (!$sections) { /* fetch the permissions for this group */ $perms = $this-Acl-Aco-find( 'all', array( 'fields' = array('Aco.foreign_key'), 'conditions' = array( 'Aco.model' = 'Section', 'Aco.id = Permission.aco_id' ), 'recursive' = -1, 'joins' = array( array( 'table' = 'aros', 'alias' = 'Aro', 'type' = 'INNER', 'conditions'= array( 'Aro.model' = 'Group', Aro.foreign_key = ${group_id} ) ), array( 'table' = 'aros_acos', 'alias' = 'Permission', 'type' = 'INNER', 'conditions'= array( 'Permission.aro_id = Aro.id', 'Permission._read = 0' ) ) ) ) ); $section_ids = Set::extract($perms, '{n}.Aco.foreign_key'); /* we don't want to see the root node */ unset($section_ids[0]); /* now grab the sections these permissions allow */ $sections = $this-Section-threaded($section_ids); /* save this group's allowed sections */ Cache::write(group_sections_${group_id}, $sections, 'default'); } return $sections; } So, the Aco.foreign_key fields I'm after correspond to Section.ids. Once i have those, I fetch the relevant Sections as a threaded list. Obviously, you'd just be interested in the record IDs. What I'm storing in the cache is the Sections themselves. For your case, you'd likely want to save the record IDs in the session instead of caching them. Anyway, the important thing is the joins used to get at the model IDs for your record-level ACL through the ACO.foreign_key. Let me know if you want more info. On Wed, Sep 23, 2009 at 5:19 PM, rOger roger.eisenec...@icer.ch wrote: Hi @all, I'm really
Integrating CakePHP with Adobe Flex
Hello everyone, yesterday I had a look at Flex. Pretty impressive for making RIAs. Then I saw it's possible to interface Flex to PHP. My imagination went even further, wondering if it's possible to interface it with Cake. It seems that, for Cake 1.1, this was reality thanks to AmfCakePHP, but this brilliant piece of software, for what I understood, doesn't work as expected in Cake 1.2. So I found another software called cpAmf, which seems to do all AmfCakePHP did: http://bakery.cakephp.org/articles/view/flex-remoting-with-cakephp-cpamf-plugin-1 Considering I know nothing about Flex, which is the way to follow to start making things with Cake and Flex? Do any of you guys use these two technologies together? Any good tutorial or manual, or even website to refer to? Thank you Cristian --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Suitable editor or IDE
Hi, I wish to do all my php project development using Cake in a stable editor or IDE. Is there any that I can get hold of? Please advice. Thank you. Warmest Regards, Selvam --~--~-~--~~~---~--~~ 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: Suitable editor or IDE
Hey, You would surely love Zend studio! Just create a new project, and then add all cakePHP folder into your current project, I bet you will be surprised! Hope this helps, Faifas On Fri, Sep 25, 2009 at 10:29, Selva manickaraja mavle...@gmail.com wrote: Hi, I wish to do all my php project development using Cake in a stable editor or IDE. Is there any that I can get hold of? Please advice. Thank you. Warmest Regards, Selvam --~--~-~--~~~---~--~~ 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: Routing Plugins
@jorge/christian: If you want to discuss a different topic, do so in a new thread don't simply change the topic of an existing thread which has nothing to do with your alternative subject. --~--~-~--~~~---~--~~ 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: Translate field names
On 25 Set, 02:18, brian bally.z...@gmail.com wrote: __('field_name') Do you mean that I can use in a view something like the following? echo $form-input(__('date')); Thanks maxx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Translate field names
No, you only want to translate the label, not the field name : echo $form-input(field_name, array(label=__(field_name))); On Sep 25, 9:19 am, emmexx emmeics...@gmail.com wrote: On 25 Set, 02:18, brian bally.z...@gmail.com wrote: __('field_name') Do you mean that I can use in a view something like the following? echo $form-input(__('date')); Thanks maxx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Routing offsite
I have built a simple storefront that bolts onto an existing php website. The CakePHP application (the store) includes the dynamic menu from the existing CMS. The urls in the menu are relative, e.g. href=publications.html and all have the '.html' extension. I need to route these pages to outside of Cake, but it's Friday and I can't see how to do it with the router. Would I be better doing it in .htaccess? Eventually, the CMS will be rewritten in CakePHP, so there isn't really any mileage in rewriting the legacy code. --~--~-~--~~~---~--~~ 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 use migration in Cakephp
Hello All, I am wandering for the migration concept in cakephp. I also followed the steps from the following URL, http://bakery.cakephp.org/articles/view/cakephp-yaml-migrations-and-fixtures-without-pear Also followed the instructions but i found that it created on migrate folder in my application folder with all the app folder structure. I didnt get this. Can anybody please help me in this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How to user imagemagik in cakephp
Hello All, I am trying to work with image magik for one application. I am not getting any satisfying solution for this. Can anybody please help me 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 -~--~~~~--~~--~--~---
how to cache admin pages
Hello, I am using cakephp 1.2 for developing my project. I am caching the pages, i am able to cache pages easily and it is working fine but i am not able to cache admin pages. Means i am not able to cache the pages having admin/... in the url. I am able to cache this type of url eg: http://localhost/stc/admins/viewall I am not able to cache this type of url eg: http://localhost/stc/admin/admins/viewall The above url contains admin in the url because it is admin side page and i am not able to cache this type of page. Please help me. Thanks, Irshad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using same Auth component in admin and client
I have tried this one, this is similar to the previous code. Actually it should get result, but somehow fails. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
autocomplete program
Hii CakePHP programmers, Any body can give me the complete source code for Autocompletion in text boxes. i expect the code with whole .ctp in the view and php file in the model , controller php file ajax file and css. Help me. The value should read from the database. regards, jiru --~--~-~--~~~---~--~~ 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: autocomplete program
Want me to travel to your city and code the project as well ? Anyway, have a look here : http://bakery.cakephp.org/articles/view/autocomplete It will get you at least half way there ... On Fri, Sep 25, 2009 at 1:46 PM, Jiru jiransl...@gmail.com wrote: Hii CakePHP programmers, Any body can give me the complete source code for Autocompletion in text boxes. i expect the code with whole .ctp in the view and php file in the model , controller php file ajax file and css. Help me. The value should read from the database. regards, jiru --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Database structure and json_encode()
I am creating an itinerary system where user will be able to record his trips, add one starting point where his journey begins, unknown number of stops on his way and finally one ending point. Now I am wondering how to create a meaningful database structure so one will be able to search every group of points: starting, trip stops and ending point. I am unsure how to model my database but I have two ideas I cannot decide between: A) Table TRIPS which will contain columns: start (one starting point) via (x trip stops) end (one ending point) OR B) (my preferred one) - one only column: waypoints My idea is to serialize array containing all trip points using json_encode() and save it into waypoints column in json format, because I have read it is quite faster than serialize() and I would be able to use it in my jquery scripts. What bothers me though is how can I search in those waypoints then? They will be mixed together - start, stops and end. What idea do you like most? Thanks for your comments guys. --~--~-~--~~~---~--~~ 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: Routing offsite
Okay, sorted. I did it this way: RedirectMatch ([A-Za-z0-9-]+)\.html$ http://website.co.uk/$1.html I used the alphanum regexp instead of (*.) in order to drop the cake webroot portion of the URL, i.e. only return the portion after the final '/' On 25 Sep, 12:12, leo ponton@gmail.com wrote: I have built a simple storefront that bolts onto an existing php website. The CakePHP application (the store) includes the dynamic menu from the existing CMS. The urls in the menu are relative, e.g. href=publications.html and all have the '.html' extension. I need to route these pages to outside of Cake, but it's Friday and I can't see how to do it with the router. Would I be better doing it in .htaccess? Eventually, the CMS will be rewritten in CakePHP, so there isn't really any mileage in rewriting the legacy code. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to user imagemagik in cakephp
More information About whAt you tried, results, and what your looking to get would be helpful On 9/25/09, Vijay k.vidn...@gmail.com wrote: Hello All, I am trying to work with image magik for one application. I am not getting any satisfying solution for this. Can anybody please help me out. -- Sent from my mobile device --~--~-~--~~~---~--~~ 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: Trouble with installation
you need ability in apache the mod_rewrite.so and rewrite.load in folde /apache/mods-enabled cd /etc/apache2/mods-enabled ln -s /etc/apache/mods-available/mod_rewrite.so ln -s /etc/apache/mods-available/ rewrite.load /etc/init.d/apache2 restart 2009/9/25 Cristian Cassina principess...@gmail.com Nigel, could it be a permission related issue? Did you check file and folders permissions of this new Cake installation? Regards Cristian Nigel ha scritto: I use Ubuntu 9.04 and I installed apache, mysql, and php5. I did the blog tutorial successfully with everything working. After that I deleted the folder cake and installed it again for the next tutorial. I cleared the database. Now, the Cake page is not displaying properly as though there is some trouble with apache mod_rewrite, but I checked it out and its fine. What am I missing here? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Specific HABTM relation
First some introduction... My implementation: Category HABTM Article and Article HABTM Category Category HABTM Gallery and Gallery HABTM Category Category HABTM Link and Link HABTM Category Category HABTM Document and Document HABTM Category ... Database table for joins: CREATE TABLE IF NOT EXISTS `categories_models` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `category_id` int(11) NOT NULL, `model` varchar(255) NOT NULL, `model_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; class Category extends AppModel { var $name = 'Category'; var $hasAndBelongsToMany = array( 'Article' = array( 'className' = 'Article', 'joinTable' = 'categories_models', 'foreignKey' = 'category_id', 'associationForeignKey' = 'model_id', 'unique' = true, 'conditions' = array('CategoriesModel.model' = 'Article'), 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'finderQuery' = '', 'deleteQuery' = '', 'insertQuery' = '' ) ); } class Article extends AppModel { var $name = 'Article'; var $hasAndBelongsToMany = array( 'Category' = array( 'className' = 'Category', 'joinTable' = 'categories_models', 'foreignKey' = 'model_id', 'associationForeignKey' = 'category_id', 'unique' = true, 'conditions' = array('CategoriesModel.model' = 'Article'), 'fields' = '', 'order' = '', 'limit' = '', 'offset' = '', 'finderQuery' = '', 'deleteQuery' = '', 'insertQuery' = '' ) ); } Almost everything works fine after use bake command but after article save in 'categories_models' table I haven't field 'model' set to 'Article' - but fields 'category_id' and 'model_id' are correct. Does anybody have idea how to force model Article to set field `categories_models.model` to 'Article' using save functionality (and have an example for it)? Of course i could use CategoriesModel model and in controller function add separate data from form but this is my last hope solution. I think that this may be done in other way. If someone knows cakephp solution and could help .. i will be gratefull --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Search-Engine: Extend results with random records if there are no 'real' results
Hello, i'm coding a very basic search-engine at the moment. the admin is able to add some records manually and then users can search for them. as there are not many records added by the admin the results are 0 quite often. if the result-count is 0 i want to extend the results with random records. i don't know how to do this, especially with the pagination. one problem is, that i can't use ORDER BY RAND() on every page because then the user would get different results on every refresh. i thought about doing the data-fetching myself (and extend if there are to less results) and give it to the pagination manually, is this possible? what would u suggest? thank you! greets --~--~-~--~~~---~--~~ 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: Trouble with installation
I had a problem with Ubuntu as well, but I think you are passed this stage: To enable mod rewrite, you need to add a symbolic link to the module definition file, which lives in /etc/apache2/mods-available, to the folder: /etc/apache2/mods-enabled. Do this by first changing to the mods-enabled folder then adding the symlink. cd /etc/apache2/mods-enabled ln -s ../mods-available/rewrite.load In the sites-enabled folder (/etc/apache2/sites-enabled), edit 000- default (this is actually a symbolic link to etc/apache2/sites-available/ default, which will need to be made editable before making changes). You will need to add the statement: AllowOverride All to the directory blocks for '/' and '/var/www'. If these blocks do not contain the statement: Allow from all then add it at the end. Make sure that any occurrence of 'AllowOverride None' within these blocks is changed, commented or deleted. --~--~-~--~~~---~--~~ 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: Trouble with installation
If you are, then make sure that you have .htaccess files in all the right places. I have found that Ubuntu often doesn't copy them with the other stuff (usually just the one in the root of the structure you're copying). You shouldn't need to do anything with permissions on the cake folder as it only needs to be readable. 755 should do. On 24 Sep, 17:45, Nigel nigelb...@gmail.com wrote: I use Ubuntu 9.04 and I installed apache, mysql, and php5. I did the blog tutorial successfully with everything working. After that I deleted the folder cake and installed it again for the next tutorial. I cleared the database. Now, the Cake page is not displaying properly as though there is some trouble with apache mod_rewrite, but I checked it out and its fine. What am I missing here? --~--~-~--~~~---~--~~ 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 viewing data...
Ok just did that, here's the output: prjr2009/controllers/users_controller.php (line 88) id: 2 So the ID is correct, but it's still showing the user with id: 1 ! I'm starting to think it's mocking me =P brian-263 wrote: Put debug(id: ${id}) in your controller. Maybe it's not what you think it is. Do you have a route for this action? On Thu, Sep 24, 2009 at 1:38 PM, mig_akira mig_ak...@hotmail.com wrote: Ops, sorry, here's the code for views/users/view.ctp [code] div class=noticias view h2?php __('User');?/h2 div id=view_conteudo dl?php $i = 0; $class = ' class=altrow';? dt?php if ($i % 2 == 0) echo $class;??php __('Ativo'); ?/dt dd?php if ($i++ % 2 == 0) echo $class;? ?php echo $user['User']['active']; ? /dd dt?php if ($i % 2 == 0) echo $class;??php __('Name'); ?/dt dd?php if ($i++ % 2 == 0) echo $class;? ?php echo $user['User']['name']; ? (and son on).. [/code] the contents are not the same, because it happens for every user...doesn't matter if it's user number 7 or 123...=( I don't get, because all other views for other controllers, such as for groups, are correct and are pretty much similar to the users view! brian-263 wrote: On Mon, Sep 21, 2009 at 4:47 PM, mig_akira mig_ak...@hotmail.com wrote: hello everyone! I'm building a simple web page, with Auth/ACL and a few members. Problem is, I baked the admin part of the site, and everything works fine except for one thing! In my users admin page, I click in view, but it insists in showing the view for the first user (in this case, the admin). In my url, it shows /users/view/7 (number of the user's ID), but it shows the data for the user with ID == 1. Funny thing is, if I click EDIT instead of VIEW, it shows the correct user! (and the URL is /users/edit/7) Here are the codes for the VIEWS/USERS/INDEX.CTP : [code] ?php $i = 0; foreach ($users as $user): $class = null; if ($i++ % 2 == 0) { $class = ' class=altrow'; } ? tr?php echo $class;? td ?php echo $user['User']['username']; ? /td td ?php echo $user['User']['name']; ? /td td ?php echo $user['User']['email']; ? /td td class=actions ?php echo $html-link(__('View', true), array('action'='view', $user['User']['id'])); ? ?php echo $html-link(__('Edit', true), array('action'='edit', $user['User']['id'])); ? ?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'])); ? /td /tr ?php endforeach; ? [/code] That's the view for index(), not view(). The latter would not have a foreach loop, as you should only have a single User in your array. And here's for the action view in the users_Controller.php: [code] function view($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid User.', true)); $this-redirect(array('action'='index')); } $this-set('user', $this-User-read(null, $id)); } [/code] What could be the problem? Check that you're looking at the proper view file. Then, add debug($user). It's possible that the record in the database is the same for User 1 7. -- View this message in context: http://www.nabble.com/Problem-viewing-data...-tp25530475p25578012.html Sent from the CakePHP mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Problem-viewing-data...-tp25530475p25612039.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to user imagemagik in cakephp
Hello Jonathan, Thanks for the reply. I have tried the following links, http://www.imagemagick.org/script/install-source.php#unix using the instructions in the above link pages i have installed the image magik. Also i was searching for the uses from , http://www.imagemagick.org/Usage/ But i didnt get anything. can you please help me out? On Fri, Sep 25, 2009 at 5:12 PM, Jonathon Musters luvz2...@gmail.comwrote: More information About whAt you tried, results, and what your looking to get would be helpful On 9/25/09, Vijay k.vidn...@gmail.com wrote: Hello All, I am trying to work with image magik for one application. I am not getting any satisfying solution for this. Can anybody please help me out. -- Sent from my mobile device -- Thanks Regards, Vijayk. Co-founder (www.weboniselab.com) You Bring the Dreams, We'll Bring the Means --~--~-~--~~~---~--~~ 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: Redirect After Using render('action')
Thanks Brian, I thought that might be the case. On Sep 24, 7:30 pm, brian bally.z...@gmail.com wrote: Whether Cake spits out a CSV file or redirects to another controller/action, headers need to be sent to the client, but you can't send headers for both simultaneously. If you really want the form to disappear, use JS to submit the form using AJAX and hide/change certain elements of the page. On Thu, Sep 24, 2009 at 3:17 PM, Tony Thomas truet...@gmail.com wrote: I have a controller function that's using $this-render('action') to render a view that creates a CSV file after submitting some info in a form. What I want to do is redirect the user after the CSV file is downloaded. So the steps would be: 1. User submits data. 2. Queries are run and a CSV file is rendered and saved by the user. 3. Controller redirects to another view. If I do a simple redirect using $this-redirect('controller/action'), the CSV file is not rendered, even though render() is called first. If I don't redirect, the CSV is successfully rendered, but the user is left with a form that is still filled-in. I'd like to redirect to another view and display a Success flash message once the CSV is rendered. Any tips? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
HTML5 Options
Hi, I'm attempting to add new options to the Form handler for cakephp 1.2.5. So far i've been able to edit cake/libs/view/helpers/form.php Adding function email($fieldName, $options = array()) { $options = $this-_initInputField($fieldName, array_merge( array('type' = 'email'), $options )); return $this-output(sprintf( $this-Html-tags['input'], $options['name'], $this-_parseAttributes($options, array('name'), null, ' ') )); } function url($fieldName, $options = array()) { $options = $this-_initInputField($fieldName, array_merge( array('type' = 'url'), $options )); return $this-output(sprintf( $this-Html-tags['input'], $options['name'], $this-_parseAttributes($options, array('name'), null, ' ') )); } At line 970 just below the text input box. I also added , 'url' = 'text', 'email' = 'text' To the end of the map array on line 608 Finally case 'email': case 'url': To line 776. I'm curious if this was the correct way or there would be a method to add this to an extended help handler? Although after doing this, it does display the url/email input boxes however it comes with an error. Notice (8): Array to string conversion [CORE/cake/libs/view/ helper.php, line 330] Any pointers would be greatly appreciated Thanks, Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Specific HABTM relation
I've found solution with binding models on the fly: articles_controller function add (and function edit) ... foreach($this-data['Category']['Category'] as $num = $category){ $this-data['CategoriesModel'][$num]['model_id'] = $this-data ['Article']['id']; $this-data['CategoriesModel'][$num]['category_id'] = $category; $this-data['CategoriesModel'][$num]['model'] = 'Article'; } unset($this-data['Category']); $this-Article-bindModel(array('hasMany'=array('CategoriesModel'))); if ($this-Article-saveAll($this-data)) { ... This is well known problem (i thought that only I have complicated habtm relations) and was described here: http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-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: Specific HABTM relation
solution is here: articles_controller function add (or edit): ... foreach($this-data['Category']['Category'] as $num = $category){ $this-data['CategoriesModel'][$num]['model_id'] = $this-data ['Article']['id']; $this-data['CategoriesModel'][$num]['category_id'] = $category; $this-data['CategoriesModel'][$num]['model'] = 'Article'; } unset($this-data['Category']); $this-Article-bindModel(array('hasMany'=array ('CategoriesModel'))); if ($this-Article-saveAll($this-data)) { ... --~--~-~--~~~---~--~~ 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: MAMP + CakePHP issues
Hi Fahd! I can advise you on the first question, but not the second. I had been using MAMP but decided to take it off and go with a stock approach. It took a little bit, but works solidly now. What makes it very easy is to use a cheap product called VirtualHostX. You can find it at http://www.macupdate.com/info.php/id/25689/virtualhostx. The price recently went up it appears, but it is so worth it to not be frustrated while developing multiple sites. VirtualHostX is MAMP- friendly. I use it to have a sandbox site where I'm testing code and integration before moving that code over to the development site. Both can be up at the same time, obviously with different databases, but it could be the same one. Hmmm... Anyway, I am also using a product called ModelBaker from http://widgetpress.com that also is MAMP-friendly and removes the need to use a command line when baking. All the database design is visual and the configuration of Cake is a snap. It is a RAP (rapid application prototype) tool that does a great job at generating 80% of the Cake code so you can focus on the 20% that is unique to your application. Plus it can generate an iPhone-aware web application. That's like getting a two-for-one deal! Very promising product. I hope some of this helps. On Sep 24, 3:10 pm, fahd fahd...@gmail.com wrote: Hey fellow Cakers, I've been developing on CakePHP for a bit and decided to have a localhost version on MAMP so that I could demo my app to people without being dependent on an Internet connection. Ran into a few issues ofcourse and hoping someone can give some insight: 1) I have several sites under the /Sites/ folder and I pointed MAMP's Apache document root there. For example /Sites/project1/ is where the Cake app sites. It finds the /project1/ site fine (after some htaccess mods) but there are issues with relative links. Any link that is manually coded and not using $html-link uses /Sites/ instead of / Sites/project1/ as the base. This is for images and any Ajax calls from jQuery. (css and js files are fine). The images I can bare, but the site is unusable without Ajax. Temp solution: changed the document root to /Sites/project1/. This is not ideal, but I'd like to know if you guys have a fix so I don't have to change the document root all the time for previewing different projects. 2) We have a lot of complex MySQL queries being made, using $this-query('SELECT...'). We've placed these in the appropriate models within a function. Hence from the Controller we'll have something like $this-Users-getMeSomething($variable), that goes to the user.php model and runs that function. This works fine on our live and dev sites, but for some reason on MAMP I'm getting the error: Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '__getUsersForUsers' at line 1 [CORE/cake/ libs/model/datasources/dbo_source.php, line 525] The context: == DboSource::showQuery() - CORE/cake/libs/model/datasources/ dbo_source.php, line 525 DboSource::execute() - CORE/cake/libs/model/datasources/ dbo_source.php, line 201 DboSource::fetchAll() - CORE/cake/libs/model/datasources/ dbo_source.php, line 336 DboSource::query() - CORE/cake/libs/model/datasources/dbo_source.php, line 297 Model::call__() - CORE/cake/libs/model/model.php, line 441 Overloadable::__call() - CORE/cake/libs/overloadable_php5.php, line 52 AppModel::__getUsersForUsers() - [internal], line ?? UsersController::view() - APP/controllers/users_controller.php, line 401 Object::dispatchMethod() - CORE/cake/libs/object.php, line 118 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194 [main] - APP/webroot/index.php, line 88 == Line 88 on webroot is this: $Dispatcher-dispatch($url); Thanks for any help Fahd --~--~-~--~~~---~--~~ 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: Best way to accomplish acl for database records owned by a user
I came across this same issue. You can call it row level access. An article that pointed me in the right direction was this one: http://teknoid.wordpress.com/2009/04/22/simplistic-example-of-row-level-access-control-with-auth-security-and-app-model-in-cakephp/. I took that article and expanded on it. The key for my application was the design of the database. My application has distributors that own dealers that then have service advisers. A distributor should be able to access only his distributor record and the associated dealers and the associated service advisers. A dealer can access only his dealer record and his service advisers. Etc., etc. Distributors and dealers and service advisers are individual group records. There are users belonging to those groups. Currently I don't allow a user to be in multiple groups, but I could. So using the article above I was able to build in internal security using the group_id as a first cut for access to the record being requested, and then the user_id as well to make sure it was their record. For the security on associated records this is where having the 'belongsTo' and 'hasMany' relationships really helped. But the real key discovery for me was in my dealers_controller.php. I needed to reach back and get the associated distributor for the dealer record being requested to compare if it was the same distributor. If not, no access. I found I could use var $uses = array('Dealers' 'Distributors') to allow me to bring in the distributor (only one field actually, the 'id') to my security check. It is some code. I'm sure it could be cleaned up a bit and maybe put more into the model to have a skinnier controller, but it is working well and seems to be a flexible approach that does not involve the complexities of ACL. Maybe some of this helps. On Sep 25, 1:25 am, rOger roger.eisenec...@icer.ch wrote: Thanks for your answers!! @brian: It looks rather complex to accomplish such a easy task so I think there must be an easier way to get the same result... @Rick: Your solution is the one I used before but I thought that there must be a solution that is integrated into the ACO/ACL concept... It's always the same problem with every framework; simple tasks are easy; real world scenarios are big challenges. It would be interesting to know how the developers of cakePHP/ACL-system would accomplish this task... regards, rOger On 24 Sep., 16:09, Rick will...@gmail.com wrote: I know that globals are bad but... I just set a global $gblCurrentUser when the user logs in. Then accessing that in models, I can add a select condition for that user in the beforeFind etc.. You get the idea? Rick On Sep 24, 12:20 am, brian bally.z...@gmail.com wrote: I did something similar to this. However, I was so overwhelmed by the contradictory and/or incomplete information I found about Cake's ACL (mostly because it was quite dated) that I really don't know for sure that I did it the best way. My app is an extranet that has several different Groups. The navigation consists of many Sections that are stored as a tree (MPTT). Some Sections may not be seen by certain Groups. So, to display this navigation tree, I called this method in my SectionsController: public function nav($group_id = null) { if (is_null($group_id)) { if (!$this-params['admin']) { $group_id = $this-Auth-user('group_id'); } } $this-Session-write('group_id_for_nav', $group_id); /* try getting the nodes from the cache */ $sections = Cache::read(group_sections_${group_id}, 'default'); if (!$sections) { /* fetch the permissions for this group */ $perms = $this-Acl-Aco-find( 'all', array( 'fields' = array('Aco.foreign_key'), 'conditions' = array( 'Aco.model' = 'Section', 'Aco.id = Permission.aco_id' ), 'recursive' = -1, 'joins' = array( array( 'table' = 'aros', 'alias' = 'Aro', 'type' = 'INNER', 'conditions'= array( 'Aro.model' = 'Group', Aro.foreign_key = ${group_id} )
Re: MAMP + CakePHP issues
On 1 I second the opinion that vhosts are the way to go. I have never ever ever bothered modifying htaccess files just to get a few apps to run under localhost/one, /two and so on. You are on a Mac and in perfect position to setup in a way that is 100% identical to a production deployment. You need two things. vhosts in the apache conf and fake hostnames for each vhost. There might be a gui but I just edit the file /etc/hosts adding fake names pointing to 127.0.0.1 127.0.0.1 one.site 127.0.0.1 two.site ... That is very convenient. Managing vhosts were mentioned by Frederick. An alternative is to pay for MAMP pro which has built-in support for vhosts and advanced features. Personally I use Apples supplied Apache and PHP and install MySQL as a pkg so I have no details to offer on vhosts in MAMP. Speaking of MySQL. Your second problem might be caused by differing versions of MySQL if the errors apply only to certain queries. If they are advanced as you say then they might require a more up-to-date version than MAMP has. Either that or the version of Cake. And when reading the backtrace, the top line is closest to the error. Cake is born in webroot and looking at the error MySQL has problems interpreting __getUsersForUsers as a SQL syntax... which I can understand. That indicates to me that your version of Cake might be the problem. It looks like a bug in your code but if you are sure the same code is executed without problem on another install then it may be a version problem. /Martin On Sep 25, 3:58 pm, FrederickD manzanillo.engl...@gmail.com wrote: Hi Fahd! I can advise you on the first question, but not the second. I had been using MAMP but decided to take it off and go with a stock approach. It took a little bit, but works solidly now. What makes it very easy is to use a cheap product called VirtualHostX. You can find it athttp://www.macupdate.com/info.php/id/25689/virtualhostx. The price recently went up it appears, but it is so worth it to not be frustrated while developing multiple sites. VirtualHostX is MAMP- friendly. I use it to have a sandbox site where I'm testing code and integration before moving that code over to the development site. Both can be up at the same time, obviously with different databases, but it could be the same one. Hmmm... Anyway, I am also using a product called ModelBaker fromhttp://widgetpress.com that also is MAMP-friendly and removes the need to use a command line when baking. All the database design is visual and the configuration of Cake is a snap. It is a RAP (rapid application prototype) tool that does a great job at generating 80% of the Cake code so you can focus on the 20% that is unique to your application. Plus it can generate an iPhone-aware web application. That's like getting a two-for-one deal! Very promising product. I hope some of this helps. On Sep 24, 3:10 pm, fahd fahd...@gmail.com wrote: Hey fellow Cakers, I've been developing on CakePHP for a bit and decided to have a localhost version on MAMP so that I could demo my app to people without being dependent on an Internet connection. Ran into a few issues ofcourse and hoping someone can give some insight: 1) I have several sites under the /Sites/ folder and I pointed MAMP's Apache document root there. For example /Sites/project1/ is where the Cake app sites. It finds the /project1/ site fine (after some htaccess mods) but there are issues with relative links. Any link that is manually coded and not using $html-link uses /Sites/ instead of / Sites/project1/ as the base. This is for images and any Ajax calls from jQuery. (css and js files are fine). The images I can bare, but the site is unusable without Ajax. Temp solution: changed the document root to /Sites/project1/. This is not ideal, but I'd like to know if you guys have a fix so I don't have to change the document root all the time for previewing different projects. 2) We have a lot of complex MySQL queries being made, using $this-query('SELECT...'). We've placed these in the appropriate models within a function. Hence from the Controller we'll have something like $this-Users-getMeSomething($variable), that goes to the user.php model and runs that function. This works fine on our live and dev sites, but for some reason on MAMP I'm getting the error: Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '__getUsersForUsers' at line 1 [CORE/cake/ libs/model/datasources/dbo_source.php, line 525] The context: == DboSource::showQuery() - CORE/cake/libs/model/datasources/ dbo_source.php, line 525 DboSource::execute() - CORE/cake/libs/model/datasources/ dbo_source.php, line 201 DboSource::fetchAll() - CORE/cake/libs/model/datasources/ dbo_source.php, line 336 DboSource::query() -
neighbors sort
Hi Is there a way I can sort a query and then have the find (neighbors) based on that sort? I'm trying to sort my results by title and then would like prev/next elements returned by neighbors to be the prev/next title in alpha order. However, neighbors is returing the prev/next ids which are not in alpha order. $this-Game-find('neighbors',array ('fields'='Game.title','order'='Game.title ASC')); 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 -~--~~~~--~~--~--~---
find with HABTM problem
hi peoples, i have two models is cakephp: class Pessoa extends AppModel { var $name = 'Pessoa'; var $primaryKey = 'codigo'; var $hasAndBelongsToMany = array( 'Areainteresse' = array( 'className'= 'Areainteresse', 'joinTable' = 'areainteressepessoa', 'foreignKey' = 'codigopessoa', 'associationForeignKey' = 'codigoareainteresse' ) ); } and class Areainteresse extends AppModel { var $name = 'Areainteresse'; var $useTable = 'areainteresse'; var $primaryKey = 'codigo'; } when i run the $this-Pessoa-find(). he return me: array(2) { [0]= array(12) { [codigo]= int(6) } [Areainteresse]= array(0) { } } the Pessoa entity is returned normally, however the entity Areainteresse not returned. This only for the find(). the save() work normally. The data are in the table correctly. Anyone have any solution? --- Wladiston Maurício de Paiva http://wladistonpaiva.com.br desenvolvedo...@gmail.com e...@wladistonpaiva.com.br +55 (31) 8435 - 5380 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
www.ccshoe.cn
www.ccshoe.cn --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Find Value in $this-data
Hi Guys, I am trying to find out if a Value in the $this-data Array excists. Here the structure of the Array: Array ( [Recipe] = Array ( [recipe_name] = ) [Ingredient] = Array ( [1] = Array ( [ingredientname] = Milk ) [0] = Array ( [ingredientname] = Water ) ) } I now wanted to use: if (!in_array($value['In']['ingredientname'],$this-data ['Ingredient']) ) So, if it is not in the array I wanted to give a message out. This does not work for some reason, did I missunderstand the in_array function? Any idea to achieve it otherwise? --~--~-~--~~~---~--~~ 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: HTML5 Options
Well you SHOULD NOT edit the core files. If you want to extend that form helper, create your own form helper and have it extend the original. class MyFormHelper extends FormHelper { } Also we dont know what your talking about when you mention line numbers, because you edited the file and moved the content around to different lines. On Sep 25, 6:46 am, Dave nec...@gmail.com wrote: Hi, I'm attempting to add new options to the Form handler for cakephp 1.2.5. So far i've been able to edit cake/libs/view/helpers/form.php Adding function email($fieldName, $options = array()) { $options = $this-_initInputField($fieldName, array_merge( array('type' = 'email'), $options )); return $this-output(sprintf( $this-Html-tags['input'], $options['name'], $this-_parseAttributes($options, array('name'), null, ' ') )); } function url($fieldName, $options = array()) { $options = $this-_initInputField($fieldName, array_merge( array('type' = 'url'), $options )); return $this-output(sprintf( $this-Html-tags['input'], $options['name'], $this-_parseAttributes($options, array('name'), null, ' ') )); } At line 970 just below the text input box. I also added , 'url' = 'text', 'email' = 'text' To the end of the map array on line 608 Finally case 'email': case 'url': To line 776. I'm curious if this was the correct way or there would be a method to add this to an extended help handler? Although after doing this, it does display the url/email input boxes however it comes with an error. Notice (8): Array to string conversion [CORE/cake/libs/view/ helper.php, line 330] Any pointers would be greatly appreciated Thanks, Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: find('threaded') doesn't find any children
On Sep 18, 12:17 pm, brian bally.z...@gmail.com wrote: On Fri, Sep 18, 2009 at 9:19 AM, George H acher...@gmail.com wrote: Hi everyone, Been ripping my hair out on this one, have no idea why it's not working. Hopefully someone here can find something wrong with my code. I have a model called Regions. There can be main regions, and then there can be subregions that live under the main regions. Each region belongs to a State (another model). Under each region there are Service areas, which is another model. Here is my Regions table: CREATE TABLE IF NOT EXISTS `eco_regions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created` datetime NOT NULL, `modified` datetime NOT NULL, `user_id` int(11) NOT NULL, `state_id` int(11) NOT NULL, `parent_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `status` enum('Live','Deleted') NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; When I perform the following in my controller: $regionsResult = $this-Region-find('threaded', array( 'conditions' = array( 'Region.state_id' = $stateID ), 'recursive' = -1 )); I get an array that has all the regions under that $stateID, along with the children regions under each region, etc. This is the correct behaviour because your condition states that the Region.state_id must be $stateID. However, if I do the following: $regionsResult = $this-Region-find('threaded', array( 'conditions' = array( 'Region.id' = $regionID ), 'recursive' = -1 )); I just get the region record for $regionID, and *no* children, even though all the children regions show up in the previous controller code. I only want to retrieve the children regions under the selected region, and not for the whole state. Correct again, because you've limited the result to exactly one record by specifying a particular id. My models: class Region extends AppModel { var $name = 'Region'; var $order = Region.name ASC; var $actsAs = array(Containable); var $hasMany = array( 'Servicearea' = array( 'className' = 'Servicearea', 'conditions' = '', 'order' = '', 'foreignKey' = 'region_id' ) ); var $belongsTo = array( 'State' = array( 'className' = 'State', 'conditions' = '', 'order' = '', 'foreignKey' = 'state_id' ), 'User' = array( 'className' = 'User', 'conditions' = '', 'order' = '', 'foreignKey' = 'user_id' ) ); } It seems whenever I want to search by Regions.id, *no* children load up, regardless if there's any or not. If I change my conditions to filter by something else, then they all appear! I'm not sure that you can do this without using lft rght columns in your table. See the example in the manual here: http://book.cakephp.org/view/812/find-threaded This might be the way you, brian, want it to work, however, I am in George's boat. I expected this to pass the conditions to the children find() calls and build the threaded list based on that. Instead, it does a simple find('all') with conditions, it doesn't actually do a threaded find(). --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
RequestActions and Fatal errors
Hi guys, I have a scenario where we are using requestAction which hits a fatal error internally. The following actions happen correct, and the system displays a costom error page. However, the View contents still have the contents from the view the RequestAction was called from. How do we clear the View of its output, so that only the error page content is sent to the browser? Tried to get the View from the controller, and then set $View-output = '' but this did nothing. I suspect becuase I was getting the incorrect View object. Does anyone have a suggestion on how to set the View output of the View before the requestAction was called and set it to ''? Is it even possible? G --~--~-~--~~~---~--~~ 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: RequestActions and Fatal errors
Ok, I solved my problem partially be adding to a custom AppError class... function __construct() { ob_clean(); parent::__construct(); } I still had some output coming out from the view that called the requested action, but I moved that code into the elements/actions being called. However, not sure if it would be possible that the error hanlder been modified to handle such scenario's. Unless I have totally got it wrong. It would also be nice to see the error handler class __construct get an extension to set the layout to a customised value. This avoids additional errors when the layout file calls helpers that did not get loaded cause the action went into an error. G. --~--~-~--~~~---~--~~ 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: secure link using hmtl-link helper..
Anyone found the solution ? I am on the same boat. Best, ~IF. --~--~-~--~~~---~--~~ 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: Find Value in $this-data
You could try the isset function. isset($this-data['Ingredient'] [$value['In']['ingredientname']]). But if $this-data['Ingredient'] [$value['In']['ingredientname']] is null, it will also return false. isset checks if variable exists and is not null. --~--~-~--~~~---~--~~ 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: changing $session-flash('auth'); layout
Thanks. I finally sucked up my Oh woe is me and just *gasp* changed the css styles to fit what cake automatically outputs. MUCH better now. On Sep 24, 10:27 pm, brian bally.z...@gmail.com wrote: Gotcha. Auth uses 'default' layout when calling $this-Session-setFlash(). Have a look at SessionHelper::flash() to see how it handles that. http://api.cakephp.org/view_source/session-helper/#line-129 In any case, if you want to style/move it/whatever, create a CSS rule for the #authMessage selector. You can even use javascript to do a little more with it. (simple with jQuery). On Thu, Sep 24, 2009 at 8:54 PM, adam abennett...@sbcglobal.net wrote: Sorry. When calling $session-flash('auth'); in my layout, it outputs the message like this: div id=authMessage class=messageMESSAGE HERE/div I would like it to be whatever I want it to be. When calling $this- setFlash(), the second or third parameter allows you to set the flash layout. And then $session-flash(); will output the message in that layout. However, this functionality is missing from auth flash messages. Or is it? That's what I'm asking. On Sep 24, 7:13 pm, brian bally.z...@gmail.com wrote: I read that 3 times and still have no idea what you want to do. On Thu, Sep 24, 2009 at 2:37 PM, adam abennett...@sbcglobal.net wrote: i am implementing a layout and am sad that i can not change the auth flash layout, instead i am having to use session-check(), then session-read(), and then to remove the message, session-flash() into an area of the layout where it will not be displayed. is there a way to chagne the flash layout for auth messages (like with setFlash layouts?) without having to extend the session helper, or maybe be able to delete the message with the session helper from the layout without using flash() which displays the message? --~--~-~--~~~---~--~~ 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 up Auth is breaking my Add and Edit functions on all controllers.
Does anyone have a good sense of whether this is could be considered a bug and if so, how can i submit it as one to the CakePhp community? My code works how I want it to work, but it certainly doesn't look like what I think CakePhp intended, I don't want to build my whole site using it and one day have to change everything when an update of CakePhp breaks it all. I'd rather submitt a bug, track it, help if i can and make sure it works as intended in the future versions. I'll appreciate any comments. Thank you. On Sep 17, 11:56 pm, gparra gpa...@gmail.com wrote: Oh, by the way, I realized afterwards. Make sure you users_controller either doesn't have a beforeFilter() function or if it does, it calls parent::beforeFilter() as the first thing it does. Otherwise you won't be able to login or out with the custom hash in the model. (I know this makes it even more confusing to figure out how the whole thing is working, but at least it is, and that's really where I wanted it to be in the first place.) On Sep 17, 11:41 pm, gparra gpa...@gmail.com wrote: Ok, so basically I left it working as intended, but I'm not sure this is the way CakePHP intended for me to write it so it would work. I tried removing isAuthorized and that made any controller without a beforeFilter() function claiming for a definition of isAuthorized. I tried four different controllers with the above mentioned app_controller: 1. No before filter function - Everything is accessible without a password, but add and edit don't send you to the form, put you back on index displaying the flash The controller has been saved 2. Before filter function with: function beforeFilter(){ parent::beforeFilter(); $this-Auth-allow('index'); } In this case, nothing requires a login and Add and Edit behave the same way as with 1. 3. Before filter function with only $this-Auth-allow('index'); - Here everything works as intended, index doesn't require a password and add and edit work just fine. Note the fact again that this only happens if I DONT call parent:beforeFilter() 4. Empty beforeFilter() function - Everything requires a password (even though the app_controller says allow('*'), but after the password is entered, everything behaves as it should. Thus since i was uncomfortable with the fact that my solution combined an allow('*') in the app_controller with an empty beforeFilter() function, i decided to try allow('display') again and combined it with number 3 above. This way It would at least make sense that everything would require a password except for index and display, even though not calling parent::beforeFilter() wasn't being called. And that worked. so my final combination 'weird solution' looks like this: app_controller: ?php class AppController extends Controller { var $components = array('Auth'); function beforeFilter() { Security::setHash('md5'); $this-Auth-authenticate = ClassRegistry::init('User'); $this-Auth-fields = array( 'username' = 'name', 'password' = 'pass', ); $this-Auth-loginAction = array('controller' = 'users', 'action' = 'login'); $this-Auth-loginRedirect = array('controller' = 'pages', 'action' = 'display', 'home'); $this-Auth-allow('display'); $this-Auth-authorize = 'controller'; } function isAuthorized() { return true; }} ? controller before filter: function beforeFilter(){ $this-Auth-allow('index'); } User model hashpasswords: function hashPasswords($data) { $data['User']['pass'] = md5($data['User']['pass']); return $data; } This allows me to move forward with an authenticated app that allows index without credentials and lets me leave everything else working as it should. The downside is that if this is a bug I'm going to have to re-write all the stuff once it gets fixed and that will be a big pain since I have to put either and empty beforeFilter() function or one with the allow index in every single controller I need to have authentication. I hope my solution helps someone else in the future, or is at least used for debugging of Cake. If I'm wrong though and I'm doing something silly that is making me have this not so nice behavior I'll be happy to swallow my words and venerate CakePHP accordingly so please let me know if I am! Thank you! On Sep 17, 9:41 am, gparra gpa...@gmail.com wrote: I'll give the authorize thing a try again, although I didn't have it in the previous version, I don't think it will make a difference. I did read a lot about whether to use the salt or not, for other things rather than just the password hashing and Cake doesn't only use it for the password hashing but also for other things, like cookies I
Re: how to use migration in Cakephp
On Fri, Sep 25, 2009 at 8:16 AM, Vijay k.vidn...@gmail.com wrote: Hello All, I am wandering for the migration concept in cakephp. I also followed the steps from the following URL, http://bakery.cakephp.org/articles/view/cakephp-yaml-migrations-and-fixtures-without-pear Also followed the instructions but i found that it created on migrate folder in my application folder with all the app folder structure. I didnt get this. Can anybody please help me in this. I'm using this one. A great migrations implementation. http://github.com/jrbasso/migrations Best regards. -- MARCELO DE F. ANDRADE Belem, PA, Amazonia, Brazil Linux User #221105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Including non-plugin element from within plugin
Solved with: ?php echo $form-create('User', array('url'=array ('plugin' = null, 'action' = 'login')));? On Sep 24, 5:39 pm, michaelc micha...@hwsinet.com wrote: I'm experiencing an interesting problem wherein I include from within a view in a plugin an element which contains a form (the users login form, that is). However, I can't seem to see a way free to not having it prepend the plugin name onto the action. The offending code is line 156 of form.php, knowing as we do that Form::plugin is set when it is initialized from View::_loadHelpers (see line 755). My essential problem is that there appears to be no way to change the plugin context once inside of a plugin's view, to reflect the inclusion of non-plugin content. I am using plugins like photoshop, to extend the functionality of a base site, and the usecase seems awkward when compared with the design for a plugin (extending a generic site - they therefore must be self contained). Given how easy it is to load a base element, it would appear however that either was planned for. Any help in understanding and resolving this matter would be greatly appreciated. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
simple contain question
hi all. is it possible to set the containable behaviour of a model in its model file? just to set it once, staticly... maybe with the ability to change it on the fly when needed... 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: How can I build a navigation menu in cakephp?
On Fri, Sep 25, 2009 at 12:34 AM, Barney zhangping...@gmail.com wrote: thanks, what's caching result? can you give me more tips please The server stores a version of the result so that, on subsequent requests, it need not request the data from the DB, filter it, turn it into a view (the HTML). Although there are several different types of caching with Cake, including caching queries or caching the entire view. Also, there are different types caching engines one can use. The config is in app/config/core.php. The most basic is file, which stores the cache as files (big surprise). MemCache uses, as the name suggests, the server's memory. That's the one i prefer but it involves installation on the server. If you do not control your own server, this option is likely not available. But it couldn't hurt to ask you hosting company if it is. APC may also be available. Anyway, the basic idea would be to check the cache in your action and, if available, return that. Otherwise, do a find() as normal and write the result to the cache. http://book.cakephp.org/view/764/Cache http://teknoid.wordpress.com/2009/06/17/send-your-database-on-vacation-by-using-cakephp-memcached/ --~--~-~--~~~---~--~~ 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 viewing data...
And when you have debug set to 2, what does the query look like? On Fri, Sep 25, 2009 at 9:19 AM, mig_akira mig_ak...@hotmail.com wrote: Ok just did that, here's the output: prjr2009/controllers/users_controller.php (line 88) id: 2 So the ID is correct, but it's still showing the user with id: 1 ! I'm starting to think it's mocking me =P brian-263 wrote: Put debug(id: ${id}) in your controller. Maybe it's not what you think it is. Do you have a route for this action? On Thu, Sep 24, 2009 at 1:38 PM, mig_akira mig_ak...@hotmail.com wrote: Ops, sorry, here's the code for views/users/view.ctp [code] div class=noticias view h2?php __('User');?/h2 div id=view_conteudo dl?php $i = 0; $class = ' class=altrow';? dt?php if ($i % 2 == 0) echo $class;??php __('Ativo'); ?/dt dd?php if ($i++ % 2 == 0) echo $class;? ?php echo $user['User']['active']; ? /dd dt?php if ($i % 2 == 0) echo $class;??php __('Name'); ?/dt dd?php if ($i++ % 2 == 0) echo $class;? ?php echo $user['User']['name']; ? (and son on).. [/code] the contents are not the same, because it happens for every user...doesn't matter if it's user number 7 or 123...=( I don't get, because all other views for other controllers, such as for groups, are correct and are pretty much similar to the users view! brian-263 wrote: On Mon, Sep 21, 2009 at 4:47 PM, mig_akira mig_ak...@hotmail.com wrote: hello everyone! I'm building a simple web page, with Auth/ACL and a few members. Problem is, I baked the admin part of the site, and everything works fine except for one thing! In my users admin page, I click in view, but it insists in showing the view for the first user (in this case, the admin). In my url, it shows /users/view/7 (number of the user's ID), but it shows the data for the user with ID == 1. Funny thing is, if I click EDIT instead of VIEW, it shows the correct user! (and the URL is /users/edit/7) Here are the codes for the VIEWS/USERS/INDEX.CTP : [code] ?php $i = 0; foreach ($users as $user): $class = null; if ($i++ % 2 == 0) { $class = ' class=altrow'; } ? tr?php echo $class;? td ?php echo $user['User']['username']; ? /td td ?php echo $user['User']['name']; ? /td td ?php echo $user['User']['email']; ? /td td class=actions ?php echo $html-link(__('View', true), array('action'='view', $user['User']['id'])); ? ?php echo $html-link(__('Edit', true), array('action'='edit', $user['User']['id'])); ? ?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'])); ? /td /tr ?php endforeach; ? [/code] That's the view for index(), not view(). The latter would not have a foreach loop, as you should only have a single User in your array. And here's for the action view in the users_Controller.php: [code] function view($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid User.', true)); $this-redirect(array('action'='index')); } $this-set('user', $this-User-read(null, $id)); } [/code] What could be the problem? Check that you're looking at the proper view file. Then, add debug($user). It's possible that the record in the database is the same for User 1 7. -- View this message in context: http://www.nabble.com/Problem-viewing-data...-tp25530475p25578012.html Sent from the CakePHP mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Problem-viewing-data...-tp25530475p25612039.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to cache admin pages
I don't know if Cake avoids the cache for admin pages but, personally, I don't see any point in caching them, anyway. Your server wouldn't likely get very many hits for them. On Fri, Sep 25, 2009 at 7:01 AM, irshad irshadahmed.ans...@gmail.com wrote: Hello, I am using cakephp 1.2 for developing my project. I am caching the pages, i am able to cache pages easily and it is working fine but i am not able to cache admin pages. Means i am not able to cache the pages having admin/... in the url. I am able to cache this type of url eg: http://localhost/stc/admins/viewall I am not able to cache this type of url eg: http://localhost/stc/admin/admins/viewall The above url contains admin in the url because it is admin side page and i am not able to cache this type of page. Please help me. Thanks, Irshad --~--~-~--~~~---~--~~ 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: international SEO routing
My solution is to rewrite the Router::base in your app_controller.php beforeFilter() - //INTERNAZIONALIZATION if(Configure::Read('Multilingual.enable')){ //$this-base = $this-base.'/'.$this-params['language'].'/'; if(__RQL__ != '' __RQL__ != 'it' !isset($this-params [Configure::read('Routing.admin')])){ $this-base = $this-base.'/'.__RQL__.'/'; $router = Router::getInstance(); $router-__paths[0][base]=$router-__paths[0] [base].DS.__RQL__; } } - in your config/bootstrap.php - //INTERNAZIONALIZATION Configure::write('Multilingual.enable', 1); if(Configure::Read('Multilingual.enable')){ $config['websiteConfig']['languages'] = array('it'='ita', 'en'='eng'); $uriLang = 'it'; $languageKeys = array_keys($config['websiteConfig'] ['languages']); if (isset($_GET['url']) in_array( substr( $_GET['url'], 0, strpos( $_GET['url'], '/' ) ), $languageKeys)) { //if(!defined('__RQL__')) $uriLang = substr( $_GET['url'], 0, strpos( $_GET['url'], '/' ) ); $_GET['url'] = substr( $_GET['url'], 3, 255 ); Configure::write('Config.language', $config ['websiteConfig']['languages'][$uriLang]); } define('__RQL__', $uriLang); if(__RQL__ == ''){ define('DEFAULT_LANGUAGE', 'ita'); } else{ define('DEFAULT_LANGUAGE', $config['websiteConfig'] ['languages'][__RQL__]); } //echo strlen( substr( $_GET['url'], 0, strpos( $_GET['url'], '/' ) ) ) == 3 )); if(!defined('DEFAULT_LANGUAGE')){ define('DEFAULT_LANGUAGE', 'ita'); } //debug(__RQL__); //debug(DEFAULT_LANGUAGE); } in your config/routes.php - Router::connect('/it', array('controller' = 'pages', 'action' = 'display', 'home')); Router::connect('/en', array('controller' = 'pages', 'action' = 'display', 'home')); - --~--~-~--~~~---~--~~ 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: find('threaded') doesn't find any children
On Fri, Sep 25, 2009 at 12:22 PM, Chris ch...@thompsonbd.com wrote: This might be the way you, brian, want it to work, however, I am in George's boat. I expected this to pass the conditions to the children find() calls and build the threaded list based on that. Instead, it does a simple find('all') with conditions, it doesn't actually do a threaded find(). Given that I've written exactly 0 lines of code for Cake's core, I'd say that it has nothing to do with what I *want*. I was simply pointing out that Cake was responding logically, given the supplied conditions. Again: AFAIK, 'threaded' is useless without setting the table up for MPTT ('lft' 'rght' columns). http://book.cakephp.org/view/812/find-threaded http://articles.sitepoint.com/article/hierarchical-data-database/2 http://dev.mysql.com/tech-resources/articles/hierarchical-data.html http://bakery.cakephp.org/articles/view/modified-preorder-tree-traversal-component --~--~-~--~~~---~--~~ 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: Search-Engine: Extend results with random records if there are no 'real' results
On Fri, Sep 25, 2009 at 8:47 AM, braaan martin.platt...@gmail.com wrote: i can't use ORDER BY RAND() on every page because then the user would get different results on every refresh. Well, it wouldn't be very random, otherwise, would it? i thought about doing the data-fetching myself (and extend if there are to less results) and give it to the pagination manually, is this possible? What do you mean by doing the data-fetching myself and manually? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to user imagemagik in cakephp
Well, what's the problem? Are you getting errors? Do you see anything in Cake's error log? What about Apache's? Can you use ImageMagick from a terminal? Can you use it from a plain (non-Cake) PHP script? On Fri, Sep 25, 2009 at 9:28 AM, Vijay Kumbhar k.vidn...@gmail.com wrote: Hello Jonathan, Thanks for the reply. I have tried the following links, http://www.imagemagick.org/script/install-source.php#unix using the instructions in the above link pages i have installed the image magik. Also i was searching for the uses from , http://www.imagemagick.org/Usage/ But i didnt get anything. can you please help me out? On Fri, Sep 25, 2009 at 5:12 PM, Jonathon Musters luvz2...@gmail.com wrote: More information About whAt you tried, results, and what your looking to get would be helpful On 9/25/09, Vijay k.vidn...@gmail.com wrote: Hello All, I am trying to work with image magik for one application. I am not getting any satisfying solution for this. Can anybody please help me out. -- Sent from my mobile device -- Thanks Regards, Vijayk. Co-founder (www.weboniselab.com) You Bring the Dreams, We'll Bring the Means --~--~-~--~~~---~--~~ 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: find with HABTM problem
What does the find() code look like? It's possible that the problem is with your unconventional column names. It might work better if you use, eg. 'areainteresse_pessoa' for the join table and 'pessoa_id' for the key. Or it might be something else. On Fri, Sep 25, 2009 at 11:30 AM, Wladiston Paiva desenvolvedo...@gmail.com wrote: hi peoples, i have two models is cakephp: class Pessoa extends AppModel { var $name = 'Pessoa'; var $primaryKey = 'codigo'; var $hasAndBelongsToMany = array( 'Areainteresse' = array( 'className' = 'Areainteresse', 'joinTable' = 'areainteressepessoa', 'foreignKey' = 'codigopessoa', 'associationForeignKey' = 'codigoareainteresse' ) ); } and class Areainteresse extends AppModel { var $name = 'Areainteresse'; var $useTable = 'areainteresse'; var $primaryKey = 'codigo'; } when i run the $this-Pessoa-find(). he return me: array(2) { [0]= array(12) { [codigo]= int(6) } [Areainteresse]= array(0) { } } the Pessoa entity is returned normally, however the entity Areainteresse not returned. This only for the find(). the save() work normally. The data are in the table correctly. Anyone have any solution? --- Wladiston Maurício de Paiva http://wladistonpaiva.com.br desenvolvedo...@gmail.com e...@wladistonpaiva.com.br +55 (31) 8435 - 5380 --~--~-~--~~~---~--~~ 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: find with HABTM problem
unfortunately not always possible. because the database already exists. I am only deploying the system in PHP (currently Delphi). and the base is in Firebird. I had problems with the Auth component because of the Firebird, I believe the problem is the integration of the cake with the firebird. I am installing ZendServer with ZendStudio to test via debugger with MySQL to work the problem really is the cake. --- Wladiston Maurício de Paiva http://wladistonpaiva.com.br desenvolvedo...@gmail.com e...@wladistonpaiva.com.br +55 (31) 8435 - 5380 2009/9/25 brian bally.z...@gmail.com What does the find() code look like? It's possible that the problem is with your unconventional column names. It might work better if you use, eg. 'areainteresse_pessoa' for the join table and 'pessoa_id' for the key. Or it might be something else. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to user imagemagik in cakephp
Have you checked that php is now showing it with a phpinfo(); ? more information and details are needed On Fri, Sep 25, 2009 at 2:31 PM, brian bally.z...@gmail.com wrote: Well, what's the problem? Are you getting errors? Do you see anything in Cake's error log? What about Apache's? Can you use ImageMagick from a terminal? Can you use it from a plain (non-Cake) PHP script? On Fri, Sep 25, 2009 at 9:28 AM, Vijay Kumbhar k.vidn...@gmail.com wrote: Hello Jonathan, Thanks for the reply. I have tried the following links, http://www.imagemagick.org/script/install-source.php#unix using the instructions in the above link pages i have installed the image magik. Also i was searching for the uses from , http://www.imagemagick.org/Usage/ But i didnt get anything. can you please help me out? On Fri, Sep 25, 2009 at 5:12 PM, Jonathon Musters luvz2...@gmail.com wrote: More information About whAt you tried, results, and what your looking to get would be helpful On 9/25/09, Vijay k.vidn...@gmail.com wrote: Hello All, I am trying to work with image magik for one application. I am not getting any satisfying solution for this. Can anybody please help me out. -- Sent from my mobile device -- Thanks Regards, Vijayk. Co-founder (www.weboniselab.com) You Bring the Dreams, We'll Bring the Means --~--~-~--~~~---~--~~ 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: simple contain question
Do you mean that you only want that one model to implement it? Yes, you can do that. The syntax is exactly the same as with AppModel: var $actsAs = array('Containable'); or (PHP5 only) public $actsAs = array('Containable'); On Fri, Sep 25, 2009 at 1:46 PM, lorenx lor...@gmail.com wrote: hi all. is it possible to set the containable behaviour of a model in its model file? just to set it once, staticly... maybe with the ability to change it on the fly when needed... 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: Best way to accomplish acl for database records owned by a user
On Fri, Sep 25, 2009 at 2:25 AM, rOger roger.eisenec...@icer.ch wrote: Thanks for your answers!! @brian: It looks rather complex to accomplish such a easy task so I think there must be an easier way to get the same result... Yeah, sure it's complex. As I pointed out, though, the example I posted goes a little further than what you're looking for. But I wanted to post it in full so you'd see the context. The nutshell version is to query the ACO table using inner joins on both aros aros_acos. The record ID you're checking access to corresponds to Aro.foreign_key. I have no idea if this is THE way to do it, as I couldn't find anything much about record-level ACL and Cake. This is what I figured out on my own and it seems to work great (at least, for my app). --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Style a Submit
How can you style a submit with a CSS style in directly in the echo $form-end('Save'); I want to use a CSS sprite which has the various states but when nothing i try works. Has anyone done this? 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 -~--~~~~--~~--~--~---
newbie table association
hi there I want to make a product model that has a country_of_fabrication and a country_to_sale_too. Of course, both of these fields are related to the same countries table. In the product add view I want to have two SELECT elements populated with the countries table entries (the well known country drop-down list) Question one Do I have to build a model for the countries table? I don't need to edit that table. Question two How do I make the association in the product model? hasOne? hasMany? It's very easy in plain old php programming, but here I'm lost. Sorry if it's obvious, but I am new to the MVC concept. TIA --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
learning cake
I just downloaded cake php and followed the directions. I could see welcome page. But after making posts when I go to localserver/mysite/ posts it says Not Found The requested URL /mysite/posts was not found on this server. when I go to localserver/mysite then it gives me the welcome page. Am I missing something. Any help would be appreciated. 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 -~--~~~~--~~--~--~---
Layout and design
Hi, I'm new in cake, i have question about designing, and creating layout for my site, my site is on this domain http://www.hrvatskiportali.com/HPredizajn/ an this isn't made by CakePHP this is my own made. I want to create this same design with jQuery and other stuff in CakePHP but don't know where to start. I read Manual, and i know a lot of cake, but that how to make first step with creating design a don't know. I made ERA model and datebase with cake convention :) I want to create layout (like it is now) which will have 1) header section 2) content section - left side is content (2 columns) - right side is sidebar with widgets (elements) 3) footer section my question is, how to create this layout where i will put some widgets in sidebar dependent of users preferences, and content on the left side? Please help!! P.S. I'm from Croatia and my English maybe isn't very good, I apologize for that :) --~--~-~--~~~---~--~~ 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: Best way to accomplish acl for database records owned by a user
Thanks again for additional pointers. I got many interesting information how to create a row level based access. We are going to make some tests to see which is the best solution in our case. rOger On Sep 25, 10:23 pm, brian bally.z...@gmail.com wrote: On Fri, Sep 25, 2009 at 2:25 AM, rOger roger.eisenec...@icer.ch wrote: Thanks for your answers!! @brian: It looks rather complex to accomplish such a easy task so I think there must be an easier way to get the same result... Yeah, sure it's complex. As I pointed out, though, the example I posted goes a little further than what you're looking for. But I wanted to post it in full so you'd see the context. The nutshell version is to query the ACO table using inner joins on both aros aros_acos. The record ID you're checking access to corresponds to Aro.foreign_key. I have no idea if this is THE way to do it, as I couldn't find anything much about record-level ACL and Cake. This is what I figured out on my own and it seems to work great (at least, for my app). --~--~-~--~~~---~--~~ 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: learning cake
On Fri, Sep 25, 2009 at 7:31 PM, Janu asimmee...@gmail.com wrote: I just downloaded cake php and followed the directions. I could see welcome page. But after making posts when I go to localserver/mysite/ posts it says Not Found The requested URL /mysite/posts was not found on this server. when I go to localserver/mysite then it gives me the welcome page. Am I missing something. Any help would be appreciated. Thanks Huh... Please provide us more information. Which webserver are you using? If it's Apache, have you set the AllowOverride directive to all? Is your mod_rewrite enabled? Which install environment you will use? Windows, Linux, Mac, other? How your model, controller and views looks like? Best regards. -- MARCELO DE F. ANDRADE Belem, PA, Amazonia, Brazil Linux User #221105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Style a Submit
The form should have an ID. Just create a CSS rule for #form_id input[type='submit']. Also, Cake's default is to put the submit button in a div with class=submit so you can use that, also, for your CSS selector. On Fri, Sep 25, 2009 at 6:10 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: How can you style a submit with a CSS style in directly in the echo $form-end('Save'); I want to use a CSS sprite which has the various states but when nothing i try works. Has anyone done this? 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: Style a Submit
You also should consider using the button tag instead of the default input button. Take a look: http://www.w3schools.com/tags/tag_button.asp The button tag is much more flexible as it is totally customizable, and you can put orther elements inside of it, like images: buttonimg src=image.jpg alt=Ha! //button Then, you just close the form with $form-end(); Maybe this will help! On Fri, Sep 25, 2009 at 9:54 PM, brian bally.z...@gmail.com wrote: The form should have an ID. Just create a CSS rule for #form_id input[type='submit']. Also, Cake's default is to put the submit button in a div with class=submit so you can use that, also, for your CSS selector. On Fri, Sep 25, 2009 at 6:10 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: How can you style a submit with a CSS style in directly in the echo $form-end('Save'); I want to use a CSS sprite which has the various states but when nothing i try works. Has anyone done this? Ideas? Dave -- Éber Freitas Dias www.eberfdias.com www.dejamps.net --~--~-~--~~~---~--~~ 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: Style a Submit
Ow, by the way, you need to use type=submit: button type=submitWhatever you want here/button []'s On Fri, Sep 25, 2009 at 10:58 PM, Eber Freitas Dias eber.frei...@gmail.comwrote: You also should consider using the button tag instead of the default input button. Take a look: http://www.w3schools.com/tags/tag_button.asp The button tag is much more flexible as it is totally customizable, and you can put orther elements inside of it, like images: buttonimg src=image.jpg alt=Ha! //button Then, you just close the form with $form-end(); Maybe this will help! On Fri, Sep 25, 2009 at 9:54 PM, brian bally.z...@gmail.com wrote: The form should have an ID. Just create a CSS rule for #form_id input[type='submit']. Also, Cake's default is to put the submit button in a div with class=submit so you can use that, also, for your CSS selector. On Fri, Sep 25, 2009 at 6:10 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: How can you style a submit with a CSS style in directly in the echo $form-end('Save'); I want to use a CSS sprite which has the various states but when nothing i try works. Has anyone done this? Ideas? Dave -- Éber Freitas Dias www.eberfdias.com www.dejamps.net -- Éber Freitas Dias www.eberfdias.com www.dejamps.net --~--~-~--~~~---~--~~ 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: Style a Submit
Yeah I went with button as the input. All is good. Thanks Dave _ From: Eber Freitas Dias [mailto:eber.frei...@gmail.com] Sent: September-25-09 11:29 PM To: cake-php@googlegroups.com Subject: Re: Style a Submit You also should consider using the button tag instead of the default input button. Take a look: http://www.w3schools.com/tags/tag_button.asp The button tag is much more flexible as it is totally customizable, and you can put orther elements inside of it, like images: buttonimg src=image.jpg alt=Ha! //button Then, you just close the form with $form-end(); Maybe this will help! On Fri, Sep 25, 2009 at 9:54 PM, brian bally.z...@gmail.com wrote: The form should have an ID. Just create a CSS rule for #form_id input[type='submit']. Also, Cake's default is to put the submit button in a div with class=submit so you can use that, also, for your CSS selector. On Fri, Sep 25, 2009 at 6:10 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: How can you style a submit with a CSS style in directly in the echo $form-end('Save'); I want to use a CSS sprite which has the various states but when nothing i try works. Has anyone done this? Ideas? Dave -- Éber Freitas Dias www.eberfdias.com www.dejamps.net --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---