datetime and timezone best practice?
Hello everbody, I would kindly like to attract your attention to a question I wrote on stackoverflow yesterday. http://stackoverflow.com/questions/29127162/how-to-define-timezone-in-cakephp-datetime-form-object Has anyone any best practice tutorial or any advice how to solve it? Thanks in advance and kind regards, Andreas -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Dynamic Database connections
Hello all, I got a problem I can't find a default solution for it in Cakephp: Database connections for additional Datasources are stored in the default database of cakephp. How do I load the connection data to use the setDatasource - functionality? Thanks a lot for helping. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Custom setflash messages in cakephp 1.3
Im trying to create custom designs for setFlash messages. I've seen sevral tutuorials for this, like http://tech.rytis.net/2008/8/27/discover-layouts-for-setflash-method-in-cakephp , but none of them seems to work for me. I've installed cake 1.3 and it seems like it's looking for a element view instead of a layout which i specify in the second argument in the setFlash. Anybody know why? Is there any place to set where to look for the layouts for such messages? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Problems with GD i Cake
Hi, I have some problems with using GD in Cakephp. Output from i.e. the imagejpeg() function reports just wrongly encoded data like: ... � JFIF� �� � � ... So i was just wondering if anybody had any experience with this kind of problems, which seems to be an encodingproblem:P -thanks! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Using same functions in several views
Hi, I'm trying to implement some functionality for hiding buttons(and info) from a page depending on parameters sat for the specific user (in the model). Off course to create some restrictions for the different users. But im kind of confused how to do this. The way i do it now is like: 1. Cache the user capabilities on login (now i have implemented this in the App_model, which is bad, so i made another post about this) 2. In each function view read the cached user capabilities and iterate that list and check if that function should be rendered. Code: foreach(Cache::read('userCapList') as $userCap){ if($userCap['tag']==user_edit){ // echo function } } I think this solution is bad, and wonder if any of you have a better solution? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Using same functions in several views
Well, I have to explain the topic for the discussion too; I'm looking for a solution where I can make a function to check if user have this capability like if(userHasCap('user_edit')). How can i make a function like this and include it into every view i need it? Component? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Using same functions in several views
Thanks people! Worked out great;) On Jul 20, 12:29 pm, Mike Karthauser mi...@brightstorm.co.uk wrote: hi Petter; On Tue, July 20, 2010 9:12 am, Petter Andreas Str m wrote: Well, I have to explain the topic for the discussion too; I'm looking for a solution where I can make a function to check if user have this capability like if(userHasCap('user_edit')). How can i make a function like this and include it into every view i need it? Component? you could do this in a view helper if you are expecting logic to go into a view page (.ctp). ideally the logic should go in the action for the view in which case you could either use a component or more simply just a function in app_controller which will make it available to each controller. -- Mike Karthauser Managing Director - Brightstorm Ltd Email: mi...@brightstorm.co.uk Web:http://www.brightstorm.co.uk Tel: 07939 252144 (mobile) Fax: 0870 1320560 Address: 1 Brewery Court, North Street, Bristol, BS3 1JS Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Using same functions in several views
Thanks people! Worked out great;) On Jul 20, 12:29 pm, Mike Karthauser mi...@brightstorm.co.uk wrote: hi Petter; On Tue, July 20, 2010 9:12 am, Petter Andreas Str m wrote: Well, I have to explain the topic for the discussion too; I'm looking for a solution where I can make a function to check if user have this capability like if(userHasCap('user_edit')). How can i make a function like this and include it into every view i need it? Component? you could do this in a view helper if you are expecting logic to go into a view page (.ctp). ideally the logic should go in the action for the view in which case you could either use a component or more simply just a function in app_controller which will make it available to each controller. -- Mike Karthauser Managing Director - Brightstorm Ltd Email: mi...@brightstorm.co.uk Web:http://www.brightstorm.co.uk Tel: 07939 252144 (mobile) Fax: 0870 1320560 Address: 1 Brewery Court, North Street, Bristol, BS3 1JS Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Login using Auth component
Hi, Im modifying an existing login function which uses the Auth component. My modifications is that i want to cache some user-details during the login-sequence. Im kind of looking for a way to implement this, but no luck yet. I kind of found a solution where i did the caching in the App_model but this solution runs the code everytime a model is run, and the cacheing becomes useless. Anybody? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Something like ActiveMerchant?
Ok, I make a repo to github. I named it Aktive Merchant ;) The link is http://github.com/akDeveloper/Aktive-Merchant Will add soon some wiki notes for development new gateways. Please give your feedback. Thanks On Jul 16, 7:20 am, iamcam (Cameron Perry) mistercame...@gmail.com wrote: This all sounds great! I don't have much of have an opinion of what to do with the name considering the most obvious combinations of PHP and Merchant have already been used. I dunno, maybe Active PHP Merchant? I'm not the most imaginative when it comes to naming. I haven't used PHPUnit yet, but I think that could be a nice way for interested parties (myself included) to get involved just by starting some tests. Take care, Cameron On Jul 14, 2:34 pm, Andreas andreas.kolla...@gmail.com wrote: I 'll make a git repo in a few days so you can see the source code. @iamcam The code is close to ruby code ( as php 5.2 allows ). Gateways have standard public methods ( authorize, purchase, void etc ). Every response is an Response class object. There is also Creditcard class object, and everything Active Merchant has. Some missing, for now, features are PHPUnit tests and integation form helper. By the way, thinking of naming this project phpMerchant but googling on that i found this linkhttp://code.google.com/p/php-merchant/ It is an Active Merchant like project, but it is inactive for over a year... On Jul 14, 10:15 am, iamcam (Cameron Perry) mistercame...@gmail.com wrote: Bharadwaj, That's the best I could come up with in the PHP world. Unfortunately the PEAR packages look outdated, and the Kohana component is for that framework - not sure how it would work as a stand-alone. There are ports in other languages (python and Objective- C), but that doesn't help us. This is a huge need in the PHP community, even if most the payment gateways already have sample code. It's so much nicer working with consistent interfaces than trying to decipher the intricacies between all the various APIs. ~Cameron On Jul 12, 10:32 pm, Bharadwaj Parthasarathy barbi.br...@gmail.com wrote: +1 for github I am also interested in participating in development. From a quick google search, there seems to be no similar framework in php. You may want to check this -http://stackoverflow.com/questions/2768942/do-any-projects-exist-for-... - Bharadwaj On 12-Jul-10, at 10:23 PM, iamcam (Cameron Perry) wrote: How closely are you following the original ruby version? I'd be interested in helping out here and there once you put it on github (so much better than google). ~Cameron On Jul 9, 4:20 pm, Andreas andreas.kolla...@gmail.com wrote: Hi, I am currently developing a port of Active Merchant on PHP. I 've also add a few gateways for testing such as PaypalExpress, Hsbc, Authorize.net(partial), Centinel 3D secure(partial), and Eurobank(Greek bank). I am planning to make a public repository on github or google project hosting, when i clean the code and add some documentation. I hope this will help php developers to integrate payments api to their eCommerce applications. On Jul 6, 1:51 am, iamcam (Cameron Perry) mistercame...@gmail.com wrote: Has anyone seen anything like ActiveMerchant on the PHP side? I searched around a bit but haven't seen anything. I'm intrigued by the fact that it supports so many gateways out of the box, and wonder if (a) anyone has already come up with a PHP alternative, or (b) thinks it feasible to attempt a port. Thanks! Cameron Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Something like ActiveMerchant?
I 'll make a git repo in a few days so you can see the source code. @iamcam The code is close to ruby code ( as php 5.2 allows ). Gateways have standard public methods ( authorize, purchase, void etc ). Every response is an Response class object. There is also Creditcard class object, and everything Active Merchant has. Some missing, for now, features are PHPUnit tests and integation form helper. By the way, thinking of naming this project phpMerchant but googling on that i found this link http://code.google.com/p/php-merchant/ It is an Active Merchant like project, but it is inactive for over a year... On Jul 14, 10:15 am, iamcam (Cameron Perry) mistercame...@gmail.com wrote: Bharadwaj, That's the best I could come up with in the PHP world. Unfortunately the PEAR packages look outdated, and the Kohana component is for that framework - not sure how it would work as a stand-alone. There are ports in other languages (python and Objective- C), but that doesn't help us. This is a huge need in the PHP community, even if most the payment gateways already have sample code. It's so much nicer working with consistent interfaces than trying to decipher the intricacies between all the various APIs. ~Cameron On Jul 12, 10:32 pm, Bharadwaj Parthasarathy barbi.br...@gmail.com wrote: +1 for github I am also interested in participating in development. From a quick google search, there seems to be no similar framework in php. You may want to check this -http://stackoverflow.com/questions/2768942/do-any-projects-exist-for-... - Bharadwaj On 12-Jul-10, at 10:23 PM, iamcam (Cameron Perry) wrote: How closely are you following the original ruby version? I'd be interested in helping out here and there once you put it on github (so much better than google). ~Cameron On Jul 9, 4:20 pm, Andreas andreas.kolla...@gmail.com wrote: Hi, I am currently developing a port of Active Merchant on PHP. I 've also add a few gateways for testing such as PaypalExpress, Hsbc, Authorize.net(partial), Centinel 3D secure(partial), and Eurobank(Greek bank). I am planning to make a public repository on github or google project hosting, when i clean the code and add some documentation. I hope this will help php developers to integrate payments api to their eCommerce applications. On Jul 6, 1:51 am, iamcam (Cameron Perry) mistercame...@gmail.com wrote: Has anyone seen anything like ActiveMerchant on the PHP side? I searched around a bit but haven't seen anything. I'm intrigued by the fact that it supports so many gateways out of the box, and wonder if (a) anyone has already come up with a PHP alternative, or (b) thinks it feasible to attempt a port. Thanks! Cameron Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Something like ActiveMerchant?
Hi, I am currently developing a port of Active Merchant on PHP. I 've also add a few gateways for testing such as PaypalExpress, Hsbc, Authorize.net(partial), Centinel 3D secure(partial), and Eurobank(Greek bank). I am planning to make a public repository on github or google project hosting, when i clean the code and add some documentation. I hope this will help php developers to integrate payments api to their eCommerce applications. On Jul 6, 1:51 am, iamcam (Cameron Perry) mistercame...@gmail.com wrote: Has anyone seen anything like ActiveMerchant on the PHP side? I searched around a bit but haven't seen anything. I'm intrigued by the fact that it supports so many gateways out of the box, and wonder if (a) anyone has already come up with a PHP alternative, or (b) thinks it feasible to attempt a port. Thanks! Cameron Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: ajax.updater in cakephp
Thanks! I've kind of found what i was looking for my self. I just removed the layout for the functions inside my controller, so they just return the code for the function itself(not a whole doc...). On Jun 22, 9:59 am, alagar ala...@nm.ru wrote: http://book.cakephp.org/view/212/Methods On Jun 21, 6:05 pm, Petter Andreas Strøm past...@gmail.com wrote: Hi, Im quite new to both ajax and cake, so i have a question regarding the use of ajax.updater in cakephp. Is it possible to use the ajax.updater to just update an html element to contain just one cake function? (in other words; ive tried to give the ajax.updater the url of a cake- function, but then it replaces the element with a whole new page with its own layout etc...) Maybe this is some odd explanation:P Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
ajax.updater in cakephp
Hi, Im quite new to both ajax and cake, so i have a question regarding the use of ajax.updater in cakephp. Is it possible to use the ajax.updater to just update an html element to contain just one cake function? (in other words; ive tried to give the ajax.updater the url of a cake- function, but then it replaces the element with a whole new page with its own layout etc...) Maybe this is some odd explanation:P Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Trailing Slash redirect (SEO) and CakePHP Forms
Hi there! I have a Problem with my App. In my .htaccess, i added some lines to redirect the user if the url ends without a slash to the same page with a slash. For example: redirect /posts/view/2 to /posts/view/2/ Now, I have a form /posts/add/. I use the Cakehelper to create it, and it makes a form action=/posts/add ... tag. If the user now submits the form, he gets redirected since the action says /posts/add and not /posts/add/ and ALL post data get lost :( Found only this post with the same problem: http://groups.google.com/group/cake-php/browse_thread/thread/b98f3ccd0727dba4/721d4f9cf1120e2e?lnk=gstq=canonicalization#721d4f9cf1120e2e Hope anyone can help me with this.. Thanks! Andi Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
$this-Auth-user() - update the data
Hey all! I have a form, where the user can change his data, like first and last name. how can i update the data thats inside $this-Auth-user() after editing the model via the form? i dont want to logout and relogin the user again only to update the session data... is there an elegant way to do so? greets Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: app_controller beforeFilter does not working !
hi, have you declared an beforeFilter() function in your active controller? try to call parent::beforeFilter(); in that function. i hope the pr($this); call is for test purposes only ;) because you dont print anything in your controllers/models greets Andreas DatacenterHellas schrieb: Ok ! ! ! What I do is to call from the controller beforeFilter action the AppController::beforeFilter(); But I don't know if that is ok or If I have to do something else ! ! ! ? ? ? Thanks a lot :) On 30 Ιούλ, 11:05, DatacenterHellas merianosni...@gmail.com wrote: Hello all :) I'm creating my application and I have a litle problem with AppController. I have create on /app/ folder a file named app_controller.php inside this file I have write this code : ?php class AppController extends Controller { var $helpers = array('Html'); function beforeFilter() { pr($this); } } ? but I have not response from it Why 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: Free Cake Ebook : How to build your own blog from scratch
hi, well, in comparison to english, its still to less people who understand that language ;) most open source stuff is written in english, to make it available to all. anyway, thanks for that effort, i'd like to read that ebook, but unfortunately i don't understand malay ;) i would appreciate an international version of that ebook, as there are to less free (e)books out there imho. greets Andreas leop schrieb: i dont think a lot of people are able to read that - or know the language at all i wonder... why not using ENGLISH in the first place? I can only assume you made this comment to raise some hackles. While we're at it why don't we just abolish German (I assume that's your first language)? Malay is the official language in Brunei, Malaysia, Singapore and is native to Malaysia, Indonesia, Thailand. There are also significant communities in Australia Bahrain (source: Wikipedia). There are plenty of tutorials in English and tutorials in other languages are always welcome. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 -~--~~~~--~~--~--~---
Group arrays, possible with Set?
Hi! I've got an array with this structure: Array ( [...] [37] = VideoLAN [38] = VideoLAN\Quick Settings [39] = VideoLAN\Quick Settings\Audio [40] = VideoLAN\Quick Settings\Interface [41] = VideoLAN\Quick Settings\Video [...] ) Now i need it to be grouped together like this: Array ( [...] [n] = Array ( [VideoLAN] = Array ( [Quick Settings] = Array ( [0] = Audio [1] = Interface [2] = Video ) ) ) [...] ) As i'm not that familiar with Set, i ask: is this possible with Set? or do i need to do some funky custom looping or any? :( greets Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cake process sequence
http://book.cakephp.org/view/21/A-Typical-CakePHP-Request greets Andreas lordG schrieb: Hi Guys, Does any know if there is an graph of process flow of how Cake loads itself? This would be really helpful. Thanks. 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 -~--~~~~--~~--~--~---
Onlineshop based on CakePHP
Hi! I have to build an e commerce online shop. Is it a good idea to do it with CakePHP, or should I use something like xt:commerce or others? greets Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth fields loging in with email instead of username
http://book.cakephp.org/complete/172/Authentication#Setting-Auth-Component-Variables-563 greets Andreas cakephp_rocks schrieb: is this possible loging in with email field instead for username field if its how ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth fields loging in with email instead of username
lol... yeah ok, i'll copy and paste the code from the book for you... class UsersController extends AppController { var $components = array('Auth'); function beforeFilter() { $this-Auth-fields = array( 'username' = 'username', 'password' = 'secretword' ); } } change username to email or what ever you want. if you'd followed my link, you'd see the same code... greets Andreas cakephp_rocks schrieb: i couldnt find anything in book thats why i come here for help lol On Jul 22, 2:07 pm, Andreas andreasderk...@arcor.de wrote: http://book.cakephp.org/complete/172/Authentication#Setting-Auth-Comp... greets Andreas cakephp_rocks schrieb: is this possible loging in with email field instead for username field if its how ??- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Locale cakePHP-usersgroup near Cologne / Lokale cakePHP-usersgroup Nähe Köln
Hi, we want to start a local usersgroup here in Cologne, so we are looking for some interested people. Please note, that the following text is therefore written in german: -- Wir entwickeln nun knapp ein Jahr intensiv mit cakePHP und sind nun auf der Suche nach Entwicklern hier in der Umgebung zum Erfahrungs- und Wissensaustausch, Vorstellung eigener Projekte, Forschungen, etc rund um cakePHP. Wir betreiben die Social Comminity Platinnetz (www.platinnetz.de), welche vollständig auf cakePHP gebaut wurde, inkl. aller background- jobs, die mit einer umfangreichen eigenen cake-shell entwickelt wurden. Im Zuge der intensiven Entwicklung konnten wir bereits viel Interna von cake kennenlernen, vieles Nützliche, aber auch einiges Unnütze und auch nicht Verwendbare, sowie gänzlich fehlende Elelmente, was man selber neuschrieb. So haben wir z.B. eine funktionierende MySQL-Master/Slave-Anbindung entwickelt mithilfe einer modifizierten Datasource, die AuthComponent erweitert um den eigenen Passowort-Hash-Mechanismus, eine umfangreiche Cachemechanik und anderes. Dieses Wissen wollen wir nicht im stillen Kämmerchen für uns behalten sondern kundtun, aber auch erfahren, was ihr so gemacht habt. Wer Interesse hat, meldet sich bitte einfach bei uns und wir versuchen mal sowas auf die Beine zu stellen. Schraibt eine Mail an cake...@platinnetz.de Wir freuen uns auf eure Rückmeldung! Schöne Grüße aus Köln, Andreas Hofmann, Olav Schettler Platinnetz GmbH --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: Login authentication
Hi, its much simpler, follow the steps on the cookbook. http://book.cakephp.org/complete/172/Authentication greets Andreas Dhileepen Chakravarthy schrieb: Thanks for your reply. I am new for cakePHP. I find i did a mistake in function validateLogin($data) { $user = $this-find(array('username' = $data['username'], 'password' = $data['password']), array('id', 'username')); if(empty($user) == false) return $user['User']; return false; } how do i wrote my query in this function validateLogin() select username from users where username = $data['username'] and password=$data['password'] Regards, Dhileepen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP Model Join Strategy - Returning mixed Array/Objects finds results
Hi, http://book.cakephp.org/view/474/Containable containable and recursive -1 in your AppModel/AppController is the way to go. greets Andreas Dérico Filho schrieb: Hi, I have a doubt on the future of CakePHP regarding how will it handle joins in future releases. The issue is: When you have several models tied together through hasMany/belongsTo/hasAndBelongsToMany/hasOne, CakePHP will execute the database queries all at once, parse them and organise them into an array. So it'll likely you'll have something such: $users[0] = Array( User = Array(name = My Name, Remark = array(remark = i see it))); or even $remarks[0] = Array( Remarks = array(remark = i see it), User = array(name = My Name)); OK. That's how CakePHP works nowadays. I am not a master in MVC concepts and subtleties, but I wonder it could be a bad thing. You see, one of the main goals of OO programming is that you write code that can be changed. So let's suppose you have a model named User, it'd not be joint to anyone else. You write a whole application using: $this-User-find('all', c); For some wicked reason that shall remain rather vague, you do _not_ specify the recursiveness of these finds, and therefore CakePHP will default it to 1, which brings all model's data and additionally the first degree of joins. As this model has no such degree, it'll return only User's data. Yet this system is not complete, and at some point it demands that a Remark system to be attached to User model. The programmer goes on app/model/User.php and adds a hasMany entry into User, and a belongsTo entry into Remark. Suddenly, according to CakePHP's current logic, ALL finds will return not only User's data but also it'll return all the Remark entries each User has stored. All over the system. You ought to grep the source for $this-User- and write down a $this-User-recursive=0; all over the source code. So far, no news. Here's the catch: Should CakePHP model code return something like: $users[0] = Array( User = Array(name = My Name, Remark = new RemarkSpecialJoinObjectWhichSeeksInformationOnFirstCall($user ['User']['id'])); On the views reading $users and User data only, it'll imply neither a change on memory consumption nor SQL performance, because although User comunicates with Remark, the view would not demand the Remark entries, thus avoiding one database seek. They'd never read the Remark dimension, and therefore the database would never be read too. On the other hand, on the new code which needs both User's and Remark's entries, the object on its own would understand the situation and seek further data. Does anyone know if CakePHP will solve this problem in future releases? Thanks, Dérico Filho --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: Categories with Tree behaviour -- how to pull?
Hi, well what about simply do a find with the category id as a conditions? like: $this-Product-find('all', array('conditions' = array('categorie_id' = $cat_id))); never used the tree behavior, but what about http://book.cakephp.org/view/812/find-threaded ? greets Andreas rchavik schrieb: maybe use $conditions parameter of generatetreelist? http://book.cakephp.org/view/228/Basic-Usage#generatetreelist-517 On Jul 13, 8:07 am, rocket justin...@gmail.com wrote: I have a standard categories, and products, and am using the Tree behvaiour for the Category model. For example I have: +Electronics --- Television -- SONY -- Panasonic --- Computer -- Dell -- Apple I simply want to know how to pull all the inventory from a particular sub-category. Like I want to see all the items in Electronics, or all the items in Computer. Is there a built in function to do this? I couldn't find one. cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: load a CSS file if DEBUG 0
Hi, i do: if( Configure::read('debug')0) echo $html-css('debug'); else ''; in my layouts head. greets Andreas Ernesto schrieb: Hello. i've coded a simple css file that helps me display the Cake's SQL log. this css needs to be loaded only when debug 0. how can i do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: load a CSS file if DEBUG 0
hi, what would be the point of doing so? besides, i think view things belong to the view part of mvc :) greets Andreas Ernesto schrieb: same way i'm using. what about load this css from App_Controller? On 13 Lug, 10:15, Andreas Derksen andreasderk...@arcor.de wrote: Hi, i do: if( Configure::read('debug')0) echo $html-css('debug'); else ''; in my layouts head. greets Andreas Ernesto schrieb: Hello. i've coded a simple css file that helps me display the Cake's SQL log. this css needs to be loaded only when debug 0. how can i do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 Fehler
look for whitespaces in your controller files after the ? Jan Ditze schrieb: Moin Moin, ich fange gerade an eine App mit Cake zu entwickeln. Jedoch bin ich schnell auf einen Fehler gestoßen, den ich mir nicht erklären kann. Wenn ich auf dieser Seite: http://otten.seolize.de/konfigurator/houses/add ein Haus anlege kommt ein Fehler (Ihr seht ihn selbst): Cannot modify header information - headers already sent by (output started at /var/www/vhosts/seolize.de/subdomains/otten/httpdocs/ konfigurator/app/controllers/houses_controller.php:24) [CORE/cake/libs/ controller/controller.php, line 640] Nehme ich diese Zeile aus dem Controller: $this-redirect(array('action' = 'index')); kommt der Fehler nicht. Ich werde dann aber natürlich auch nicht zurückgeleitet. Woran liegt das? Wo ist der Fehler? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: Containable + HABTM + conditions PROBLEM [urgent]
Thanks, but it doesn't work. Gives me this query: SELECT `Module`.`id`, `Module`.`position`, `Module`.`name`, `Module`.`created`, `Module`.`modified` FROM `modules` AS `Module` WHERE `Version`.`name` = 'covermount' and this error: 1054: Unknown column 'Version.name' in 'where clause' On 3 Jul., 20:14, brian bally.z...@gmail.com wrote: Something like this? $modules = $this-Product-Module-find( 'all', array( 'conditions' = array( 'Version.name' = $version ), 'contain' = array( 'Version' = array( 'fields' = array('*') ) ) ) ); On Fri, Jul 3, 2009 at 6:00 AM, Andreas Derksenandreasderk...@arcor.de wrote: Hi all, i got some problems with my habtm containable setup. This is it: Product HABTM Module Module HABTM Version in the Product controller i want to find all modules that belong to an certain version defined in the Version model. this was my approach: $this-Product-id = $id; $this-Product-find('first', array('contain' = array('Module' = array('conditions' = array('Version.name' = $version); but it says: Unknown column 'Version.name' in 'where clause' how do i query it with or without the Containable behavior? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: Containable + HABTM + conditions PROBLEM [urgent]
Well, I think the quick tip from nate about ad.hoc joins ( http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find ) is exactly what I need. I tried it like this: $checklist = $this-Checklist-Product-Module-find('matches', array ( 'model' = 'Version', 'scope' = array('Version.name' = 'short') )); this gives me: SQL Error: 1054: Unknown column 'Module.Version' in 'field list' [CORE \cake\libs\model\datasources\dbo_source.php, line 525] with this sql: Query: SELECT `Module`.`Version`, `Module`.`Array`, `Module`.`id` FROM `modules` AS `Module` WHERE matchesLIMIT 1 why he does an sql like this?! i just copied the code from nates post to my appcontroller... perhaps its easier in normal sql, but as im not an sql professional i wanted to do it the cakeish way.. Thanks for any help... On 6 Jul., 09:31, Andreas D. andreasderk...@arcor.de wrote: Thanks, but it doesn't work. Gives me this query: SELECT `Module`.`id`, `Module`.`position`, `Module`.`name`, `Module`.`created`, `Module`.`modified` FROM `modules` AS `Module` WHERE `Version`.`name` = 'covermount' and this error: 1054: Unknown column 'Version.name' in 'where clause' On 3 Jul., 20:14, brian bally.z...@gmail.com wrote: Something like this? $modules = $this-Product-Module-find( 'all', array( 'conditions' = array( 'Version.name' = $version ), 'contain' = array( 'Version' = array( 'fields' = array('*') ) ) ) ); On Fri, Jul 3, 2009 at 6:00 AM, Andreas Derksenandreasderk...@arcor.de wrote: Hi all, i got some problems with my habtm containable setup. This is it: Product HABTM Module Module HABTM Version in the Product controller i want to find all modules that belong to an certain version defined in the Version model. this was my approach: $this-Product-id = $id; $this-Product-find('first', array('contain' = array('Module' = array('conditions' = array('Version.name' = $version); but it says: Unknown column 'Version.name' in 'where clause' how do i query it with or without the Containable behavior? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 -~--~~~~--~~--~--~---
Containable + HABTM + conditions PROBLEM [urgent]
Hi all, i got some problems with my habtm containable setup. This is it: Product HABTM Module Module HABTM Version in the Product controller i want to find all modules that belong to an certain version defined in the Version model. this was my approach: $this-Product-id = $id; $this-Product-find('first', array('contain' = array('Module' = array('conditions' = array('Version.name' = $version); but it says: Unknown column 'Version.name' in 'where clause' how do i query it with or without the Containable behavior? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: I don't understand this at all
Well, outside cake, those coords were used to determine if the img submit button was clicked... Brendon Kozlowski (Realm) schrieb: Think Google Maps. When you double click on an area in the map to zoom, it needs to know the coordinates on where to zoom. Before all this AJAX goodness, Mapquest did something similar, but required you to reload the entire page - it used this technique. On Jun 25, 6:42 pm, Kyle Decot kdec...@gmail.com wrote: Interesting. I don't know why you would ever need the coordinates of where you clicked the submit button. I decided to just add a method to my AppController to unset those values if they're present. Thanks for the help/info On Jun 25, 6:38 pm, Miles J mileswjohn...@gmail.com wrote: I dont think you can, thats part of HTML not Cake. On Jun 25, 3:20 pm, Kyle Decot kdec...@gmail.com wrote: Oh okay. Well I don't really want or need those so how do I make it so those values aren't included? On Jun 25, 6:17 pm, Miles J mileswjohn...@gmail.com wrote: They x and y are the coordinates where you clicked your mouse on the image. On Jun 25, 3:04 pm, Kyle Decot kdec...@gmail.com wrote: Alright. I have a form and when I submit the form using an image based submit button like ?php echo $form-submit(submit.png); ? two values (x and y) get added to my submitted data so the URL ends up being something like sample.com/?x=40y=30. Each time the x and y values are different. I have no Idea where these values are coming from. If I use a normal submit button like ?php echo $form-submit (submit); ? then the values do not appear. I am baffled by this. Anyone have any idea of what's going on? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 -~--~~~~--~~--~--~---
Input fields prefilled / prechecked depending on database field
Hi! In my view I have something like this: ?php echo $form-create('Model');? ?php echo $form-input('tinyint_field'); ? ?php echo $form-end('Save'); ? Now I want to have it be checked when the corresponding field in the database has the value 1. How can I do this? greets Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: Input fields prefilled / prechecked depending on database field
Oops, accidentally replied to an other discussion :| --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: tableCells and bgcolor doesn't work for me
Hi. why don't you do it with css ? :) .alt{ background-color: #000; } table ?php $i=0; foreach ($autors as $row): ? ?php ($i++%2 == 0)?$class=' class=alt': $class=''; ? tr?php echo $class;? td$row.../td td$row.../td /tr ?php endforeach; ? /table greets Andreas nsens...@hotmail.com schrieb: Hi, new at cakephp, so I'm trying with some tutorials, but using tablecells doesn't work with bgcolor, I get the table with rows and data but all rows are white, I mean odds and even rows are in same color, what I'm doing wrong? table ?php foreach($autors as $row) { echo $html-tableCells( array ( $row['Autor']['id'], $row['Autor']['nombre'], $row['Autor']['apellido'], $row['Autor']['fecha_nacimiento'], $row['Autor']['fecha_defuncion'] ) , array ('bgcolor'='#FFCC99'));} ? /table --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: open $html link in new window
Hi, this should work: ?php echo $html-link('View', /invoices/view/.$invoice['Invoice']['id'], array('target' = '_blank')); ? greets Andreas forrestgump schrieb: Okim not quite able to wrap my head around this one. I have a link that looks like so ?php echo $html-link('View', /invoices/view/.$invoice['Invoice'] ['id']); ? so basically i can open the required invoice from a payments.ctp in an invoices/view.ctp ...but it redirect the windowi was hoping for a way to pop up in a new window... can someone help me with this one i tried using onclick...but that did not work. Thanks in advance, Forrestump --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: Containable recursive find problem
Hi Wilson, thats how my query looks like: $checklist = $this-Checklist-find('first', array('conditions' = array('Checklist.id' = $id), 'contain' = array( 'Product' = array( 'fields' = array('id', 'name', 'name_short', 'year'), 'conditions' = '', 'Module.name' = array( 'Subject.description' = array( 'Check.check' ) ) ), 'Check', 'Language.lang_short', 'Language.name', 'OperatingSystem.name', 'User.name', 'User.email'))); Hope that helps :) greets Andreas Wilson schrieb: Hi Andreas, I'm trying to this same thing, but without success. Do you mind pasting your find logic here? On Jun 12, 9:20 am, Andreas Derksen andreasderk...@arcor.de wrote: Thanks, Works fine! Thought to complicated... :-) Containable behavior is really nice ;-) greets Andreas Martin Westin schrieb: You just go: 'contain' = array( 'Product' = array( 'conditions' = array('Product.id' = $productId), 'Module' = array( 'Subject' ) ), 'Check' ) That is: in contain you simply name the nearest associates and in each of those you name furhter associates to return. On Jun 12, 2:02 pm, Andreas Derksen andreasderk...@arcor.de wrote: Hi, im currently developing a checklist application witch has the following Models and relations: Checklist belongsTo Product Checklist hasMany Check Product HABTM Module Module hasMany Subjects Subject belongsTo Module So, what i want to do now is to generate tables like this:Checklist ID 2Module 1Subject 1Subject 2Subject 3Subject 4Module 2Subject 1Subject 2Subject 3Subject 4 I tried to query it like this: $this-Checklist-find('first', array('contain' = array( 'Product' = array('conditions' = array('Product.id' = $productId)), 'Check' ))); the result is:Array ( [Checklist] = Array ( [id] = 1 [product_id] = 1 ) [Product] = Array ( [id] = 1 [name] = Product1 ) [Check] = Array ( [0] = Array ( [id] = 1 [check] = true [checklist_id] = 1 [subject_id] = 1 ) ) )Now I need the Product array recursive, means: the associated Module(s) and the Subject(s) associated to the Module(s). A $this-Checklist-find('first', array('recursive' = 2, 'conditions' = array('id' = $checklistId))); returns everything I need, ... and more. thats the problem. How can I do that? Thanks in advance Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with CSS Rollover Links
Lol, please quote the parts where i was ugly to him. I just gave him an advice AND helped him with his problem! I was constructive, not like you. Please don't bother me..thx greets Andreas red mcgee schrieb: Re: Andreas: that's a foul way to respond to someone. please don't browse the forums looking for others to belittle. the users here are merely looking for support - not criticism. how ugly of you... On Jun 12, 12:21 pm, Andreas andreasderk...@arcor.de wrote: Hi, well i think you first need to learn the basics. e.g.: html + css before proceeding to php (cake not to mention). besides, its called hover, not rollover. But anyway, to help you with that problem (maybe i missunderstood it ...), this is how you make a button wich changes the image when the mouse is over it: Viewcode: ?php echo $html-link('Home', blog/index/, array('id' = 'homebtn')); ? ?php echo $html-link('Best Postings', blog/bestof/, array('id' = 'best')); ? CSS: a#homebtn { background: transparent url(path/to/button/img.png) 0 0 no-repeat); float: left; } a#homebtn:hover { background: transparent url(path/to/hover/img.png) 0 0 no-repeat; float: left; } hope that helps. greets Andreas DbZeroOne schrieb: Ok, good advice from both of you. This is what my code looks like now: ?php echo $html-link('',array('controller'='blog','action' = 'index'),array('ID' = 'homebtn','alt' = 'Home')); echo $html-link('',array('controller'='blog','action' = 'bestof'),array('ID' = 'best', ,'alt' = 'Best Postings')); ? This should be one button to the right of the other.There will be 5 total in a horizontal menu. The problem now is that only one button will work at a time (link and rollover). Either one will work when they're alone, but together, only the first one will work (whichever one is first). I've tried everything I can think of, but either nothing changes or the whole page blanks out. Thank you for your input. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: New To cakephp
Hi Netram, please read the Cookbook at least once, it will really help you in the future. There is also the installation manual in there. Follow this link: http://book.cakephp.org/ greets Andreas Netram Dhakar schrieb: Hi, I am new with CakePHP.How to install and configure. Please help me. Thanks Regards Netram dhakar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 have dynamic actions
Hi Steve, why dont you just pass the group_id as a parameter to the index action? Like: www.mydomain.com/videos/index/groupname2 greets Andreas Steve schrieb: I'm trying to determine the best way to have dynamic actions but hopefully the community can help. What I mean by dynamic actions is that many actions like /posts/ index/, /videos/index/, are all dependent on the variable group_id. In other words, those actions are only supposed to list all posts, videos, etc belonging to a specific group. What's the best way to do this so the URLs are consistent? I would think that doing something like this is a good approach. : www.mydomain.com/group/groupname1/posts/index/ www.mydomain.com/group/groupname1/videos/index/ www.mydomain.com/group/groupname2/posts/index/ www.mydomain.com/group/groupname3/posts/index/ This would require some modication of routes.php ... it would also be great if the following link would act as a dashboard for the particular group: www.mydomain.com/group/groupname1/posts/index/ Any other suggestions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 -~--~~~~--~~--~--~---
Containable recursive find problem
Hi, im currently developing a checklist application witch has the following Models and relations: Checklist belongsTo Product Checklist hasMany Check Product HABTM Module Module hasMany Subjects Subject belongsTo Module So, what i want to do now is to generate tables like this: Checklist ID 2 Module 1 Subject 1 Subject 2 Subject 3 Subject 4 Module 2 Subject 1 Subject 2 Subject 3 Subject 4 I tried to query it like this: $this-Checklist-find('first', array('contain' = array( 'Product' = array('conditions' = array('Product.id' = $productId)), 'Check' ))); the result is: Array ( [Checklist] = Array ( [id] = 1 [product_id] = 1 ) [Product] = Array ( [id] = 1 [name] = Product1 ) [Check] = Array ( [0] = Array ( [id] = 1 [check] = true [checklist_id] = 1 [subject_id] = 1 ) ) ) Now I need the Product array recursive, means: the associated Module(s) and the Subject(s) associated to the Module(s). A $this-Checklist-find('first', array('recursive' = 2, 'conditions' = array('id' = $checklistId))); returns everything I need, ... and more. thats the problem. How can I do that? Thanks in advance Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: Containable recursive find problem
Thanks, Works fine! Thought to complicated... :-) Containable behavior is really nice ;-) greets Andreas Martin Westin schrieb: You just go: 'contain' = array( 'Product' = array( 'conditions' = array('Product.id' = $productId), 'Module' = array( 'Subject' ) ), 'Check' ) That is: in contain you simply name the nearest associates and in each of those you name furhter associates to return. On Jun 12, 2:02 pm, Andreas Derksen andreasderk...@arcor.de wrote: Hi, im currently developing a checklist application witch has the following Models and relations: Checklist belongsTo Product Checklist hasMany Check Product HABTM Module Module hasMany Subjects Subject belongsTo Module So, what i want to do now is to generate tables like this:Checklist ID 2Module 1Subject 1Subject 2Subject 3Subject 4Module 2Subject 1Subject 2Subject 3Subject 4 I tried to query it like this: $this-Checklist-find('first', array('contain' = array( 'Product' = array('conditions' = array('Product.id' = $productId)), 'Check' ))); the result is:Array ( [Checklist] = Array ( [id] = 1 [product_id] = 1 ) [Product] = Array ( [id] = 1 [name] = Product1 ) [Check] = Array ( [0] = Array ( [id] = 1 [check] = true [checklist_id] = 1 [subject_id] = 1 ) ) )Now I need the Product array recursive, means: the associated Module(s) and the Subject(s) associated to the Module(s). A $this-Checklist-find('first', array('recursive' = 2, 'conditions' = array('id' = $checklistId))); returns everything I need, ... and more. thats the problem. How can I do that? Thanks in advance Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help with CSS Rollover Links
Hi, well i think you first need to learn the basics. e.g.: html + css before proceeding to php (cake not to mention). besides, its called hover, not rollover. But anyway, to help you with that problem (maybe i missunderstood it ...), this is how you make a button wich changes the image when the mouse is over it: Viewcode: ?php echo $html-link('Home', blog/index/, array('id' = 'homebtn')); ? ?php echo $html-link('Best Postings', blog/bestof/, array('id' = 'best')); ? CSS: a#homebtn { background: transparent url(path/to/button/img.png) 0 0 no-repeat); float: left; } a#homebtn:hover { background: transparent url(path/to/hover/img.png) 0 0 no-repeat; float: left; } hope that helps. greets Andreas DbZeroOne schrieb: Ok, good advice from both of you. This is what my code looks like now: ?php echo $html-link('',array('controller'='blog','action' = 'index'),array('ID' = 'homebtn','alt' = 'Home')); echo $html-link('',array('controller'='blog','action' = 'bestof'),array('ID' = 'best', ,'alt' = 'Best Postings')); ? This should be one button to the right of the other.There will be 5 total in a horizontal menu. The problem now is that only one button will work at a time (link and rollover). Either one will work when they're alone, but together, only the first one will work (whichever one is first). I've tried everything I can think of, but either nothing changes or the whole page blanks out. Thank you for your input. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: where did u go?
You can do Configure::write(); anywhere in you app... I do it like this: $debugLevel = Configure::read('debug'); Configure::write('debug', 0); [...] //your code Configure::write('debug', $debugLevel); greets A RhythmicDevil schrieb: Solved this. The problem was that I had Configure::write('debug', 3); so there was all sort of extra junk in the response. When I set it to 0 it works fine. Now I just to figure out how to get debug when I need it without juggling the config file. On Jun 10, 1:44 pm, RhythmicDevil rhythmicde...@gmail.com wrote: nope not the Bosstones' song but my AJAX response. I have a button on the page. Clicking the button invokes the following jQuery function: $('#refresh_sub').click(function() { console.log('Start'); // Add the content to the dialog $.post(/subscribers/refresh_sub, '', function(data){ console.log('Finish'); populate_dialog(data); $(#confirm_dialog).dialog('option', 'buttons', { 'OK': function() { $(#confirm_dialog).dialog('close') } }); $('#confirm_dialog').dialog('open'); }, 'json'); }); Which in turn invokes the following PHP method in my Subscribers Controller: public function refresh_sub($id = null) { /* * PerformSubOp * SubscriberId subscriber_id /SubscriberId * Operation operation /Operation * /PerformSubOp */ $this-layout = 'ajax'; $operation = $this-data['operation']; $id = $this-data['Subscriber']['SubscriberId']; $this-TransactionParams['transaction']['id'] . $operation; $this-TransactionParams['transaction'] ['TransactionCommandList']['TransactionCommand']['PerformSubOp'] ['SubscriberId'] = $id; $this-TransactionParams['transaction'] ['TransactionCommandList']['TransactionCommand']['PerformSubOp'] ['Operation'] = $operation; $result = $this-Subscriber-query('SendTransaction', $this- TransactionParams); $this-set('response', json_encode( array ('title'='Success', 'message'='Message content', 'level'='Success'))); } The view then does this: ?php echo $response; ? Pretty standard stuff. However my jQuery function never gets the data back. If you look you will see I have two console.log() calls the jQuery function. The first one fires but the second does not. I know that the json data is being returned because I can see it in the HTTP response in Firebug. This basic transaction works in my custom framework. But I am moving over to Cake and I am wondering where I went wrong. Thanks for any help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: hasMany problem (SOLVED)
Ok, I did one mistake... Jointables need to be defined in alphabetical order... that confused the whole application. so after defining a modules_products table instead of the products_modules table i got all the data right... just in case anyone runs into the same problem. greets Andreas Andreas D. schrieb: Hello all together, i'm currently developing a checklist application. I got problems linking the models together right now.. I got one Checklist model which belongsTo a User, Language, OperatingSystem, Product. My User hasMany Checklist. Now I want to fetch all User related checklists through the UsersController. So when I do a $this-User-find('first', array ('conditions' = array('id' = $id))); I get only the checklists language_id's, operating_system_id's ... how do i get the Language.name fields? here is the full output: Array ( [User] = Array ( [id] = 1 [name] = Testname [email] = testn...@test.de [created] = 2009-05-15 12:44:30 [modified] = ) [Checklist] = Array ( [0] = Array ( [id] = 1 [user_id] = 1 [language_id] = 2 [operating_system_id] = 1 [product_id] = 1 [component_string] = [created] = 2009-05-15 14:07:16 [modified] = ) [1] = Array ( [id] = 2 [user_id] = 1 [language_id] = 3 [operating_system_id] = 3 [product_id] = 4 [component_string] = [created] = 2009-05-15 14:56:33 [modified] = ) ) ) So long, Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 -~--~~~~--~~--~--~---
hasMany problem
Hello all together, i'm currently developing a checklist application. I got problems linking the models together right now.. I got one Checklist model which belongsTo a User, Language, OperatingSystem, Product. My User hasMany Checklist. Now I want to fetch all User related checklists through the UsersController. So when I do a $this-User-find('first', array ('conditions' = array('id' = $id))); I get only the checklists language_id's, operating_system_id's ... how do i get the Language.name fields? here is the full output: Array ( [User] = Array ( [id] = 1 [name] = Testname [email] = testn...@test.de [created] = 2009-05-15 12:44:30 [modified] = ) [Checklist] = Array ( [0] = Array ( [id] = 1 [user_id] = 1 [language_id] = 2 [operating_system_id] = 1 [product_id] = 1 [component_string] = [created] = 2009-05-15 14:07:16 [modified] = ) [1] = Array ( [id] = 2 [user_id] = 1 [language_id] = 3 [operating_system_id] = 3 [product_id] = 4 [component_string] = [created] = 2009-05-15 14:56:33 [modified] = ) ) ) So long, Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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: Persistent model to true - Fatal error
[...]Please ensure that the class definition *_quot;Albunsquot;_* of the object you are trying to operate on was loaded _before_ unserialize()[...] hmm maybe Album, not Albun? :-) pauloamgomes schrieb: Using ClassRegistry and CakePHP 1.2.2.8120. Regards. On Jun 2, 3:57 pm, jperras joel.per...@gmail.com wrote: Are you using the ClassRegistry or manually importing classes (specifically Models) using App::import anywhere ? What version of CakePHP are you running? -j. pauloamgomes wrote: Hi all, when i activate persistent model to true in my application, it breaks my models, I'm getting the following fatal errors: Fatal error: PhotosController::index() [a href='http://php.net/ photoscontroller.index'photoscontroller.index/a]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition quot;Albunsquot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /Volumes/Data/paulogomes/www/pg/controllers/ photos_controller.php on line 32 --- Fatal error: BehaviorCollection::trigger() [a href='http://php.net/ behaviorcollection.trigger'behaviorcollection.trigger/a]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition quot;ExtendAssociationsBehaviorquot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /Volumes/Data/ paulogomes/www/cake/libs/model/behavior.php on line 456 --- Fatal error: ResourcesController::index() [a href='http://php.net/ resourcescontroller.index'resourcescontroller.index/a]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition quot;Typesquot; of the object you are trying to operate on was loaded _before_ unserialize () gets called or provide a __autoload() function to load the class definition in /Volumes/Data/paulogomes/www/pg/controllers/ resources_controller.php on line 29 the error only occurs on second call of controller, after persistent cache files created on tmp. I'm using cakephp 1.2 running on leopard with php 5.2.6. Any ideas? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-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 Question
$this-redirect($this-referer()); greets Andreas cakephp_rocks schrieb: $this-redirect(array('controller' = 'posts', 'action' = 'comment')); is there anyway i could put $this-redirect(posts/comment/ $post['Post']['id'] )); whats a good sloution to do that i want my user to comment and redirect back to there post the commented --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth problem: Page refresh or multiple page loads lead to logout
Wow, setting the Variable Security.level to medium definetly did the trick!! Great! Thank you, Dr. Loboto. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 -~--~~~~--~~--~--~---
Auth problem: Page refresh or multiple page loads lead to logout
Hello, I have some issues with two CakePHP (current stable version) applications regarding Auth. When a user is logged in and loads multiple pages simultaneously, he gets logged out. This happens for example when he follows a hyperlink while the page is still loading or if he hits F5 twice. Furthermore, the user receives the message: You are not authorized to access that location. This is the code from my App_Controller: function beforeFilter(){ Configure::load('settings'); // My application configuration $this-Auth-loginAction = array('controller' = 'users', 'action' = 'login'); $this-Auth-autoRedirect = false; $this-Auth-loginError = Configure::read('Auth.LoginError'); $this-Auth-authError = Configure::read('Auth.AuthError'); $this-Auth-authorize = 'controller'; } function isAuthorized() { return true; // For testing! } It seems that the app cannot process multiple requests in the same session at the same time. But it should, to my view.. :-) Does somebody of you have a clue, why this could happen or where to start searching? Thanks and greetings from Kiel/Germany, Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 -~--~~~~--~~--~--~---
Master / Slave Support
Hi all, we have discovered a way how to realize master/slave support with cake (also with multiple slaves). This old post is completely depricated: http://groups.google.com/group/cake-php/browse_thread/thread/58ea010f930fab6c Because Model::find() and Model::save() create the $db-handle lines before it calles the callbacks 'beforeFind' and 'beforeSave'. The way we realized is to overwrite the save() and updateAll() methodes and to set the default db-config in the AppModel::__construct (). Note: One thing remains: It's not possible to do a bindModel in the 'beforeSave' and 'afterSave' callbacks, because they get the wrong db- config... If you find a way to do it, please let us know! 1. Define your Database-Configs in app/config/database.php. You should have master and as much slaves you want to have: class DATABASE_CONFIG { var $master = array( driver' = 'mysql', 'persistent' = false, 'host' = 'localhost', 'login' = 'login', 'password' = 'password', 'database' = 'database', 'encoding' = 'utf8' ); // Config for Slave #1 var $slave1 = array( driver' = 'mysql', 'persistent' = false, 'host' = 'slave1', 'login' = 'login', 'password' = 'password', 'database' = 'database', 'encoding' = 'utf8' ); // Config for Slave #2 var $slave2 = array( driver' = 'mysql', 'persistent' = false, 'host' = 'slave2', 'login' = 'login', 'password' = 'password', 'database' = 'database', 'encoding' = 'utf8' ); ... } 2. Create/Alter app/models/app_model.php and create/alter the constructor '__construct' of it like the following: class AppModel extends Model { public function __construct($id = false, $table = null, $ds = null) { /** * USED FOR MASTER/SLAVE MECHANIC * **/ // If a datasource is set via params, use it and return if((is_array($id) isset($id['ds'])) || $ds) { parent::__construct($id, $table, $ds); return; } // Use a static variable, to only use one connection per page-call (otherwise we would get a new handle every time a Model is created) static $_useDbConfig; if(!isset($_useDbConfig)) { // Get all available database-configs $sources_list = ConnectionManager::enumConnectionObjects(); // Find the slaves we have $slaves = array(); foreach($sources_list as $name = $values) { // Slaves have to be named slave1, slave2, etc... if(preg_match('/^slave[0-9]+$/i', $name) == 1) { $slaves[] = $name; } } // Randomly use a slave $_useDbConfig = $slaves[rand(0, count($slaves) - 1)]; $this-_usedSlave = $_useDbConfig; } $this-useDbConfig = $_useDbConfig; parent::__construct($id, $table, $ds); } ... } This method uses a local static variable to save the db-config application-wide. It collects all configs from the database.php that start with slave# and selects a random one for it. This is now the default-config for the application that is used with every query done via the Model-class UNTIL we do the next step: 3. We now overwrite the Model::save() and Model::find() methods to use another database-config for write-queries! Note: We discovered, that it's not enough to just overwrite Model::save (), because Model::updateAll() doesn't use the callbacks, neither the Model::save() method. function save($data = null, $validate = true, $fieldList = array()) { // Remember the old config $oldDb = $this-useDbConfig; // Set the new config $this-setDataSource('master'); // Call the original Model::save() method $return = parent::save($data, $validate, $fieldList); // Reset the config/datasource $this-setDataSource($oldDb); return $return; } function updateAll($fields, $conditions = true) { $oldDb = $this-useDbConfig; $this-setDataSource('master'); $return = parent::updateAll($fields, $conditions); $this-setDataSource($oldDb); return $return; } Now you should have full master/slave support within your cake- application. The way it works: When your application is called, the AppModel will be called the first time and realizes, that the local $_useDbConfig variable is not set. So it randomly selects one of your slave-configs and sets this to the default used database-config (AppModel::useDbConfig). Every further instance of AppModel will recognize that the local $_useDbConfig variable already exists and will use the same config. Now every query you do will use this slave-config, EXCEPT all save's and updateAll's, because you've overwritten these methods to use your master-config. Hope this tutorial was helpful to you! Greetings, Andreas Hofmann! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com
URL Paths on Dedicated Server
Hi, I just uploaded my baked test application from a local Xampp environment to my webserver. First, I have to say that mod_rewrite works fine on my webserver. Anyway, now I have some problems with the correct displaying of links, css files, js scripts, etc. If I call my application via www.myurl.com/cakephp/controller/ everything works fine. My example css file is correctly included '/ cakephp/css/style.css' If I call my application via www.myurl.com/cakephp/controller/action, the links, css files etc. are displayed wrong. My example css file now would be included '/cakephp/app/webroot/controller/css/style.css' What do I have to change? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. 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 -~--~~~~--~~--~--~---
Getting route-URL for internal controller/action-URL
Hi all, i discovered the whole Router-class-definition, but I found no method, that matches my needs :) Is there any way to get the URL of a defined route for an internal cake-controller/action-URL. For example I have this route defined: Router::connect('/gruppen', array('controller' = 'groups', 'action' = 'index')); Is there now a way to get this defined URL ('/gruppen') by calling a function with the params controller/action, like this: Router::theMagicMethodThatMustExist( array( 'controller' = 'groups' 'action' = 'index' ) ); // Should now return '/gruppen' With this I can undock the URLs from the templates/views! Currently I'm doing stuff like this in a view: $html-link('A Link', '/groups/index'); But this sucks, because when I define a route for '/groups/index', I don't want to change the URL in 1000 view-files and replace '/groups/ index' with '/gruppen' :S Would be nice if there is a method I'm looking for, to always get a defined route-URL, if there is one! :) Is there such a method out there?? Thanks and greetings, Andreas! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Getting route-URL for internal controller/action-URL
Ah, I remember the word for this thing I'm looking for: A Lookup :P On 9 Okt., 10:23, Andreas Hofmann [EMAIL PROTECTED] wrote: Hi all, i discovered the whole Router-class-definition, but I found no method, that matches my needs :) Is there any way to get the URL of a defined route for an internal cake-controller/action-URL. For example I have this route defined: Router::connect('/gruppen', array('controller' = 'groups', 'action' = 'index')); Is there now a way to get this defined URL ('/gruppen') by calling a function with the params controller/action, like this: Router::theMagicMethodThatMustExist( array( 'controller' = 'groups' 'action' = 'index' ) ); // Should now return '/gruppen' With this I can undock the URLs from the templates/views! Currently I'm doing stuff like this in a view: $html-link('A Link', '/groups/index'); But this sucks, because when I define a route for '/groups/index', I don't want to change the URL in 1000 view-files and replace '/groups/ index' with '/gruppen' :S Would be nice if there is a method I'm looking for, to always get a defined route-URL, if there is one! :) Is there such a method out there?? Thanks and greetings, Andreas! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Getting route-URL for internal controller/action-URL
Ah yeah, works!! Cool, thx! I tried Router::url() before, but with the URl as a string. with an array of controller/action it works like expected!! Thanks again!! On 9 Okt., 10:53, David C. Zentgraf [EMAIL PROTECTED] wrote: I believe what you're looking for is $html-url() or, more direct, Router::url().http://api.cakephp.org/class_router.html#a34cdc409ebe46302682fb8c242c... Also, you should lookup URLs with an array like array('controller' = 'groups', 'action' = 'something') instead of /groups/something. Seems more reliable for reverse lookups in my experience. On 9 Oct 2008, at 17:23, Andreas Hofmann wrote: Hi all, i discovered the whole Router-class-definition, but I found no method, that matches my needs :) Is there any way to get the URL of a defined route for an internal cake-controller/action-URL. For example I have this route defined: Router::connect('/gruppen', array('controller' = 'groups', 'action' = 'index')); Is there now a way to get this defined URL ('/gruppen') by calling a function with the params controller/action, like this: Router::theMagicMethodThatMustExist( array( 'controller' = 'groups' 'action' = 'index' ) ); // Should now return '/gruppen' With this I can undock the URLs from the templates/views! Currently I'm doing stuff like this in a view: $html-link('A Link', '/groups/index'); But this sucks, because when I define a route for '/groups/index', I don't want to change the URL in 1000 view-files and replace '/groups/ index' with '/gruppen' :S Would be nice if there is a method I'm looking for, to always get a defined route-URL, if there is one! :) Is there such a method out there?? Thanks and greetings, Andreas! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Related Model returns empty array
Hi, I'm not sure if this is a bug, or I'm just blind... I've developed some apps in cakePHP already, but I can't find the reason for this problem. I have a Gallery and a User Model. When fetching a Gallery, the User array is empty (It should contain the fields specified in the belongsTo-Relation). Here's the gallery model: class Gallery extends AppModel { public $name = 'Gallery'; public $primaryKey = 'gallery_id'; public $hasMany = array( 'Images' = array( 'className' = 'GalleryImage', 'foreignKey' = 'gallery_id' ) ); public $belongsTo = array( 'User' = array( 'className' = 'User', 'foreignKey' = 'user_id', 'fields' = array( 'User.user_id', 'User.first_name', 'User.last_name' ) ) ); } When doing a find(): $this-Gallery-find( array( 'Gallery.gallery_id' = $gallery_id ), array( 'Gallery.gallery_id', 'Gallery.title', 'Gallery.description', 'Gallery.created' ), array(), 2 ); The afterFind()-Method in the User-Model contains an empty results- Array: array(1) { [0]= array(1) { [User]= array(0) { } } } It seems, that cake build up the array, but had no fields to fetch. I have the same belongsTo in another model and there it works (= fetches the fields specified in the belongsTo-Relation). I've commented out all afterFinds()'s I have in this Model and the other, but it didn't help. Does anyone have an idea what this could be? Is it a (known?) bug? Thanks for your help and greetings, Andy! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: l10n - passing variables to _()
Hi, just user sprintf() (or printf()): In your View: printf(__(age_old, true), 55); In your .po: msgid age_old msgstr I am %d years old Look at http://de.php.net/sprintf for further information. Best regards Andreas On 30 Aug., 18:13, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is there any way to pass variables inside as call to _() so I can maintain context for the .po file translator, or do I have to do it with multiple calls? i.e. _(age_old, array('age' = 55)) msgid age msgstr i am {0} years old output: i am 55 years old Or do I have to do this... _(age) . 55 . __(years) msgid age msgstr i am msgid years msgstr years old output: i am 55 years old --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do you specify custom properties in a CakePHP model?
On 28 Aug., 22:14, trustfundbaby [EMAIL PROTECTED] wrote: At the risk of repeating myself, I am looking for something that works the same way as virtual attributes in rails. the right direction? As far as i know there is no such thing in CakePHP. The closest thing I could imagine is to use a afterFind-callback to inject the attribute to the returned array... Regards Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Loading a component with App::import() doesn't work
Hi all! I'm using cake 1.2.0.7296 RC2 and was now rewriting my code. When I try to import a component aith App::import, it seems not be loaded/started up: public function __construct() { parent::__construct(); App::import('component', 'Auth'); } Results in: Undefined property: GameController::$Auth Even loading it directly in the action method or globally in the App- Controller doesn't work. Do you know this problem? Greetings, Andreas! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Looking for a Cake PHP freelancer
what kind of site is it? On May 24, 10:32 am, Novice Programmer [EMAIL PROTECTED] wrote: Hello, I am looking for a cake php freelancer, who can work directly with me on a site which already is almost say 20% complete. Please contact me directly(lets not spam the group), if you are interested. -- Thanks Regards, Novice (http://ishuonweb.wordpress.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Pages without the pages in the URL
Hi, an easy way would be to go to your app/config/routes.php and add a rule like: Router::connect('/about', array('controller' = 'pages', 'action' = 'about')); (This is code for cake 1.2, in the stable release it's something like $route-connect() i guess). And in the helper: $html-link('...', '/about'); Andreas On 5 Mai, 07:03, basstech [EMAIL PROTECTED] wrote: Is there an easy way to configure my CakePHP app to construct URLs without the pages/ part in it? For example, if I use the HtmlHelper like so: $html-link('About Me', 'about', null, false, false); Right now, CakePHP constructs the URL http://domain.name/pages/ about/. I would like this behavior to instead construct the URL http://domain.name/about/;. Is there an easy way to do accomplish this? I know that there is a workaround to this by making an AboutModel and AboutController that could respond to this, however I would like to use the built in PagesController functionality rather than write a new MVC for each page. Thanks CJ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake 1.2 Session Write
Hi Stefan, I think it's not a good idea to write Session-data in the viewsanyway: In the SessionHelper write() overrides CakeSession:write() and disables it, so copy the SessionHelper from /cake/libs/view/helpers/ session.php to app/view/helpers. Now edit the file and delete the write() function (you could also edit the SessionHelper in /cake/libs directly but I personally never touch the files in /cake/libs ;-) ) Another solution is just to skip the SessionHelper and write to the $_SESSION array directly. I wouldn't recommend either. (sorry for my english, I'm not used to it) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Post data array to html id
Hi I got a regular post data array in one of my controllers in which I need to get out the information in the same format as the id in the html. For example. I might have an array like this. array('Page' = array('subject' = 'test')); The string i need to get out then would be this. PageSubject Note that it's always just one field, never more. Any ideas on how to implement it? Thanks for all input :) Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Field invalidated but not error text showing up
Hi I'm trying to invalidate a field in a form with Model::invalidate. It works partially, it doesn't continue saving but the error message I've defined in my $validate doesn't show up. I read somewhere here in the group that his just marks the field as invalid for saves not for the form helper. Is that true and how do i make the form helper recognize it? Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Field invalidated but not error text showing up
Sorry about the misspelling in the subject. On Jan 19, 9:50 pm, Andreas [EMAIL PROTECTED] wrote: Hi I'm trying to invalidate a field in a form with Model::invalidate. It works partially, it doesn't continue saving but the error message I've defined in my $validate doesn't show up. I read somewhere here in the group that his just marks the field as invalid for saves not for the form helper. Is that true and how do i make the form helper recognize it? Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Storing user group in appmodel?
Care to elaborate the session part? Didn't get that. On Jan 18, 2:38 pm, francky06l [EMAIL PROTECTED] wrote: You coul declare a static variable in appModel, and update it from session in beforeFilter ... just a hint .. hth On Jan 18, 2:25 pm, Andreas [EMAIL PROTECTED] wrote: Hi I've been using a variable in my appcontrol that stores what group the user belongs to based on previous acl things done in the script. The thing is that now I need the information in one of my models for validation. Should i store the information in appmodel instead or is there any other good solution on this? Is it possible (and a good idea?) to store the information in Auth? Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Storing user group in appmodel?
Ah. Understand now. However I don't save it in sessions. But the above easy to modify for my needs. Thanks for the help! Andreas On Jan 18, 4:12 pm, francky06l [EMAIL PROTECTED] wrote: Well if you you set in AppModel : static usergroup = null; function store($group) { self::$usergroup = $group; } function getgroup() { return self::$usergroup; } in AppController ( suppoisng you store the group in the Session), you can do function beforeFilter() { if(isset($this-{$this-modelClass}) /* thank AD for this */ $this-{$this-modelClass}-store($this-Session- ('whereismygroup'); } now in any model $currentgroup= $this-getgroup(); Maybe you have to check values before storing etc ... but that the idea hth On Jan 18, 3:37 pm, Andreas [EMAIL PROTECTED] wrote: Care to elaborate the session part? Didn't get that. On Jan 18, 2:38 pm, francky06l [EMAIL PROTECTED] wrote: You coul declare a static variable in appModel, and update it from session in beforeFilter ... just a hint .. hth On Jan 18, 2:25 pm, Andreas [EMAIL PROTECTED] wrote: Hi I've been using a variable in my appcontrol that stores what group the user belongs to based on previous acl things done in the script. The thing is that now I need the information in one of my models for validation. Should i store the information in appmodel instead or is there any other good solution on this? Is it possible (and a good idea?) to store the information in Auth? Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Storing user group in appmodel?
Hi I've been using a variable in my appcontrol that stores what group the user belongs to based on previous acl things done in the script. The thing is that now I need the information in one of my models for validation. Should i store the information in appmodel instead or is there any other good solution on this? Is it possible (and a good idea?) to store the information in Auth? Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Acl-check without alias?
It worked perfectly! Thanks a lot On 10 Jan, 16:26, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Pass array('foreign_key' = $id, 'model' = 'Post') as the aco to check(). On Jan 9, 2008 11:48 AM, Andreas [EMAIL PROTECTED] wrote: Hi, bit new to ACL and having some problems when I want to check for permissions before deleting a post using the ACL setup from http://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x. Is it possible to check permissions using the foreign_key if no alias is present? In the Post/view action I have the following check: if(@$this-Acl-check('User::'.$this-Session- read('Auth.User.id'),'User::'.$post[0]['Post']['user_id'],'*')){ $this-set('owner',true); } else{ $this-set('owner',false); } if true a link is displayed in the view to the Post/delete action which looks like this function delete($id = null) { if ($id == null) { // Error exit; } if ($this-Acl-check('User::'.$this-Session- read('Auth.User.id'), $id, 'delete')) { $this-flash('allowed','/post/view/'.$id); } else { $this-flash('denied','/post/view/'.$id); } } the $id is the same as the foreign_key in the ACO table, the alias column is blank for posts so how to I perform the check without an alias? The code for saving a post looks like this if($this-Post-save($this-data)) { // ACL $aroNode = array( 'model' = 'User', 'foreign_key' = $id ); $acoNode = array( 'model' = 'Post', 'foreign_key' = $this-Post- getLastInsertID(), // 'alias' = 'Post::'.$this-Post- getLastInsertID() ); $this-Acl-allow($aroNode,$acoNode,'*'); } the out-commented line is my attempt to save an alias as well but it didn't work... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Acl-check without alias?
Hi, bit new to ACL and having some problems when I want to check for permissions before deleting a post using the ACL setup from http://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x. Is it possible to check permissions using the foreign_key if no alias is present? In the Post/view action I have the following check: if(@$this-Acl-check('User::'.$this-Session- read('Auth.User.id'),'User::'.$post[0]['Post']['user_id'],'*')){ $this-set('owner',true); } else{ $this-set('owner',false); } if true a link is displayed in the view to the Post/delete action which looks like this function delete($id = null) { if ($id == null) { // Error exit; } if ($this-Acl-check('User::'.$this-Session- read('Auth.User.id'), $id, 'delete')) { $this-flash('allowed','/post/view/'.$id); } else { $this-flash('denied','/post/view/'.$id); } } the $id is the same as the foreign_key in the ACO table, the alias column is blank for posts so how to I perform the check without an alias? The code for saving a post looks like this if($this-Post-save($this-data)) { // ACL $aroNode = array( 'model' = 'User', 'foreign_key' = $id ); $acoNode = array( 'model' = 'Post', 'foreign_key' = $this-Post- getLastInsertID(), // 'alias' = 'Post::'.$this-Post- getLastInsertID() ); $this-Acl-allow($aroNode,$acoNode,'*'); } the out-commented line is my attempt to save an alias as well but it didn't work... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem adding ACO and ARO
Hi, I've followed the tutorial at http://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x and ran in to some problems. Signing up a new user is working fine, both ACO and ARO are created, but when trying to add a new post I get: Warning (512): AclNode::node() - Couldn't find Aco node identified by Array ( [Aco0.model] = Post [Aco0.foreign_key] = 14 ) [CORE/cake/libs/model/db_acl.php, line 172] Warning (512): DB_ACL::allow() - Invalid node [CORE/cake/libs/ controller/components/acl.php, line 362]. The post is still added to the database though. The Post model lookes like this ?php class Post extends AppModel { var $name = 'Post'; var $actAs = array('Acl' = 'controlled'); var $belongsTo = array('User' = array('className' = 'User' ) ); function parentNode() { return $this-name; } ? and the add-action in PostsController function add() { if (!empty($this-data)) { $this-Post-data = $this-data; $id = $this-Session-read('Auth.User.id'); $this-data['Post']['user_id'] = $id; $this-Post-create(); if($this-Post-save($this-data)) { debug($this-Post); // ACL $aroNode = array('model' = 'User', 'foreign_key' = $id); $acoNode = array('model' = 'Post', 'foreign_key' = $this-Post-getLastInsertID()); $this-Acl-allow($aroNode,$acoNode,'*'); $this-flash('Success','/users/profile/'.$id); } } } All help I can get is appreciated! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem adding ACO and ARO
Looking at the SQL debug the failing one is SELECT `Aco`.`id`, `Aco`.`parent_id`, `Aco`.`model`, `Aco`.`foreign_key`, `Aco`.`alias` FROM `acos` AS `Aco` LEFT JOIN `acos` AS `Aco0` ON (`Aco`.`lft` = `Aco0`.`lft` AND `Aco`.`rght` = `Aco0`.`rght`) WHERE `Aco0`.`model` = 'Post' AND `Aco0`.`foreign_key` = 16 ORDER BY `Aco`.`lft` DESC It seems as the Post model never creates the ACO upon saving... to quote the tutorial from the Bakery Above code, will now automatically create a new aco for every new post that is posted. The Acl behavior takes care of all details. :/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem adding ACO and ARO
I'm and idiot, a simple typo was the problem, never mind this thread. About 2h wasted because I thaught it would be better to type the code by hand instead of copypaste :) Oh well... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 404 Not found on existing controller and action
Not my own server, it's a webhotel so i can't restart it if that was what you meant. Tried clearing out my cache and that worked perfectly! Thanks for the help! I do have some custom routes but nothing with regexp and it shouldn't interfere with this. Everything works now, clearing the cache fixed it. Andreas On Jan 6, 2:04 am, Robby Anderson [EMAIL PROTECTED] wrote: If you have other working controllers, you might consider bouncing your web server, or at least clearing out your /cache directory, specifically the /cache/persistent directory. On Jan 5, 12:36 pm, Andreas [EMAIL PROTECTED] wrote: Hi Created a model/controller/views names Type(s) with bake and uploaded them to my server but when i try to access them I'm getting '404 Not Found'. There's no info in the errors logs at all. Another thing I've noticed as a bit odd is this (there's usually something between the '. Error: The requested address '' was not found on this server. Here's how ti usually looks (the markers controller exists but not the asda action). Error: The requested address '/markers/asda' was not found on this server. Also tried to create another controller with another name but i get the same error with that one. Is there any cache I need to clean or some config thing I'm missing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL automatically creates posts
It works with just $this-Acl-Aro. Thanks for the help :) On Jan 4, 8:41 pm, gwoo [EMAIL PROTECTED] wrote: its a magic method. Cake can do findByfield and findAllByfield you should not need to instantiate a new Aro. $this-Acl-Aro should be enough. That article needs to be updated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
404 Not found on existing controller and action
Hi Created a model/controller/views names Type(s) with bake and uploaded them to my server but when i try to access them I'm getting '404 Not Found'. There's no info in the errors logs at all. Another thing I've noticed as a bit odd is this (there's usually something between the '. Error: The requested address '' was not found on this server. Here's how ti usually looks (the markers controller exists but not the asda action). Error: The requested address '/markers/asda' was not found on this server. Also tried to create another controller with another name but i get the same error with that one. Is there any cache I need to clean or some config thing I'm missing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 404 Not found on existing controller and action
I have a wordpress .htaccess file at the server root that have messed with cake a bit before but It's not the standard server message, it's the cake error message. Besides all of my old controllers work it's just the new ones I try to add that mess with me. On Jan 5, 10:23 pm, b logica [EMAIL PROTECTED] wrote: Is the webserver respecting your .htaccess files? Try putting a simple text file at the server's (not Cake's) web root and try to view it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL automatically creates posts
Hi I've been experimenting a bit with ACL today for an upcoming project. Messed around a bit with a simple scaffold and found to my surprise that acl automatically creates an aro when i add a group. It also automatically deletes it when i delete one of my groups. The only thing I've done so far is included (var $components = array('Acl');) the component in the controller and added this to my model (var $actsAs = array('Acl'='requester');) However it doesn't set any label and as far as I've understood so far that is quite convenient to have. Any idea how to set it? When I call this it just creates a second aro: $aro = new aro(); $aro-create(); $aro-save( 'model'='Group', 'foreign_key'=null, 'parent_id'=null, 'alias'=$this-data['Group']['name']); Using CakePHP 1.2.0.6311 and PHP5 although I doubt the php version do any difference in this case. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL automatically creates posts
Ok. thanks. One more question. I've been reading this article on the bakery. http://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x In that he uses $aro-findByAlias('Admin'); to get the id of a node. Is it just regular model methods he uses? On Jan 4, 7:09 pm, gwoo [EMAIL PROTECTED] wrote: when an ARO is tied to a model record there should not be an alias. The ARO node should be accessed with its model foreignKey. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Xml layout name
I used this one and it works. $this-layoutPath = 'xml'; $this-layout = 'default'; I'm wondering though why have they even bothered putting them into a folder in the first place? Thanks for the help! On Dec 4, 2:10 am, snowdog [EMAIL PROTECTED] wrote: Or you can set Router::parseExtensions('xml'), then you dont have to specify layout, cake will take care of it --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Xml layout name
Hi I've been trying to use the xml layout but it's not going too well since the layout file itself is located within a subfolder called xml (xml/default.ctp) and I'm not sure how to reach it with $this-layout = '';? Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unknown internal server error
I got no idea what happened but i just tried to remove the comments the support personal added earlier in order to show a friend, and it worked!? Anyway thanks for all the tips :) On Nov 6, 10:23 pm, Andreas [EMAIL PROTECTED] wrote: Well the Zend Optimizer section is gone in the directory where i did the trick but I'm not sure if that's a 100% sign. Recieved another mail from the support and they're saying that this trick doesn't work recursively (I've confirmed this by trying php info, the Zend Optimizer section is there) and currently I've only done the trick in the cake root. Is any php files executed anywhere else than the root? On Nov 6, 9:46 pm, francky06l [EMAIL PROTECTED] wrote: Are you sure the zend is deactivated with the trick ? Do a phpinfo() on it ... I have tried version 3.3 but it's still buggy.. On Nov 6, 8:57 pm, Andreas [EMAIL PROTECTED] wrote: I know mod_rewrite is working, I'm using it for another thing. Just left the mod_rewrite off on purpose until I recieve any other tips :) On Nov 6, 6:16 pm, grigri [EMAIL PROTECTED] wrote: If you can see the page, but not the css, then mod_rewrite isn't working properly. If you've deactivated the mod_rewrite stuff then there is a line you need to uncomment in app/config/core.php : /** * To configure CakePHP *not* to use mod_rewrite and to * use CakePHP pretty URLs, remove these .htaccess * files: * * /.htaccess * /app/.htaccess * /app/webroot/.htaccess * * And uncomment the App.baseUrl below: */ //Configure::write('App.baseUrl', env('SCRIPT_NAME')); This will generate urls that will work without mod_rewrite. They won't be as pretty though. On Nov 6, 5:06 pm, Andreas [EMAIL PROTECTED] wrote: I've been mailing back and forth with my host the entire day and they upgraded zend optimizer to 3.3 and also showed me a way to deactivate the zend stuff but that didn't make it work. The support guy told me that it looked like it was something with mod_rewrite which messed things up and therefor he commented out the mod_rewrite things in my .htaccess files. But have the .htaccess files changed any between 1.1.x and 1.2.x? Some good stuff though is that I can see the welcome page (without css though...) ;)http://thelucifer.net/tmp/cake_not_working.png I'm not so sure it's the zend optimizer anymore since it's both upgraded and deactivated... On Nov 5, 2:16 pm, Andreas [EMAIL PROTECTED] wrote: Ah, ok thanks. I'll talk with my host! On 5 Nov, 11:39, AD7six [EMAIL PROTECTED] wrote: On Nov 5, 8:23 am, Andreas [EMAIL PROTECTED] wrote: Hmm, yea, I'll try that. But shouldn't cakephp work even if the zend optimizer is enabled? Not if the zend optimizer has a bug in it. http://groups.google.com/group/cake-php/search?group=cake-phpq=+inte... hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unknown internal server error
I've been mailing back and forth with my host the entire day and they upgraded zend optimizer to 3.3 and also showed me a way to deactivate the zend stuff but that didn't make it work. The support guy told me that it looked like it was something with mod_rewrite which messed things up and therefor he commented out the mod_rewrite things in my .htaccess files. But have the .htaccess files changed any between 1.1.x and 1.2.x? Some good stuff though is that I can see the welcome page (without css though...) ;) http://thelucifer.net/tmp/cake_not_working.png I'm not so sure it's the zend optimizer anymore since it's both upgraded and deactivated... On Nov 5, 2:16 pm, Andreas [EMAIL PROTECTED] wrote: Ah, ok thanks. I'll talk with my host! On 5 Nov, 11:39, AD7six [EMAIL PROTECTED] wrote: On Nov 5, 8:23 am, Andreas [EMAIL PROTECTED] wrote: Hmm, yea, I'll try that. But shouldn't cakephp work even if the zend optimizer is enabled? Not if the zend optimizer has a bug in it. http://groups.google.com/group/cake-php/search?group=cake-phpq=+inte... hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unknown internal server error
Well the Zend Optimizer section is gone in the directory where i did the trick but I'm not sure if that's a 100% sign. Recieved another mail from the support and they're saying that this trick doesn't work recursively (I've confirmed this by trying php info, the Zend Optimizer section is there) and currently I've only done the trick in the cake root. Is any php files executed anywhere else than the root? On Nov 6, 9:46 pm, francky06l [EMAIL PROTECTED] wrote: Are you sure the zend is deactivated with the trick ? Do a phpinfo() on it ... I have tried version 3.3 but it's still buggy.. On Nov 6, 8:57 pm, Andreas [EMAIL PROTECTED] wrote: I know mod_rewrite is working, I'm using it for another thing. Just left the mod_rewrite off on purpose until I recieve any other tips :) On Nov 6, 6:16 pm, grigri [EMAIL PROTECTED] wrote: If you can see the page, but not the css, then mod_rewrite isn't working properly. If you've deactivated the mod_rewrite stuff then there is a line you need to uncomment in app/config/core.php : /** * To configure CakePHP *not* to use mod_rewrite and to * use CakePHP pretty URLs, remove these .htaccess * files: * * /.htaccess * /app/.htaccess * /app/webroot/.htaccess * * And uncomment the App.baseUrl below: */ //Configure::write('App.baseUrl', env('SCRIPT_NAME')); This will generate urls that will work without mod_rewrite. They won't be as pretty though. On Nov 6, 5:06 pm, Andreas [EMAIL PROTECTED] wrote: I've been mailing back and forth with my host the entire day and they upgraded zend optimizer to 3.3 and also showed me a way to deactivate the zend stuff but that didn't make it work. The support guy told me that it looked like it was something with mod_rewrite which messed things up and therefor he commented out the mod_rewrite things in my .htaccess files. But have the .htaccess files changed any between 1.1.x and 1.2.x? Some good stuff though is that I can see the welcome page (without css though...) ;)http://thelucifer.net/tmp/cake_not_working.png I'm not so sure it's the zend optimizer anymore since it's both upgraded and deactivated... On Nov 5, 2:16 pm, Andreas [EMAIL PROTECTED] wrote: Ah, ok thanks. I'll talk with my host! On 5 Nov, 11:39, AD7six [EMAIL PROTECTED] wrote: On Nov 5, 8:23 am, Andreas [EMAIL PROTECTED] wrote: Hmm, yea, I'll try that. But shouldn't cakephp work even if the zend optimizer is enabled? Not if the zend optimizer has a bug in it. http://groups.google.com/group/cake-php/search?group=cake-phpq=+inte... hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unknown internal server error
Hmm, yea, I'll try that. But shouldn't cakephp work even if the zend optimizer is enabled? On Nov 5, 12:16 am, francky06l [EMAIL PROTECTED] wrote: Ask your provider, maybe it's possible ..I had similar on share hosting and I did ask them proposing a special CGI and it works On Nov 4, 7:32 pm, Andreas [EMAIL PROTECTED] wrote: Unfortunately I can't do that. Using a webhotel and I doubt they would do that for me. On Nov 4, 4:45 pm, francky06l [EMAIL PROTECTED] wrote: I had this prior to remove the zend optimizer from php.ini On Nov 4, 4:11 pm, Andreas [EMAIL PROTECTED] wrote: Hi Just downloaded the pre beta to test out but I keep getting internal server error 500 in the browser when I run it. I'm sorry that i can't be more precise but I can't find any logs anywhere. I had another cakephp installation running on the same machine just a few days ago (the current stable one) and I never had this trouble with it. Also It's not the php installation messing with me because I got other scripts running. Any ideas? // Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unknown internal server error
Ah, ok thanks. I'll talk with my host! On 5 Nov, 11:39, AD7six [EMAIL PROTECTED] wrote: On Nov 5, 8:23 am, Andreas [EMAIL PROTECTED] wrote: Hmm, yea, I'll try that. But shouldn't cakephp work even if the zend optimizer is enabled? Not if the zend optimizer has a bug in it. http://groups.google.com/group/cake-php/search?group=cake-phpq=+inte...http://groups.google.com/group/cake-php/msg/5b8adc067177d69a hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Unknown internal server error
Hi Just downloaded the pre beta to test out but I keep getting internal server error 500 in the browser when I run it. I'm sorry that i can't be more precise but I can't find any logs anywhere. I had another cakephp installation running on the same machine just a few days ago (the current stable one) and I never had this trouble with it. Also It's not the php installation messing with me because I got other scripts running. Any ideas? // Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Unknown internal server error
Unfortunately I can't do that. Using a webhotel and I doubt they would do that for me. On Nov 4, 4:45 pm, francky06l [EMAIL PROTECTED] wrote: I had this prior to remove the zend optimizer from php.ini On Nov 4, 4:11 pm, Andreas [EMAIL PROTECTED] wrote: Hi Just downloaded the pre beta to test out but I keep getting internal server error 500 in the browser when I run it. I'm sorry that i can't be more precise but I can't find any logs anywhere. I had another cakephp installation running on the same machine just a few days ago (the current stable one) and I never had this trouble with it. Also It's not the php installation messing with me because I got other scripts running. Any ideas? // Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Auth/ACL problem: You are not authorized to access that location.
Hi, I've followed the tutorial at http://blog.jails.fr/cakephp/index.php?post/2007/08/15/AuthComponent-and-ACL , I updated the ACL as said and all. But when I try to login with the admin account I get You are not authorized to access that location. even though I ran the InitAcl with the line $this-Acl-allow('Admin', 'Users', '*'); And another weird thing, when I enter an invalid username/password combination I doesn't get the Login failed. Invalid username or password.. Anyone experienced the same? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Update phpGACL when a user signs up
Thank's alot, both of you! I'll try it out as soon as I get home from work. Regards, Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Update phpGACL when a user signs up
I'm using CakePHP 1.1 with phpGACL. I've only tried out Cake for the last days and now I've finally got an sign up form to work as expected. But how do I update the corresponding phpGACL tables when a new user signs up? My users table looks like: CREATE TABLE `users` ( `id` int(10) unsigned NOT NULL auto_increment, `username` varchar(20) NOT NULL default '', `password` varchar(40) NOT NULL default '', `email` varchar(50) default NULL, `created` datetime default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ; and the action looks like function signup() { if (!empty($this-data)) { if ($this-User-save($this-data)) { $this-flash('Grattis! Nu är du medlem.', '/users/ login'); } } } phpGACL being pretty extensive I'm sure there has to be an easy way of doing this? (Besides manually using the Import Groups / Users function) Regards, Andreas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Master view
There is a part in the link i wrote which is describing something about default.thtml in the layout folder. I tested doing that and it worked as i wanted. But thanks for you link have been trying to find that too :) Yes, i read the section about leyouts :) Thanks for the help! On Apr 17, 7:22 pm, AD7six [EMAIL PROTECTED] wrote: I think it would be extremely valuable for you to read the view chapter in the manual, and look for the word layout. This should have been step one of your quest for info. Unless there is something you haven't mentioned yet, using smarty or joomla layouts or anything else instead of just using cake pre existing layout mechanism seems a rather ineffective use of cake and your own time ;). hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Master view
Hi I wanna use a master view across my entire application so i don't have to hard code it into every view. The only thing I have found that's even close is some stuff about Smarty but that sounds so overkill. I just need a small and easy solution. I'm using the latest stable version of Cake (Stable: 1.1.14.4797). Have tried to search this place and on Google but haven't found anything useful. But if there actually is a solution out there that I have missed I'm sorry and please point mi right. ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Master view
Thanks! First I found setLayout() but that will be depracated in 1.2 and i have no idea if that even could solve my needs. However i continued to search and found the following: http://bakery.cakephp.org/articles/view/317 // Andreas Falk On 17 Apr, 15:50, AD7six [EMAIL PROTECTED] wrote: On 17 abr, 14:45, Andreas [EMAIL PROTECTED] wrote: Hi I wanna use a master view across my entire application so i don't have to hard code it into every view. Search the usual places for layout ;). hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Re: HowTo Change view template?
Did you have a look at elements? (http://manual.cakephp.org/chapter/views) 2006/9/15, nate [EMAIL PROTECTED]: // Controller: function view ( ) { $this-render(view_std); } -- e [EMAIL PROTECTED] w http://andreas-waidelich.de m +49.177.423 09 48 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: The MySQL UTF8 Issue
to reduce the number of SET NAMES queries add a static boolean variable to your AppModel an set it to false. Check the value of the variable in your constructor and execute SET NAMES only, if it has not been done before. E.g. class AppModel extends Model{ static $utf8IsSet = false; function __construct(){ if(!self::$utf8IsSet) { $this-execute(SET NAMES 'utf8'); self::$utf8IsSet = true; } parent::__construct(); } } -- e [EMAIL PROTECTED] w http://andreas-waidelich.de --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: The MySQL UTF8 Issue
sounds good. looking forward to Cake 1.2. 2006/9/4, nate [EMAIL PROTECTED]: Cake 1.2 now supports this natively. Just add 'encoding' = 'UTF-8' to your database configuration and the querying is taken care of automatically at the database level. -- e [EMAIL PROTECTED] w http://andreas-waidelich.de m +49.177.423 09 48 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: cake setup -- does it have to be so difficult?
I had no problem setting up cake under OSX. The cake core resides in ~/Library/cake and the apps in ~/Sites. I am using the PHP Package from here[1] and the offical MySQL for Mac. The only thing you have to look for is the permissions of the Library folder. 1: http://www.entropy.ch/software/macosx/php/ Andreas 2006/8/31, kain [EMAIL PROTECTED]: stevenL wrote: Thanks. Of course I read the manual. Over and over... I was previouswy installing Cake inside the Sites folder. So I am trying your method of placing a folder for cake inside /Library/WebServer/Documents. When I visit the cake index file there it's the same problem, I get the cake page but I can see that it is not finding the CSS file (page is unstyled). If I set AllowOverride to All in httpd.conf, the page breaks and I get a bad request error. Any clues? I'm on Mac too, try to uses MAMP (search google) copy the cakephp zip archive in htdocs, decompress it, you will notice that there is a folder named cakephp_, go to your shell, cd into htdocs, then mv cakephp_xxx/* . mv cakephp_xxx/.htaccess . have a try. -- kain http://www.cakephpforum.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---