Re: RSS Feed ... what method is called by index.rss
Thank you for the help. You are right that the primary customization I was interested in was to have a different number of entries used in the website index vs. the rss index. Just in case anyone else has the same question, here is what I am now doing: --- // this goes into my Articles::index() method if( $this->RequestHandler->isRss() ){ $this->paginate['limit'] = 20; //In Posts Controller $channelData = array('title' => 'Phrosting Articles', 'link' => array('controller' => 'articles', 'action' => 'feed', 'ext' => 'rss'), 'url' => array('controller' => 'articles', 'action' => 'feed', 'ext' => 'rss'), 'description' => 'Recent articles posted to Phrosting', 'language' => 'en-us' ); $data = $this->paginate('Article'); $this->set(compact('channelData', 'data')); } else { $data = $this->paginate('Article'); $this->set(compact('data')); } - On Nov 25, 10:46 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > I guess the idea is that the index page and the index RSS feed should > very much contain the same data, only in a different output format > (layout/view). You can use a paginate() call even for the RSS feed, as > you usually only want the last x entries in the feed, not the whole > database. You can ask the RequestHandler component whether the page is > supposed to be RSS or regular, and increase the limit for the paginate > call for example, or set other differentiating options. > > If the RSS version is supposed to be completely different from the > regular page, just name it something else like feed.rss and have a > dedicated feed() action in your controller for it. > > On 26 Nov 2008, at 14:28, aranworld wrote: > > > > > Well, I realize it is a pretty dumb question. Obviously, the index() > > method is called when index.rss is accessed. > > > I guess my real question is ... what if the logic behind index.rss is > > different from the logic behind index ... as I'm sure it usually is on > > websites. > > > For example, what if my posts/index uses paginate? How could I make a > > controller action called index, that handled both an rss request and a > > regular request, using different logic for each one? > > > -Aran > > > On Nov 25, 2:07 pm, aranworld <[EMAIL PROTECTED]> wrote: > >> I am finding the manual entry on generating RSS Feeds really helpful > >> except for one minor detail. > > >>http://book.cakephp.org/view/483/Creating-an-RSS-feed-with-the-RssHelper > > >> When someone requests posts/index.rss , what controller method is > >> actually called? Is Posts::index() called? > > >> Where should I put the Controller Code that appears? If I put it in > >> Posts::index(), then how do I integrate it with other code for > >> generating a non-rss feed from Posts::index()? > > >> Thanks, > >> Aran > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: validation
hello anja, your valaidation logic is very helpful to me... i want to ask another one doubt to u , in ur example u given three text fields are validated in built in method.. i am asking abt how to validate the file field. example( upload file filed). If i try to validate , the error message displayed in above three text fields... file field have not displayed when submitting the empty data. In my model : function validate($ary_test_info){ $ary_error = array(); for($i=0; $i<1; $i++){ if(!$this->isEmpty($ary_test_info['Test']['photo'][$i]['name'])|| !$this->isEmpty($ary_test_info['Test']['name'][$i])|| !$this->isEmpty($ary_test_info['Test']['mark1'][$i])|| !$this->isEmpty($ary_test_info['Test']['mark2'][$i])){ }else{ if ($this->isEmpty($ary_test_info['Test']['name'][$i]) ){ $ary_error['name'][$i] = 'Please select name'; } if ($this->isEmpty($ary_test_info['Test']['mark1'][$i]) ){ $ary_error['mark1'][$i] = 'Please select mark1'; } if ($this->isEmpty($ary_test_info['Test']['mark2'][$i]) ){ $ary_error['mark2'][$i] = 'Please select mark2'; } if ($this->isEmpty($ary_test_info['Test']['photo'][$i]['name']) ) { $ary_error['photo']['name'][$i] = 'Please select photo'; } return $ary_error; } } } now how to assign the error message into controller and how to validate the upload file field... with out using built in validation method.. let me know ur suggestion by sundar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: RSS Feed ... what method is called by index.rss
I guess the idea is that the index page and the index RSS feed should very much contain the same data, only in a different output format (layout/view). You can use a paginate() call even for the RSS feed, as you usually only want the last x entries in the feed, not the whole database. You can ask the RequestHandler component whether the page is supposed to be RSS or regular, and increase the limit for the paginate call for example, or set other differentiating options. If the RSS version is supposed to be completely different from the regular page, just name it something else like feed.rss and have a dedicated feed() action in your controller for it. On 26 Nov 2008, at 14:28, aranworld wrote: > > Well, I realize it is a pretty dumb question. Obviously, the index() > method is called when index.rss is accessed. > > I guess my real question is ... what if the logic behind index.rss is > different from the logic behind index ... as I'm sure it usually is on > websites. > > For example, what if my posts/index uses paginate? How could I make a > controller action called index, that handled both an rss request and a > regular request, using different logic for each one? > > -Aran > > On Nov 25, 2:07 pm, aranworld <[EMAIL PROTECTED]> wrote: >> I am finding the manual entry on generating RSS Feeds really helpful >> except for one minor detail. >> >> http://book.cakephp.org/view/483/Creating-an-RSS-feed-with-the-RssHelper >> >> When someone requests posts/index.rss , what controller method is >> actually called? Is Posts::index() called? >> >> Where should I put the Controller Code that appears? If I put it in >> Posts::index(), then how do I integrate it with other code for >> generating a non-rss feed from Posts::index()? >> >> Thanks, >> Aran > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
ACO/ARO in index functions
hi, is there is an easy way to filter object data in the controller for index pages before its sent to the view, based on an aro, without quering the aro/aco tables directly? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RSS Feed ... what method is called by index.rss
Well, I realize it is a pretty dumb question. Obviously, the index() method is called when index.rss is accessed. I guess my real question is ... what if the logic behind index.rss is different from the logic behind index ... as I'm sure it usually is on websites. For example, what if my posts/index uses paginate? How could I make a controller action called index, that handled both an rss request and a regular request, using different logic for each one? -Aran On Nov 25, 2:07 pm, aranworld <[EMAIL PROTECTED]> wrote: > I am finding the manual entry on generating RSS Feeds really helpful > except for one minor detail. > > http://book.cakephp.org/view/483/Creating-an-RSS-feed-with-the-RssHelper > > When someone requests posts/index.rss , what controller method is > actually called? Is Posts::index() called? > > Where should I put the Controller Code that appears? If I put it in > Posts::index(), then how do I integrate it with other code for > generating a non-rss feed from Posts::index()? > > Thanks, > Aran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: connecting the many to many dots - going from table1 -> table1_table2 -> table 2
You can retrieve data from a HABTM relationship either by modelizing the join table or using 'with' key of the model association. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
connecting the many to many dots - going from table1 -> table1_table2 -> table 2
I realize my question leans more towards learning php than it does the cakephp framework but it's a little of both and i'm trying to learn both so I hope someone is willing to help. I have three tables: categories, categories_listings, and listings. i have a form that lists categories with check boxes. if one is check marked and the submit button is hit i am taken to the form action and in data is the category id of the check marked category. How do I go from having a category id, to finding which records match that category id in the categories_listings table, to returning the listings that are associated with that category id? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: bug? or whats the matter with date fields?
only thing i can say, is that villas and Dardo Sordi Bogado were right there was no documentation on that, but now i know that it is better to avoid such naming conflicts anyway, if i ever publish a "cake Look-Out-list", this will definitly be on it i still do not know what xavier wanted to tell me :) On 10 Nov., 14:27, "Xavier Mathews" <[EMAIL PROTECTED]> wrote: > I am still over looking the problem and then i will prepare a > statement and tell you my point. > > On 11/10/2008, Mark (Germany) <[EMAIL PROTECTED]> wrote: > > > > > > > @xavier: > > what exactly is your point? :) > > > On 10 Nov., 12:12, "Mark (Germany)" <[EMAIL PROTECTED]> > > wrote: > >> well, i sure could have renamed it if i had known that it is a problem > >> a) to name a field like the model > >> b) to name it like a reserved word > > >> thx so far > > >> On 10 Nov., 02:11, "Xavier Mathews" <[EMAIL PROTECTED]> wrote: > > >> > What they said lol. If you find your self bugging with the date dont > >> > use it without debugging. > > >> > On 11/09/2008, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote: > > >> > > Avoid naming a field the same as the model and this will not happen ;) > > >> > > On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany) > >> > > <[EMAIL PROTECTED]> wrote: > > >> > >> As the pr() output shows, the processed form data on POST > >> > >> returns a devided array with the normal "Date" and a second "date" > >> > >> resulting in 2 warnings (Undefined variable: month/year) + the form > >> > >> process recognized as invalide. > > >> > >> Array > >> > >> ( > >> > >> [Date] => Array > >> > >> ( > >> > >> [user_id] => 1 > >> > >> [date_type_id] => 1 > >> > >> [date] => Array > >> > >> ( > >> > >> [day] => 09 > >> > >> ) > > >> > >> [details] => > >> > >> ) > > >> > >> [date] => Array > >> > >> ( > >> > >> [date] => Array > >> > >> ( > >> > >> [month] => 11 > >> > >> [year] => 2008 > >> > >> ) > > >> > >> ) > > >> > >> ) > > >> > >> The Form was baked by the console > > >> > >> create('Date');?> > >> > >> > >> > >> > >> > >> >> > >> echo $form->input('user_id'); > >> > >> echo $form->input('date_type_id'); > >> > >> echo $form->input('date'); > >> > >> echo $form->input('details'); > >> > >> ?> > >> > >> > >> > >> end('Submit');?> > > >> > >> I cant find the problem - the database field is of the normal "date" > >> > >> type > > >> > >> Wow.. > >> > >> After changing it to the following, it worked... > > >> > >> >> > >> echo $form->input('Date.user_id'); > >> > >> echo $form->input('Date.date_type_id'); > >> > >> echo $form->input('Date.date'); > >> > >> echo $form->input('Date.details'); > >> > >> ?> > > >> > >> So why is this neccessary if there is only that one model Date? > > >> > -- > >> > Xavier A. Mathews > >> > Student/Developer/Web-Master > >> > GG Client Based Tech Support Specialist > >> > Hazel Crest Illinois > >> > [EMAIL PROTECTED]@[EMAIL PROTECTED] > >> > "Fear of a name, only increases fear of the thing itself." > > -- > Xavier A. Mathews > Student/Developer/Web-Master > GG Client Based Tech Support Specialist > Hazel Crest Illinois > [EMAIL PROTECTED]@[EMAIL PROTECTED] > "Fear of a name, only increases fear of the thing itself." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
multiple [controllerName].po files + normal core.po?
Several posts and blogs have been made to similar topics they usually end up with use eather core.po OR multiple controllerName.po etc the way cake works is: - if it finds a "domain".po, use it, abort - if not, try to find core.po, use it, abort well, is there (without the need to hack into i18n.php in /cake/libs) an easy way to always include core.php (main translation things as "edit" "delete" "add") + including a controller based .po file having the specific strings for each controller connected view? example, how the /LC_MESSAGES dir could look like: core.po (everything needed in every controller, always included) blogs.po posts.po config.po contact.po ... etc AND i probably have to add: without having to use the domain everywhere inside the translation strings like __('domain','string) as this is not very usability-friendly. they should still be of the type __('string') and just be merged from both the core.po and the actual controller we use right now. maybe in the beforeFilter() method, as this one is triggered only if some controller is used, otherwise only the core.po file is needed for the debug/error messages and the main layout etc. if it ends up to be a manual insert function, this would probably be ok, as well.. i reckon its gonna be like that, as i searched the internet quite thoroughly thx in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Multiple table access from within a model
Use the Containable behavior http://book.cakephp.org/view/474/Containable --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
Multiple table access from within a model
I have the following tables, events +-id +-offering_id ... offerings +-id +-program_id +-start_date ... programs +-id +-name ... One program could have many offerings, but each offering is tied to one program. I have the $belongsTo and $hasMany set up via Bake. I would like to regularly be able to grab the associated row from `programs` and use the afterFind function to dynamically create the offering name (which will be a concatenation of the program name and the offering start date.) However, only sometimes does the associated Program appear in the results. Specifically, when accessing the offerings_controller, associated events and programs appear in the results. But when I use the events_controller, Program is not in the results array. I have defined $uses = Array( 'Event', 'Offering', 'Program' ) in the events_controller, but still no dice. Is there a way to tell a model that I need it to pull the associated Program record EVERY TIME? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Javascript "Ajax" methods" not working
I have similar problem, mine's work well in ff3,opera and IE without a problem but not on ff2. really weird. On Nov 6, 5:11 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > do you have any example code that we can look at, ive just gone > through a session where i have had to work with ajax in cake, mighe be > able to help you out > > On Nov 5, 9:48 pm, Donkeybob <[EMAIL PROTECTED]> wrote: > > > nothing comes back into firebug when i run it with 0 set . . . .just > > weird . . its like it doesn't even start. > > > On Nov 5, 3:33 pm, the_woodsman <[EMAIL PROTECTED]> wrote: > > > > Never had this problem myself - in fact, usually the other way round! > > > Although I have seen threads about Ajax and session persistence being > > > a problem, and debug level might have an impact on that. > > > > Do you have firebug for Firefox installed? You can take a look at what > > > comes back from the ajax request to identify the cause more > > > precisely... > > > > On Nov 5, 4:49 pm, Donkeybob <[EMAIL PROTECTED]> wrote: > > > > > I have different methods in my code that send ajax requests and fancy > > > > stuff like that . . .these functions work great when i set my debug > > > > mode to 1 or 2 but when i set it to 0, they don't work. > > > > > any ideas why this would happen? > > > > > thanks, > > > > rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: CakePHP Unit Test Model Woes :(
Hi Matt, Thanks but I'm still not quite there. I have tried variations on most of these calls already. My test database is not empty - it has a users table but there are no records in the table. I get Error: Database table users for model User was not found if I have no users table in the 'test' DB and it uses this table with the var $import = array('table' => 'name', 'records' => false); line you mentioned. I have been through your suggestions 1 by 1 but still don't have a working test. You don't have a very simple example of a working model test you could share by any chance? Thanks, Andy On Nov 25, 10:04 pm, MattC <[EMAIL PROTECTED]> wrote: > This may or may not fix your problem but: > 1) You test db should be empty. The framework will automatically > create/drop the tables for each test. > 2) You don't need to call "loadFixtures" at the start of each test. > 3) I don't think you need to App::import your model if you use > ClassRegistry::init. Not 100% on that, and it shouldn't hurt even if > you do. > 4) In my fixtures I have the line: > var $import = array('table' => 'name', 'records' => false); > I had to use the actually table name to get everything working with > ClassRegistry setting the right database. It didn't work if I just > specified the model. > > Hope that helps. > -Matthttp://www.pseudocoder.com > > On Nov 25, 4:29 pm, pragna <[EMAIL PROTECTED]> wrote: > > > I've been struggling for a couple of days now to build a very simple > > 'model' unit test. > > > CakePHPs "Convention over Configuration" should help me out here and > > so should the Cookbook. > > > With Unit Tests though, it's quite hard to uncover the what the > > conventions are. The filename conventions described in the Cookbook > > (1.2) differ from, for example, the fixture files created using Bake. > > Also the guys at Debuggable have re-factored and simplified the > > building of model tests as well as sharing a fixturize script that > > automates the building of fixtures. > > > All great stuff! > > If only I could get the simplest test up and running :( > > > My failing code is > > here:http://oneyeareatingcake.blogspot.com/2008/11/cakephp-unit-test-model... > > > It is the most basic of Unit Tests on a simple findAll function in the > > most basic of models. The reason this is not working has to be that > > I'm breaking the convention somewhere. Maybe in file naming or in the > > way I'm including the fixture? > > > I'd be very grateful if someone could get me out of this mess by > > pointing out what I've got wrong. > > Thanks, > > 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: sorting table by colum for cake 1.1.19
Anyone? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
RSS Feed ... what method is called by index.rss
I am finding the manual entry on generating RSS Feeds really helpful except for one minor detail. http://book.cakephp.org/view/483/Creating-an-RSS-feed-with-the-RssHelper When someone requests posts/index.rss , what controller method is actually called? Is Posts::index() called? Where should I put the Controller Code that appears? If I put it in Posts::index(), then how do I integrate it with other code for generating a non-rss feed from Posts::index()? Thanks, Aran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: $html->link() on button
I think you want something like this: Click me hth grigri On Nov 25, 9:03 pm, "Diego Villar" <[EMAIL PROTECTED]> wrote: > Hi guys, > > how to use the helper $html->link() in a href > button? > > I try to use links such as buttons: > > > any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: CakePHP Unit Test Model Woes :(
This may or may not fix your problem but: 1) You test db should be empty. The framework will automatically create/drop the tables for each test. 2) You don't need to call "loadFixtures" at the start of each test. 3) I don't think you need to App::import your model if you use ClassRegistry::init. Not 100% on that, and it shouldn't hurt even if you do. 4) In my fixtures I have the line: var $import = array('table' => 'name', 'records' => false); I had to use the actually table name to get everything working with ClassRegistry setting the right database. It didn't work if I just specified the model. Hope that helps. -Matt http://www.pseudocoder.com On Nov 25, 4:29 pm, pragna <[EMAIL PROTECTED]> wrote: > I've been struggling for a couple of days now to build a very simple > 'model' unit test. > > CakePHPs "Convention over Configuration" should help me out here and > so should the Cookbook. > > With Unit Tests though, it's quite hard to uncover the what the > conventions are. The filename conventions described in the Cookbook > (1.2) differ from, for example, the fixture files created using Bake. > Also the guys at Debuggable have re-factored and simplified the > building of model tests as well as sharing a fixturize script that > automates the building of fixtures. > > All great stuff! > If only I could get the simplest test up and running :( > > My failing code is > here:http://oneyeareatingcake.blogspot.com/2008/11/cakephp-unit-test-model... > > It is the most basic of Unit Tests on a simple findAll function in the > most basic of models. The reason this is not working has to be that > I'm breaking the convention somewhere. Maybe in file naming or in the > way I'm including the fixture? > > I'd be very grateful if someone could get me out of this mess by > pointing out what I've got wrong. > Thanks, > 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 -~--~~~~--~~--~--~---
CakePHP Unit Test Model Woes :(
I've been struggling for a couple of days now to build a very simple 'model' unit test. CakePHPs "Convention over Configuration" should help me out here and so should the Cookbook. With Unit Tests though, it's quite hard to uncover the what the conventions are. The filename conventions described in the Cookbook (1.2) differ from, for example, the fixture files created using Bake. Also the guys at Debuggable have re-factored and simplified the building of model tests as well as sharing a fixturize script that automates the building of fixtures. All great stuff! If only I could get the simplest test up and running :( My failing code is here: http://oneyeareatingcake.blogspot.com/2008/11/cakephp-unit-test-model-woes.html It is the most basic of Unit Tests on a simple findAll function in the most basic of models. The reason this is not working has to be that I'm breaking the convention somewhere. Maybe in file naming or in the way I'm including the fixture? I'd be very grateful if someone could get me out of this mess by pointing out what I've got wrong. Thanks, 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: He everyone
that's a typo, i meant "$hasAndBelongsToMany" On Nov 25, 3:56 pm, validkeys <[EMAIL PROTECTED]> wrote: > hasManyAndBelongsTo should hasAndBelongsToMany > > On Nov 25, 3:21 pm, ayomacro <[EMAIL PROTECTED]> wrote: > > > Hi everyone, I just started CakePHP and it's awesome to see the > > mechanism of MVC in a whole new way. Compare to Zend it's simpler for > > newbies. > > > I'm writing my blog application which is almost finished so I can > > paste it on the website for other people to see the complete CakePHP > > Blog 2 application but there is a problem. > > > I have a Controller named Tag which is the category I set for my Post. > > (Post hasManyAndBelongsTo Tag :: Tag hasManyAndBelongsTo Post) > > A post can be put under any Tag and the Tag will have many posts where > > user can click and see all associated posts of the Tag. > > > I created my Tag view so a user can click on the Tag and see many > > related Posts under that but it's not working for me. I've tried > > everything I can even though I haven't put much effort into because of > > Job. here is the View.ctp > > > [PHP] > > Tag > > > > > > > > > > > > > > > > link('List Posts', > > array('controller'=> > > 'posts', 'action'=>'index')); ?> > > link('New Post', array('controller'=> > > 'posts', > > 'action'=>'add')); ?> > > > > > > > > > Related Posts > > > > > > Id > > Title > > Body > > User Id > > Actions > > > > > foreach ($tag['Post'] as $post): > > ?> > > > > > > > > > > > > > > link(__('View', true), > > array('controller'=> > > 'posts', 'action'=>'view', $post['id'])); ?> > > link(__('Edit', true), > > array('controller'=> > > 'posts', 'action'=>'edit', $post['id'])); ?> > > link(__('Delete', true), > > array('controller'=> > > 'posts', 'action'=>'delete', $post['id']), null, sprintf(__('Are you > > sure you want to delete # %s?', true), $post['id'])); ?> > > > > > > > > > > > > > > > link(__('New Post', true), > > array > > ('controller'=> 'posts', 'action'=>'add'));?> > > > > > > > > [/PHP] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: 3 ajax selects
The basisc select A -> select B part is pretty much like: http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/ My question is if anyone tried to do select A both controls select B and C at a time. In my project I'm resorting to hide select C via Javascript when select A is changed, not a good-looking work-around. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
$html->link() on button
Hi guys, how to use the helper $html->link() in a href button? I try to use links such as buttons: any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Validation Question/Form Question
first you need allowEmpty => true for your radio buttons then, you simply need a custom validation rule for the 'other' field 'other => array('rule'=>array('checkOther')); function checkOther() { if(///check if radio buttons are empty && 'other' is not decimal///) { return false; } return true; } On Nov 25, 3:07 pm, rgreenphotodesign <[EMAIL PROTECTED]> wrote: > I find myself a little stumped on this one, maybe some can offer some > insight. > > I need a "donate" form that will be sent via SSL to our merchant > processing facility. I need a set of radio buttons that have a > suggested donation amount (accomplished using form->radio('Amount', > array('1000.00' =>'$1000', '500.00' => '$500', '250.00' => '$250', > '100.00' => '$100', '54.00' => '$54', '36.00' => '$36'), null, array > ());) > > But I also need a text input for other amount. > > So how do I validate that either a radio was selected, or an correctly > formatted (10.00) amount is entered in other amount? > > I currently have : > > 'Amount' => array( > 'notEmpty' => array( > 'rule' => 'notEmpty', > 'message' => 'Please select a donation amount.') > ), > > 'Other' => array( > 'decimal' => array( > 'rule' => array('decimal', 2), > 'message' => 'Please include a full amount with > cents.') > ), > > or do I decide what to send to validate prior to sending it in my > controller? > > Hope that makes sense. > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: He everyone
hasManyAndBelongsTo should hasAndBelongsToMany On Nov 25, 3:21 pm, ayomacro <[EMAIL PROTECTED]> wrote: > Hi everyone, I just started CakePHP and it's awesome to see the > mechanism of MVC in a whole new way. Compare to Zend it's simpler for > newbies. > > I'm writing my blog application which is almost finished so I can > paste it on the website for other people to see the complete CakePHP > Blog 2 application but there is a problem. > > I have a Controller named Tag which is the category I set for my Post. > (Post hasManyAndBelongsTo Tag :: Tag hasManyAndBelongsTo Post) > A post can be put under any Tag and the Tag will have many posts where > user can click and see all associated posts of the Tag. > > I created my Tag view so a user can click on the Tag and see many > related Posts under that but it's not working for me. I've tried > everything I can even though I haven't put much effort into because of > Job. here is the View.ctp > > [PHP] > Tag > > > > > > > > link('List Posts', array('controller'=> > 'posts', 'action'=>'index')); ?> > link('New Post', array('controller'=> > 'posts', > 'action'=>'add')); ?> > > > > > Related Posts > > > Id > Title > Body > User Id > Actions > > foreach ($tag['Post'] as $post): > ?> > > > > > > > link(__('View', true), > array('controller'=> > 'posts', 'action'=>'view', $post['id'])); ?> > link(__('Edit', true), > array('controller'=> > 'posts', 'action'=>'edit', $post['id'])); ?> > link(__('Delete', true), > array('controller'=> > 'posts', 'action'=>'delete', $post['id']), null, sprintf(__('Are you > sure you want to delete # %s?', true), $post['id'])); ?> > > > > > > > > link(__('New Post', true), array > ('controller'=> 'posts', 'action'=>'add'));?> > > > > [/PHP] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
autocomplete multiple rows
Is there anyway to have autocomplete work with multiple rows in the same view. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Help with cake and soundmanager2: SOLUTION
So I found out what was causing the problem, but I'm not sure why. Maybe someone can help me with that. Basically it was the navigation links I had in the default layout. I had > link('All Songs', '/songs/'); ?> instead of > link('All Songs', '/songs'); ?> I was trying to get to the index controller and in a haze of late night over-caffeinated-ness I left a '/' on the end of the link. It would still bring up the index view, but for some reason it was not running the soundmanager javascript files even thought they were being put into the view. ?? All good now, but if anyone can shed some light as to why it would still render the page and not run the javascript I would love to know. Thanks On Nov 25, 2008, at 11:03 AM, Jay Reeder wrote: > We're using Soundmanager2 in a Cake app w/ajax and it's working > fine. Do you have debugging turned on? There are a number of > things that could be causing your issue. > > Try turning on debugging and also try turning > off .useHighPerformance in the soundmanager2.js file (it creates > problems with some browsers). > > On Tue, Nov 25, 2008 at 11:55 AM, farfignugin > <[EMAIL PROTECTED]> wrote: > > I'm putting together a cake app with an inline mp3 player using > soundmanager2 similar to this demo: > http://www.schillmania.com/projects/soundmanager2/demo/page-player/ > . I'm using to get the > soundmanager2 javascripts into the head, and everything works fine > when a page is first pulled up, but when I link to a different > controller link('Song by Genre', '/genres/'); ?> or echo $html->link('All Songs', '/songs/'); ?> from the navigation I put > in the default layout, the javascripts are not working properly. Is it > possible that cake isn't reloading the entire page. I have view > caching turned off site wide. (//core.php Configure::write > ('Cache.disable', true);) > > If I don't use the navigation i put in the default layout and just > type the controller and action name into the browser manually it works > fine. > > any help would be much appreciated. I'm stuck. > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
He everyone
Hi everyone, I just started CakePHP and it's awesome to see the mechanism of MVC in a whole new way. Compare to Zend it's simpler for newbies. I'm writing my blog application which is almost finished so I can paste it on the website for other people to see the complete CakePHP Blog 2 application but there is a problem. I have a Controller named Tag which is the category I set for my Post. (Post hasManyAndBelongsTo Tag :: Tag hasManyAndBelongsTo Post) A post can be put under any Tag and the Tag will have many posts where user can click and see all associated posts of the Tag. I created my Tag view so a user can click on the Tag and see many related Posts under that but it's not working for me. I've tried everything I can even though I haven't put much effort into because of Job. here is the View.ctp [PHP] Tag link('List Posts', array('controller'=> 'posts', 'action'=>'index')); ?> link('New Post', array('controller'=> 'posts', 'action'=>'add')); ?> Related Posts Id Title Body User Id Actions link(__('View', true), array('controller'=> 'posts', 'action'=>'view', $post['id'])); ?> link(__('Edit', true), array('controller'=> 'posts', 'action'=>'edit', $post['id'])); ?> link(__('Delete', true), array('controller'=> 'posts', 'action'=>'delete', $post['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $post['id'])); ?> link(__('New Post', true), array ('controller'=> 'posts', 'action'=>'add'));?> [/PHP] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
Validation Question/Form Question
I find myself a little stumped on this one, maybe some can offer some insight. I need a "donate" form that will be sent via SSL to our merchant processing facility. I need a set of radio buttons that have a suggested donation amount (accomplished using form->radio('Amount', array('1000.00' =>'$1000', '500.00' => '$500', '250.00' => '$250', '100.00' => '$100', '54.00' => '$54', '36.00' => '$36'), null, array ());) But I also need a text input for other amount. So how do I validate that either a radio was selected, or an correctly formatted (10.00) amount is entered in other amount? I currently have : 'Amount' => array( 'notEmpty' => array( 'rule' => 'notEmpty', 'message' => 'Please select a donation amount.') ), 'Other' => array( 'decimal' => array( 'rule' => array('decimal', 2), 'message' => 'Please include a full amount with cents.') ), or do I decide what to send to validate prior to sending it in my controller? Hope that makes sense. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Mambo on CakePHP brainstorm
Would it be feasible to merge one of the existing Cake CMS projects into this new effort to provide a head-start? On Tue, Nov 25, 2008 at 2:12 PM, MattC <[EMAIL PROTECTED]> wrote: > > I second what Nate said, especially #2. > > It would be awesome if Mambo was both a full standalone CMS, but also > a plugin that could be dropped into any Cake app to provide CMS > functionality. > > -Matt > http://www.pseudocoder.com > > On Nov 25, 1:55 pm, andphe <[EMAIL PROTECTED]> wrote: > > Hi Nate, > > > > On Nov 25, 11:20 am, Nate <[EMAIL PROTECTED]> wrote:> Based on your > stated goals, the two suggestions I would add are: > > > > > (1) Develop as many of Mambo's features as possible as extensions. > > > This will not only make the CMS itself as flexible as possible (and > > > the CMS's extension API as robust as possible), but it will also help > > > you 'feel the pain' of extension developers as they write new > > > extensions or migrate old ones. > > > > It's a good idea, and it much as we want to go, build what Mambo 4.7 > > can do using cakePHP > > > > > (2) Develop as much of the functionality of the Mambo core itself as > > > CakePHP plugins. This will not only make the core easily extensible, > > > but it will enable CakePHP developers to more easily integrate Mambo > > > code within their own applications, and lower the barrier to entry on > > > contributing back to the Mambo core. > > > > thanks for share your thoughts, very appreciated. > > > > Andrés > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Mambo on CakePHP brainstorm
I second what Nate said, especially #2. It would be awesome if Mambo was both a full standalone CMS, but also a plugin that could be dropped into any Cake app to provide CMS functionality. -Matt http://www.pseudocoder.com On Nov 25, 1:55 pm, andphe <[EMAIL PROTECTED]> wrote: > Hi Nate, > > On Nov 25, 11:20 am, Nate <[EMAIL PROTECTED]> wrote:> Based on your stated > goals, the two suggestions I would add are: > > > (1) Develop as many of Mambo's features as possible as extensions. > > This will not only make the CMS itself as flexible as possible (and > > the CMS's extension API as robust as possible), but it will also help > > you 'feel the pain' of extension developers as they write new > > extensions or migrate old ones. > > It's a good idea, and it much as we want to go, build what Mambo 4.7 > can do using cakePHP > > > (2) Develop as much of the functionality of the Mambo core itself as > > CakePHP plugins. This will not only make the core easily extensible, > > but it will enable CakePHP developers to more easily integrate Mambo > > code within their own applications, and lower the barrier to entry on > > contributing back to the Mambo core. > > thanks for share your thoughts, very appreciated. > > Andrés --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Help with cake and soundmanager2
We're using Soundmanager2 in a Cake app w/ajax and it's working fine. Do you have debugging turned on? There are a number of things that could be causing your issue. Try turning on debugging and also try turning off .useHighPerformance in the soundmanager2.js file (it creates problems with some browsers). On Tue, Nov 25, 2008 at 11:55 AM, farfignugin <[EMAIL PROTECTED]>wrote: > > I'm putting together a cake app with an inline mp3 player using > soundmanager2 similar to this demo: > http://www.schillmania.com/projects/soundmanager2/demo/page-player/ > . I'm using to get the > soundmanager2 javascripts into the head, and everything works fine > when a page is first pulled up, but when I link to a different > controller link('Song by Genre', '/genres/'); ?> or echo $html->link('All Songs', '/songs/'); ?> from the navigation I put > in the default layout, the javascripts are not working properly. Is it > possible that cake isn't reloading the entire page. I have view > caching turned off site wide. (//core.php Configure::write > ('Cache.disable', true);) > > If I don't use the navigation i put in the default layout and just > type the controller and action name into the browser manually it works > fine. > > any help would be much appreciated. I'm stuck. > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Mambo on CakePHP brainstorm
Hi Nate, On Nov 25, 11:20 am, Nate <[EMAIL PROTECTED]> wrote: > Based on your stated goals, the two suggestions I would add are: > > (1) Develop as many of Mambo's features as possible as extensions. > This will not only make the CMS itself as flexible as possible (and > the CMS's extension API as robust as possible), but it will also help > you 'feel the pain' of extension developers as they write new > extensions or migrate old ones. > It's a good idea, and it much as we want to go, build what Mambo 4.7 can do using cakePHP > (2) Develop as much of the functionality of the Mambo core itself as > CakePHP plugins. This will not only make the core easily extensible, > but it will enable CakePHP developers to more easily integrate Mambo > code within their own applications, and lower the barrier to entry on > contributing back to the Mambo core. > thanks for share your thoughts, very appreciated. Andrés --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
More suggestion please... Groups, Forums they all already exist. There is no point in re- inventing something that already exists. more suggestions please ... On Nov 25, 3:35 pm, stewsnooze <[EMAIL PROTECTED]> wrote: > I think we should look at Drupal as it's on fire at the moment and > it's community is very powerful and empowered by the community > tools. > > The Groups.drupal.org site matches people across sectors and interests > with each other and allows them to discuss Drupal in their particular > domains. I would think an equivalent for Cake would bake! > > Stew > > On Nov 25, 2:22 pm, mark_story <[EMAIL PROTECTED]> wrote: > > > Many have tried this and it has not been historically successful. In > > the land of forums there is this group, as well as many language > > specific groups. There is also already http://www.cakephpforum.net/ > > and others. In addition there is the bakery and the cookbook. The > > cookbook is more documentation focused but the bakery facilitates > > articles and case studies and the following discussion quite well. > > > I'm not saying its a bad idea, but instead of attempting fragmenting > > our efforts we should perhaps consolidate them? Focus our efforts on > > enhancing and enriching the already existing resources. And if there > > is a feature that is sorely missing from one of those resources, we > > can add it in. > > > -Mark > > > On Nov 25, 8:19 am, Marcus Silva <[EMAIL PROTECTED]> wrote: > > > > Hi guys, > > > > I am planning on building (maybe) a site for us cakephp users. > > > > I would like to know weather it would be a good idea to build such a > > > site and what type of feature you would suggest. > > > > The question I ask is this, would you use such a site and what would > > > like to see in it? > > > > Any comment will be great appreciated. > > > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Validate before controller
http://book.cakephp.org/view/410/Validating-Data-from-the-Controller On Nov 25, 8:23 am, Razvan Pat <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I've just started developing a website with CakePHP and already hit a > bump. I don't understand why validation is done only when saving the > data to the database. This is a very bad thing because: > - you work with possible invalid data in the controller (let's say > your making a website that calculates things and you want to put just > the result of the operation in the database.. now you are forced to > validate the input in the controller so that you don't get division by > zero, that every input is a number and so on...) > - you are going to do weird hacks for user registration. (hash the > password field but keep the confirm password field intact for > validation.. now validation errors would be displayed for the confirm > password field instead of password. not something you want for a > serious website) > > Now.. did I miss something and there is a way to move validation so > that it runs before the controller? I don't even want the controller > to run if there is a validation error... > > Razvan. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
Router and Pagination
I'm novice. I have read all about route and pagination. I Have 2 simple(?) case about it. In my home page i have a product list. Generated link of HTMLHelper pagination was http://mysite/page:2 (where 2 is a page n°2) but clicking on it don't work properly (error 404). If I manually digit http://mysite/?page=2 it's work fine! why this? and... i want to do this: Pagination in home page i want to do http://mysite/?page=X For tags pagination i want: http://mysite/mytag/?page=2 or best was http://mysite/mytag/2 How i do that? (I work with 1.2) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
I think we should look at Drupal as it's on fire at the moment and it's community is very powerful and empowered by the community tools. The Groups.drupal.org site matches people across sectors and interests with each other and allows them to discuss Drupal in their particular domains. I would think an equivalent for Cake would bake! Stew On Nov 25, 2:22 pm, mark_story <[EMAIL PROTECTED]> wrote: > Many have tried this and it has not been historically successful. In > the land of forums there is this group, as well as many language > specific groups. There is also already http://www.cakephpforum.net/ > and others. In addition there is the bakery and the cookbook. The > cookbook is more documentation focused but the bakery facilitates > articles and case studies and the following discussion quite well. > > I'm not saying its a bad idea, but instead of attempting fragmenting > our efforts we should perhaps consolidate them? Focus our efforts on > enhancing and enriching the already existing resources. And if there > is a feature that is sorely missing from one of those resources, we > can add it in. > > -Mark > > On Nov 25, 8:19 am, Marcus Silva <[EMAIL PROTECTED]> wrote: > > > Hi guys, > > > I am planning on building (maybe) a site for us cakephp users. > > > I would like to know weather it would be a good idea to build such a > > site and what type of feature you would suggest. > > > The question I ask is this, would you use such a site and what would > > like to see in it? > > > Any comment will be great appreciated. > > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
paid consultancy/development/advice
Hi, I'm interested in finding out whether we could get someone from the community to help on an existing application an agency built for us which we want to extend and also run well. The help could range from advice, code review, development to "turnkey" Obviously we'd pay. Stew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
Validate before controller
Hello everyone, I've just started developing a website with CakePHP and already hit a bump. I don't understand why validation is done only when saving the data to the database. This is a very bad thing because: - you work with possible invalid data in the controller (let's say your making a website that calculates things and you want to put just the result of the operation in the database.. now you are forced to validate the input in the controller so that you don't get division by zero, that every input is a number and so on...) - you are going to do weird hacks for user registration. (hash the password field but keep the confirm password field intact for validation.. now validation errors would be displayed for the confirm password field instead of password. not something you want for a serious website) Now.. did I miss something and there is a way to move validation so that it runs before the controller? I don't even want the controller to run if there is a validation error... Razvan. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
On Nov 25, 5:44 pm, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > I've suggested something a while ago for the cookbook, a HOWTO > section, but it was rejected. Maybe that would go well with the quiz > concept? I think I rejected that submission (before the change log existed?). The thing is suggestions are for content, not requests to get someone else to write something :). That may not have been your intention of course, but the submission itself had no real content. I'd suggest getting in touch with John to try and make sure that effort match expectations etc. Cheers, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp with postgresql sequence
You don't need to supply a value for the sequence in the insert. Postgres will take care of that if the table is set up correctly with one column as SERIAL type. Can you show the table creation code? Or, if you can access the database through a terminal in psql, show the output of: \d supplier_master You should only override the default sequence name for Postgres in Cake if you created and named it yourself when you created the table, rather than use the default name given when declaring a column of type SERIAL. Given your table and column name, it will, in fact be called supplier_master_id_seq. If your model doesn't reflect the actual sequence name you're sure to have problems. Did you create the DB schema with Cake? One other thing, though: Cake expects table names to be pluralised (supplier_masters or, if this is a join table, masters_suppliers). On Tue, Nov 25, 2008 at 5:35 AM, ReFeeL <[EMAIL PROTECTED]> wrote: > > Hi, > > I read from many posts about cakephp and postgresql sequence. Most of > them seems implying that the sequence will be used automatically. One > can override the default sequence name by declaring var $sequence = > "new_sequence"; in the model class. > > However, I'm using postgres 8.3 with the latest cakephp rc3. I got > error null value in column "id". As I've check the query shown on the > page, I found that the code try to insert without calling sequence. > It expects the server will generate id automatically. > > I've also try to remove the cache, regenerating model, etc. but still > not work. I'm quite new to postgresql. The table is look simple. > > table name : supplier_master > field : id=integer, supplier_name=charvarying. > > sequence name : supplier_master_id_seq > > Can anybody give me a clue? > > > Thanks in Advance > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-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: java script query
Because the script is no longer running after the window is unloaded. On Tue, Nov 25, 2008 at 5:03 AM, nikunj <[EMAIL PROTECTED]> wrote: > > hi, > i want to call controller action when my web browser is call , for > that i use javascript like: > > Javascript->event('window','unload',$ajax- > >remoteFunction( array( 'url' => array( 'controller' => 'cart', > 'action' => 'check'), 'update' => > 'producttitle','position'=>'replace' ) )); ?> > but this code is not working, > > place give me proper solution for that? > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Comtain, conditions and pagination: correct syntax for conditions
What about this: $paramhotel['Hotelmaster.name LIKE ?'] = array('%'.trim($this->data ['Hotel']['name']).'%'); Should work correctly, put the right quotes in the right places and escape what is necessary. hth grigri On Nov 25, 4:39 pm, "Liebermann, Anja Carolin" <[EMAIL PROTECTED]> wrote: > Hi grigri, > > Thank you for your enlighenting answer. It helped my further understanding of > cake and I found what bugged it (see down below). > > What I need is what your second select example does e.g.: > SELECT Hotel . * , Hotelmaster . * > FROM hotels AS Hotel > LEFT JOIN hotelmasters AS Hotelmaster ON ( Hotelmaster.id = > Hotel.hotelmaster_id ) > WHERE Hotelmaster.name LIKE "%novomar%" > > $this->paginate is at the moment this array: > Array > ( > [limit] => 10 > [order] => Array > ( > [Hotel.name] => asc > [Saison.id] => desc > ) > [contain] => Array > ( > [Hotelmaster] => Array > ( > [conditions] => Array > ( > [Hotelmaster.deleted] => 0 > ) > [Praefix] => Array > ( > [fields] => Array > ( > [0] => Praefix.name > ) > > ) > ) > [0] => Saison > [User] => Array > ( > [fields] => User.name > ) > ) > [url] => Array > ( > [controller] => hotels > [action] => suche > ) > [conditions] => Array > ( > [Hotel.deleted] => 0 > [Hotelmaster.name LIKE] => "%novo%" > ) > ) > > The call of > $hotels = $this->paginate('Hotel'); > > Results in following select satement: > SELECT `Hotel`.`id`, `Hotel`.`buchungscode1`, `Hotel`.`buchungscode2`, > `Hotel`.`buchungscode3`, `Hotel`.`buchungscode4`, `Hotel`.`praefix_id`, > `Hotel`.`name`, `Hotel`.`laengengrad`, `Hotel`.`breitengrad`, > `Hotel`.`ort_id`, `Hotel`.`zielgebiet_id`, `Hotel`.`hotelmaster_id`, > `Hotel`.`kategorie`, `Hotel`.`deleted`, `Hotel`.`inuse`, `Hotel`.`user_id`, > `Hotel`.`sprache_id`, `Hotel`.`saison_id`, `Hotel`.`mandant_id`, > `Hotel`.`zeit`, `Hotel`.`fertig`, `Hotel`.`inuse_zeit`, `Hotelmaster`.`id`, > `Hotelmaster`.`buchungscode1`, `Hotelmaster`.`buchungscode2`, > `Hotelmaster`.`buchungscode3`, `Hotelmaster`.`buchungscode4`, > `Hotelmaster`.`praefix_id`, `Hotelmaster`.`name`, > `Hotelmaster`.`laengengrad`, `Hotelmaster`.`breitengrad`, > `Hotelmaster`.`ortmaster_id`, `Hotelmaster`.`zielgebietmaster_id`, > `Hotelmaster`.`kategorie`, `Hotelmaster`.`exklusiv`, `Hotelmaster`.`deleted`, > `Hotelmaster`.`inuse`, `Hotelmaster`.`user_id`, `Hotelmaster`.`zeit`, > `Hotelmaster`.`inuse_zeit`, `User`.`name`, `Saison`.`id`, `Saison`.`name` > FROM `hotels` AS `Hotel` > LEFT JOIN `hotelmasters` AS `Hotelmaster` ON (`Hotel`.`hotelmaster_id` = > `Hotelmaster`.`id` AND `Hotelmaster`.`deleted` = 0) > LEFT JOIN `users` AS `User` ON (`Hotel`.`user_id` = `User`.`id`) > LEFT JOIN `saisons` AS `Saison` ON (`Hotel`.`saison_id` = `Saison`.`id`) > WHERE `Hotel`.`deleted` = 0 AND `Hotelmaster`.`name` LIKE '\"%novo%\"' > ORDER BY `Hotel`.`name` asc, `Saison`.`id` desc LIMIT 10 > > Which gives me an empty result although one of my linked Hotelmasters has the > name "Novomar". > "Hotelmaster`.`deleted` = 0" is true for all of them at the moment. > > AND HERE COMES THE BUG: > So the problem is '\"%novo%\"' in the result. If I try it with > `Hotelmaster`.`name` LIKE "%novo%" it works. > Phew. > So how do I get the proper search string to my Mysql server? > > At the moment I create the condition like this: > $paramhotel['Hotelmaster.name LIKE'] = > '"%'.trim($this->data['Hotel']['name']).'%"'; > It works when I change it to > $paramhotel['Hotelmaster.name LIKE'] = > '%'.trim($this->data['Hotel']['name']).'%'; > > Thank you a lot for your help grigri! > > Anja > > -Ursprüngliche Nachricht- > Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von grigri > Gesendet: Dienstag, 25. November 2008 15:10 > An: CakePHP > Betreff: Re: Comtain, conditions and pagination: correct syntax for conditions > > Have you tried just putting the conditions in the paginate call? > > class HotelsController extends AppController { > var $paginate = array( > 'Hotel' => array( > 'limit' => 10, > 'contain' => array( > 'Hotelmaster', ... > ) > ) > ); > > function search() { > // Example conditions > $conditions = array( > 'Hotelmaster.deleted' => 0, > 'Hotelmaster.name LIKE ?' => array('%novo%') > ); > $results = $this->paginate('Hotel', $conditions); > } > > } > > Always remember that the `conditions` key in a relation is the join condit
Help with cake and soundmanager2
I'm putting together a cake app with an inline mp3 player using soundmanager2 similar to this demo: http://www.schillmania.com/projects/soundmanager2/demo/page-player/ . I'm using to get the soundmanager2 javascripts into the head, and everything works fine when a page is first pulled up, but when I link to a different controller link('Song by Genre', '/genres/'); ?> or link('All Songs', '/songs/'); ?> from the navigation I put in the default layout, the javascripts are not working properly. Is it possible that cake isn't reloading the entire page. I have view caching turned off site wide. (//core.php Configure::write ('Cache.disable', true);) If I don't use the navigation i put in the default layout and just type the controller and action name into the browser manually it works fine. any help would be much appreciated. I'm stuck. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
I've suggested something a while ago for the cookbook, a HOWTO section, but it was rejected. Maybe that would go well with the quiz concept? On Nov 25, 5:09 pm, Marcus Silva <[EMAIL PROTECTED]> wrote: > I am thinking something along those lines. > > Got some good, concepts already. > > More suggestions please... > > On Nov 25, 3:53 pm, validkeys <[EMAIL PROTECTED]> wrote: > > > Many people learn by example. I have learned quite a lot (not just > > about cake) but about PHP by seeing what other people have done. A > > great resource would be something like a quiz site, where there is a > > new question each day: 1. Program this and people could upload > > their solutions. That could be useful. > > > On Nov 25, 9:22 am, mark_story <[EMAIL PROTECTED]> wrote: > > > > Many have tried this and it has not been historically successful. In > > > the land of forums there is this group, as well as many language > > > specific groups. There is also already http://www.cakephpforum.net/ > > > and others. In addition there is the bakery and the cookbook. The > > > cookbook is more documentation focused but the bakery facilitates > > > articles and case studies and the following discussion quite well. > > > > I'm not saying its a bad idea, but instead of attempting fragmenting > > > our efforts we should perhaps consolidate them? Focus our efforts on > > > enhancing and enriching the already existing resources. And if there > > > is a feature that is sorely missing from one of those resources, we > > > can add it in. > > > > -Mark > > > > On Nov 25, 8:19 am, Marcus Silva <[EMAIL PROTECTED]> wrote: > > > > > Hi guys, > > > > > I am planning on building (maybe) a site for us cakephp users. > > > > > I would like to know weather it would be a good idea to build such a > > > > site and what type of feature you would suggest. > > > > > The question I ask is this, would you use such a site and what would > > > > like to see in it? > > > > > Any comment will be great appreciated. > > > > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
AW: Comtain, conditions and pagination: correct syntax for conditions
Hi grigri, Thank you for your enlighenting answer. It helped my further understanding of cake and I found what bugged it (see down below). What I need is what your second select example does e.g.: SELECT Hotel . * , Hotelmaster . * FROM hotels AS Hotel LEFT JOIN hotelmasters AS Hotelmaster ON ( Hotelmaster.id = Hotel.hotelmaster_id ) WHERE Hotelmaster.name LIKE "%novomar%" $this->paginate is at the moment this array: Array ( [limit] => 10 [order] => Array ( [Hotel.name] => asc [Saison.id] => desc ) [contain] => Array ( [Hotelmaster] => Array ( [conditions] => Array ( [Hotelmaster.deleted] => 0 ) [Praefix] => Array ( [fields] => Array ( [0] => Praefix.name ) ) ) [0] => Saison [User] => Array ( [fields] => User.name ) ) [url] => Array ( [controller] => hotels [action] => suche ) [conditions] => Array ( [Hotel.deleted] => 0 [Hotelmaster.name LIKE] => "%novo%" ) ) The call of $hotels = $this->paginate('Hotel'); Results in following select satement: SELECT `Hotel`.`id`, `Hotel`.`buchungscode1`, `Hotel`.`buchungscode2`, `Hotel`.`buchungscode3`, `Hotel`.`buchungscode4`, `Hotel`.`praefix_id`, `Hotel`.`name`, `Hotel`.`laengengrad`, `Hotel`.`breitengrad`, `Hotel`.`ort_id`, `Hotel`.`zielgebiet_id`, `Hotel`.`hotelmaster_id`, `Hotel`.`kategorie`, `Hotel`.`deleted`, `Hotel`.`inuse`, `Hotel`.`user_id`, `Hotel`.`sprache_id`, `Hotel`.`saison_id`, `Hotel`.`mandant_id`, `Hotel`.`zeit`, `Hotel`.`fertig`, `Hotel`.`inuse_zeit`, `Hotelmaster`.`id`, `Hotelmaster`.`buchungscode1`, `Hotelmaster`.`buchungscode2`, `Hotelmaster`.`buchungscode3`, `Hotelmaster`.`buchungscode4`, `Hotelmaster`.`praefix_id`, `Hotelmaster`.`name`, `Hotelmaster`.`laengengrad`, `Hotelmaster`.`breitengrad`, `Hotelmaster`.`ortmaster_id`, `Hotelmaster`.`zielgebietmaster_id`, `Hotelmaster`.`kategorie`, `Hotelmaster`.`exklusiv`, `Hotelmaster`.`deleted`, `Hotelmaster`.`inuse`, `Hotelmaster`.`user_id`, `Hotelmaster`.`zeit`, `Hotelmaster`.`inuse_zeit`, `User`.`name`, `Saison`.`id`, `Saison`.`name` FROM `hotels` AS `Hotel` LEFT JOIN `hotelmasters` AS `Hotelmaster` ON (`Hotel`.`hotelmaster_id` = `Hotelmaster`.`id` AND `Hotelmaster`.`deleted` = 0) LEFT JOIN `users` AS `User` ON (`Hotel`.`user_id` = `User`.`id`) LEFT JOIN `saisons` AS `Saison` ON (`Hotel`.`saison_id` = `Saison`.`id`) WHERE `Hotel`.`deleted` = 0 AND `Hotelmaster`.`name` LIKE '\"%novo%\"' ORDER BY `Hotel`.`name` asc, `Saison`.`id` desc LIMIT 10 Which gives me an empty result although one of my linked Hotelmasters has the name "Novomar". "Hotelmaster`.`deleted` = 0" is true for all of them at the moment. AND HERE COMES THE BUG: So the problem is '\"%novo%\"' in the result. If I try it with `Hotelmaster`.`name` LIKE "%novo%" it works. Phew. So how do I get the proper search string to my Mysql server? At the moment I create the condition like this: $paramhotel['Hotelmaster.name LIKE'] = '"%'.trim($this->data['Hotel']['name']).'%"'; It works when I change it to $paramhotel['Hotelmaster.name LIKE'] = '%'.trim($this->data['Hotel']['name']).'%'; Thank you a lot for your help grigri! Anja -Ursprüngliche Nachricht- Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von grigri Gesendet: Dienstag, 25. November 2008 15:10 An: CakePHP Betreff: Re: Comtain, conditions and pagination: correct syntax for conditions Have you tried just putting the conditions in the paginate call? class HotelsController extends AppController { var $paginate = array( 'Hotel' => array( 'limit' => 10, 'contain' => array( 'Hotelmaster', ... ) ) ); function search() { // Example conditions $conditions = array( 'Hotelmaster.deleted' => 0, 'Hotelmaster.name LIKE ?' => array('%novo%') ); $results = $this->paginate('Hotel', $conditions); } } Always remember that the `conditions` key in a relation is the join condition (the bit in the 'ON (...)' clause), it doesn't affect the result set. Contrast this (conditions in the relation): SELECT Hotel.*, Hotelmaster.* FROM hotels AS Hotel LEFT JOIN hotelmasters AS Hotelmaster ON (Hotelmaster.id=Hotel.hotelmaster_id AND Hotelmaster.deleted=0) with this (conditions in the find): SELECT Hotel.*, Hotelmaster.* FROM hotels AS Hotel LEFT JOIN hotelmasters AS Hotelmaster ON (Hotelmaster.id=Hotel.hotelmaster_id) WHERE Hotelmaster.deleted=0 See the difference? (Run the queries directly in phpMyAdm
Re: Mambo on CakePHP brainstorm
Based on your stated goals, the two suggestions I would add are: (1) Develop as many of Mambo's features as possible as extensions. This will not only make the CMS itself as flexible as possible (and the CMS's extension API as robust as possible), but it will also help you 'feel the pain' of extension developers as they write new extensions or migrate old ones. (2) Develop as much of the functionality of the Mambo core itself as CakePHP plugins. This will not only make the core easily extensible, but it will enable CakePHP developers to more easily integrate Mambo code within their own applications, and lower the barrier to entry on contributing back to the Mambo core. On Nov 25, 8:16 am, andphe <[EMAIL PROTECTED]> wrote: > Hi James, > > > > > On Nov 25, 1:27 am, James K <[EMAIL PROTECTED]> wrote: > > > > Simple - if you're starting from scratch, seriously start over and > > > rethink a lot of the fundamentals. > > > > Mambo's idea of what content is and how it should be organized within > > > a CMS is very outdated and short sighted. > > > > Joomla's been making a valiant effort to modernize the Mambo codebase, > > > but it still suffers from several of the same fatal flaws in terms of > > > execution. Why in the world can I only organize content 2 levels deep? > > > Why can I only add content to a single category? > > > > In addition, it would be wise to look into broadening Mambo's idea of > > > "content". Drupal does a pretty good job of making it easy to create > > > several different content types (ie blog posts, news items, products, > > > etc) and handle them in different ways without having to make very > > > literal "sections" > > > > Why are the security permissions hard coded? I know Joomla's in the > > > middle of a really messy migration to a proper ACL implementation, but > > > they're not anywhere near close yet. Security roles should be > > > flexible, customizable, granular, and hierarchical. > > > > Mambo's 8 years old now and while it may be tempting to give Mambo's > > > users something very familiar in execution, you'd just be doing the > > > project a disservice by ignoring the vast innovations that have > > > occurred in the CMS space since Mambo was originally architected. > > > > There are lots of good CMSes on the market - both commercial and open > > > source that are doing a lot of really interesting things these days. > > > Do your research, take all the lessons learned from Mambo development > > > over the years and get crackin! Before writing a line of code, you > > > should put a lot of thought and time into the database design. Many > > > fundamental design choices will be made at that point which will be > > > hard to go back on once you've written a significant amount of code. > > > > The more planning you do, the better the end product will be. > > > > Good luck! > > Thanks for all your comments, it sure will be part of our > discussions :) > > we also are interested in to know about the expectations about the CMS > framework, things like: > > Been a cake developer, would you use/integrate your projects in a > cms ? > What must accomplish that cms to be considered in your cake projects ? > > Mambo is not just a CMS but a framework too, it should help the > developers to create his own pieces of software and reuse the ones > that the cms currently have. > > Thanks > > Andrés --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
I am thinking something along those lines. Got some good, concepts already. More suggestions please... On Nov 25, 3:53 pm, validkeys <[EMAIL PROTECTED]> wrote: > Many people learn by example. I have learned quite a lot (not just > about cake) but about PHP by seeing what other people have done. A > great resource would be something like a quiz site, where there is a > new question each day: 1. Program this and people could upload > their solutions. That could be useful. > > On Nov 25, 9:22 am, mark_story <[EMAIL PROTECTED]> wrote: > > > Many have tried this and it has not been historically successful. In > > the land of forums there is this group, as well as many language > > specific groups. There is also already http://www.cakephpforum.net/ > > and others. In addition there is the bakery and the cookbook. The > > cookbook is more documentation focused but the bakery facilitates > > articles and case studies and the following discussion quite well. > > > I'm not saying its a bad idea, but instead of attempting fragmenting > > our efforts we should perhaps consolidate them? Focus our efforts on > > enhancing and enriching the already existing resources. And if there > > is a feature that is sorely missing from one of those resources, we > > can add it in. > > > -Mark > > > On Nov 25, 8:19 am, Marcus Silva <[EMAIL PROTECTED]> wrote: > > > > Hi guys, > > > > I am planning on building (maybe) a site for us cakephp users. > > > > I would like to know weather it would be a good idea to build such a > > > site and what type of feature you would suggest. > > > > The question I ask is this, would you use such a site and what would > > > like to see in it? > > > > Any comment will be great appreciated. > > > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A new cakesite...
Many people learn by example. I have learned quite a lot (not just about cake) but about PHP by seeing what other people have done. A great resource would be something like a quiz site, where there is a new question each day: 1. Program this and people could upload their solutions. That could be useful. On Nov 25, 9:22 am, mark_story <[EMAIL PROTECTED]> wrote: > Many have tried this and it has not been historically successful. In > the land of forums there is this group, as well as many language > specific groups. There is also already http://www.cakephpforum.net/ > and others. In addition there is the bakery and the cookbook. The > cookbook is more documentation focused but the bakery facilitates > articles and case studies and the following discussion quite well. > > I'm not saying its a bad idea, but instead of attempting fragmenting > our efforts we should perhaps consolidate them? Focus our efforts on > enhancing and enriching the already existing resources. And if there > is a feature that is sorely missing from one of those resources, we > can add it in. > > -Mark > > On Nov 25, 8:19 am, Marcus Silva <[EMAIL PROTECTED]> wrote: > > > Hi guys, > > > I am planning on building (maybe) a site for us cakephp users. > > > I would like to know weather it would be a good idea to build such a > > site and what type of feature you would suggest. > > > The question I ask is this, would you use such a site and what would > > like to see in it? > > > Any comment will be great appreciated. > > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How should I associate these tables?
I assume in that case you'll need to create a model for your join table (which is otherwise created for you)... and specify which schema (db) it uses. Otherwise, if you can, move them all to the same schema. On Nov 25, 7:55 am, Antônio Marco <[EMAIL PROTECTED]> wrote: > Thanks, teknoid! > > But now I'm having a new problem... My applications uses tables > separated in different schemas. These tables are related one each > other as shown above. > > I'm trying the HBTM association between "geo.plots" and > "dme.addresses" tables. I created the "geo.addresses_plots" table but > when I run my application I receives the message bellow: > > Warning (2): pg_query() [function.pg-query]: Query failed: ERRO: > relation "addresses_plots" do not exists [CORE.rc2/libs/model/ > datasources/dbo/dbo_postgres.php, line 152] > > Can you help me once more? > > I hope so. > > On 24 nov, 18:50, teknoid <[EMAIL PROTECTED]> wrote: > > > This is a basic HABTM (hasAndBelongsToMany) relationship. > > Read up on it in the manual... you should also rename the join table > > (if you'd like to keep consistent with conventions). > > > On Nov 24, 2:40 pm, Antônio Marco <[EMAIL PROTECTED]> wrote: > > > > Hi folks! > > > > I created 3 tables as shown bellow: > > > > CREATE TABLE geo.plots > > > ( > > > id serial NOT NULL, > > > created timestamp, > > > modified timestamp, > > > > the_geom varchar(255), > > > > inscricao_imobiliaria varchar(14) NOT NULL, > > > > quadra varchar(10), > > > lote smallint, > > > > numero_residencial_previo smallint, > > > > PRIMARY KEY (id) > > > ) > > > WITH OIDS; > > > > CREATE TABLE geo.plot_addresses > > > ( > > > id serial NOT NULL, > > > created timestamp, > > > modified timestamp, > > > > plot_id int NOT NULL, > > > address_id int NOT NULL, > > > > endereco_principal bool NOT NULL DEFAULT true, > > > > PRIMARY KEY (id), > > > FOREIGN KEY (plot_id) REFERENCES geo.plots (id), > > > FOREIGN KEY (address_id) REFERENCES dme.addresses (id) > > > ) > > > WITH OIDS; > > > > CREATE TABLE dme.addresses > > > ( > > > id serial NOT NULL, > > > created timestamp, > > > modified timestamp, > > > > habilitado bool NOT NULL DEFAULT true, > > > > street_postal_code_id int NOT NULL, > > > parent_id int, > > > > complemento bool NOT NULL DEFAULT false, > > > > numero smallint, > > > > bloco varchar(10), > > > andar smallint, > > > unidade smallint, > > > > posicao smallint, > > > > caixa_postal smallint, > > > > complemento_livre varchar(255), > > > > PRIMARY KEY (id), > > > > FOREIGN KEY (street_postal_code_id) REFERENCES > > > dme.street_postal_codes (id), > > > FOREIGN KEY (parent_id) REFERENCES dme.addresses (id) > > > ) > > > WITH OIDS; > > > > They are associated as shown bellow: > > > > // > > > class Plot extends AppModel { > > > var $name = 'Plot'; > > > > var $useDbConfig = 'geo'; > > > > var $hasMany = array( > > > 'PlotAddresses' => array( > > > 'className' => 'PlotAddress', > > > 'foreignKey' => 'plot_id' > > > ) > > > ); > > > > } > > > > // > > > class PlotAddress extends AppModel { > > > var $name = 'PlotAddress'; > > > > var $useDbConfig = 'geo'; > > > > var $belongsTo = array( > > > 'Plot' => array( > > > 'className' => 'Plot', > > > 'foreignKey' => 'plot_id' > > > ), > > > > 'Address' => array( > > > 'className' => 'Address', > > > 'foreignKey' => 'address_id' > > > ) > > > ); > > > > } > > > > // > > > class Address extends AppModel { > > > var $name = 'Address'; > > > > var $useDbConfig = 'dme'; > > > > var $hasOne = array( > > > 'PlotAddress' => array( > > > 'className' => 'PlotAddress', > > > 'foreignKey' => 'address_id' > > > ) > > > ); > > > > } > > > > I have used Scaffolding in this application but when I run the index > > > of PlotAddresses, I receive the message bellow: > > > > Notice (8): Undefined index: Address [CORE.rc2/libs/view/scaffolds/ > > > index.ctp, line 81] > > > > Verifing the line, I saw that the problem is related to "belongTo" > > > association. > > > > Can anybody help me to solve this problem? Is my association > > > inco
Re: Parameter passing in URL
Hi Daniel, You need to then add the ID as a hidden input for the form. This way the value of the ID is included in the posted data, and any validation attempts. After a successful form entry the controllers action would perform a redirect to insert the ID back into the URL. function post() { if(!empty($this->data)) { $this->redirect('/somewhere?id='.$this->data['Model']['id']); } } On Nov 25, 8:27 am, Daniel Süpke <[EMAIL PROTECTED]> wrote: > Hi Mathew, > > thanks for the help (and sorry for the delay in answering). That's a > good idea and I followed your advise, but still one problem persists: > If, in step 3 there is something wrong in validation, cake will return > to the form again. But now, the ID is no longer in the URL, so there is > an error about that. > > I think, passing a parameter along the URL is a pretty common task, > isn't it? There should be more support for that in cake. For example, if > I add it to the form action (helper), cake gets all confused about it. > Yet, that would be the simplest solution. > > Best Regards, > Daniel Süpke > > Mathew wrote: > > Hi Daniel, > > > You want to include the ID in the URL so that it persists when > > bookmarked, and using a session doesn't provide that feature. > > > I understand what your trying to do, but the form action does not > > require the ID to be included, because posted form requests first > > require an HTML page to display the form. > > > Let me example. > > > 1) User follows a link with the ID. > > 2) HTML with the form is shown in the browser, with the ID in the URL. > > 3) User enters form data, and submits the form. > > 4) A response from the server is shown to the user. > > > In step #2 when the form is displayed. You should take the ID from the > > URL and add it as a hidden field in the form. > > In step #3 the action that handles the form request does not need the > > ID in the URL because it will be in the posted data. > > In step #4 as part of the response you redirect the user to a URL that > > contains the ID. > > > Also. > > > I would create a simple Helper object for your views. Not one that > > creates an HTML link, because Cake comes with Form and Html helpers to > > do that. All you need to do is modified a Router array to include the > > ID > > > for example; > > > $html->link('Somewhere',$myhelper- > >> id(array('controller'=>'documents','action'=>'show'))); > > > You create a helper called Myhelper, and add a function called "id" > > that injects your ID from the URL into the array. Now you can call all > > various helper objects that require routed links. > > > I think you can inject the ID as a get request like this (I can't > > remember how to handle gets with params, but I think its like this) > > > function id( $arr ) > > { > > $arr['?'] = array('id'=>$this->params['id']); > > } > > > That should provide Html that looks like this in your view > > > Somewhere --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
AW: 1 form, multiple actions
Hi Josey, You are welcome! I am happy to contribute something here, after I am getting so much here myself! Anja -Ursprüngliche Nachricht- Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Josey Gesendet: Dienstag, 25. November 2008 15:28 An: CakePHP Betreff: Re: 1 form, multiple actions Anja, wanted to get back with you. I modified my action based upon your recommendation and it worked swimmingly! Thanks for your help. On Nov 25, 1:53 am, "Liebermann, Anja Carolin" <[EMAIL PROTECTED]> wrote: > Hi Josey, > > I had the same problem. I needed two submit buttons with different actions > behind it. What I did: > > In the view: > > echo $form->submit('saveandleave', array('div'=>false, > 'name'=>'saveandleave', 'value'=>'saveandleave')); echo ' '; echo > $form->submit('onlysave', array('div'=>false, 'name'=>'onlysave', > 'value'=>'onlysave')); echo $form->end();?> > > In the controller it goes to one action, but forks there depending on the > parameter: > if ($this->Mymodel->save($this->data)) { > $this->Session->setFlash(__('data > saved', true)); //here comes the fork: > if($this->params['form']['save'] == > 'saveandleave') { > > $this->redirect(array('action'=>'index')); > } elseif($this->params['form']['save'] > == 'onlysave') { > > Hope that helps > > Anja > > -Ursprüngliche Nachricht- > Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im > Auftrag von Josey > Gesendet: Montag, 24. November 2008 23:40 > An: CakePHP > Betreff: 1 form, multiple actions > > Is it possible to have multiple controller actions in one form? > > What I'm trying to do is this: > > I have a form that lists all my posts, if you're logged in as admin you get a > checkbox beside every post. > You would select these checkboxes to perform certain actions. > > As of right now I have it pointing towards my delete action to remove > multiple rows in the database at once. Works like a charm. > > What I struggle with is the fact that "Publish/unpublish" will also be an > option alongside "Delete" so how do I tell the form what action the button is > supposed to take? > > Thanks to all. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: 1 form, multiple actions
I hear you there, this group has saved me hours of extra debugging. I dance when I'm able to contribute something back. On Nov 25, 8:54 am, "Liebermann, Anja Carolin" <[EMAIL PROTECTED]> wrote: > Hi Josey, > > You are welcome! > I am happy to contribute something here, after I am getting so much here > myself! > > Anja > > -Ursprüngliche Nachricht- > Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Josey > Gesendet: Dienstag, 25. November 2008 15:28 > An: CakePHP > Betreff: Re: 1 form, multiple actions > > Anja, wanted to get back with you. > > I modified my action based upon your recommendation and it worked swimmingly! > > Thanks for your help. > > On Nov 25, 1:53 am, "Liebermann, Anja Carolin" > > <[EMAIL PROTECTED]> wrote: > > Hi Josey, > > > I had the same problem. I needed two submit buttons with different actions > > behind it. What I did: > > > In the view: > > > > echo $form->submit('saveandleave', array('div'=>false, > > 'name'=>'saveandleave', 'value'=>'saveandleave')); echo ' '; echo > > $form->submit('onlysave', array('div'=>false, 'name'=>'onlysave', > > 'value'=>'onlysave')); echo $form->end();?> > > > In the controller it goes to one action, but forks there depending on the > > parameter: > > if ($this->Mymodel->save($this->data)) { > > $this->Session->setFlash(__('data > > saved', true)); //here comes the fork: > > if($this->params['form']['save'] == > > 'saveandleave') { > > > > $this->redirect(array('action'=>'index')); > > } elseif($this->params['form']['save'] > > == 'onlysave') { > > > > Hope that helps > > > Anja > > > -Ursprüngliche Nachricht- > > Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im > > Auftrag von Josey > > Gesendet: Montag, 24. November 2008 23:40 > > An: CakePHP > > Betreff: 1 form, multiple actions > > > Is it possible to have multiple controller actions in one form? > > > What I'm trying to do is this: > > > I have a form that lists all my posts, if you're logged in as admin you get > > a checkbox beside every post. > > You would select these checkboxes to perform certain actions. > > > As of right now I have it pointing towards my delete action to remove > > multiple rows in the database at once. Works like a charm. > > > What I struggle with is the fact that "Publish/unpublish" will also be an > > option alongside "Delete" so how do I tell the form what action the button > > is supposed to take? > > > Thanks to all. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 to check the path of your cache view in the source code?
yes, it was included, as mentioned it was working in testing server, but not in production environment with the same code, i suspect somehow the path to write the cache file to tmp/cache/views was not set correctly, but i dont know where to find it in the cakephp source code On Nov 25, 5:54 pm, Kyo <[EMAIL PROTECTED]> wrote: > Did you include the CacheHelper in your $helpers array? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: 3 ajax selects
Can you please post your code :) On Nov 23, 10:50 am, haj <[EMAIL PROTECTED]> wrote: > Ok, another attempt to pull some wisdom. > > observeField is so great, it makes ajax 'just works.' > > Select A changes the content of select B on the fly beautifully, until > I have to add select C. So, select A changes select B, then select B > changes select C is no problem, it's no different from select A > changes select B. > > Now, after select B changed select C, if I now change select A again, > I need to reset not only select B but also select C. I have no idea > how I can 'reset' select C via observeField. > > Is there any simple way to do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 1 form, multiple actions
Anja, wanted to get back with you. I modified my action based upon your recommendation and it worked swimmingly! Thanks for your help. On Nov 25, 1:53 am, "Liebermann, Anja Carolin" <[EMAIL PROTECTED]> wrote: > Hi Josey, > > I had the same problem. I needed two submit buttons with different actions > behind it. What I did: > > In the view: > > echo $form->submit('saveandleave', array('div'=>false, > 'name'=>'saveandleave', 'value'=>'saveandleave')); > echo ' '; > echo $form->submit('onlysave', array('div'=>false, 'name'=>'onlysave', > 'value'=>'onlysave')); > echo $form->end();?> > > In the controller it goes to one action, but forks there depending on the > parameter: > if ($this->Mymodel->save($this->data)) { > $this->Session->setFlash(__('data saved', > true)); > //here comes the fork: > if($this->params['form']['save'] == > 'saveandleave') { > > $this->redirect(array('action'=>'index')); > } elseif($this->params['form']['save'] == > 'onlysave') { > > Hope that helps > > Anja > > -Ursprüngliche Nachricht- > Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Josey > Gesendet: Montag, 24. November 2008 23:40 > An: CakePHP > Betreff: 1 form, multiple actions > > Is it possible to have multiple controller actions in one form? > > What I'm trying to do is this: > > I have a form that lists all my posts, if you're logged in as admin you get a > checkbox beside every post. > You would select these checkboxes to perform certain actions. > > As of right now I have it pointing towards my delete action to remove > multiple rows in the database at once. Works like a charm. > > What I struggle with is the fact that "Publish/unpublish" will also be an > option alongside "Delete" so how do I tell the form what action the button is > supposed to take? > > Thanks to all. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
Many have tried this and it has not been historically successful. In the land of forums there is this group, as well as many language specific groups. There is also already http://www.cakephpforum.net/ and others. In addition there is the bakery and the cookbook. The cookbook is more documentation focused but the bakery facilitates articles and case studies and the following discussion quite well. I'm not saying its a bad idea, but instead of attempting fragmenting our efforts we should perhaps consolidate them? Focus our efforts on enhancing and enriching the already existing resources. And if there is a feature that is sorely missing from one of those resources, we can add it in. -Mark On Nov 25, 8:19 am, Marcus Silva <[EMAIL PROTECTED]> wrote: > Hi guys, > > I am planning on building (maybe) a site for us cakephp users. > > I would like to know weather it would be a good idea to build such a > site and what type of feature you would suggest. > > The question I ask is this, would you use such a site and what would > like to see in it? > > Any comment will be great appreciated. > > 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Field formatting based on MySQL fields type
Yeah man i almost did it :) here's a snippet, maybe some1 else needs that code in future class AppModel extends Model { function beforeValidate() { foreach ($this->data as &$model) { foreach ($model as $fieldname => &$value) { switch ($this->getColumnType($fieldname)) { case "float": $value = str_replace(",", ".", $value); break; case "date": case "datetime": $value = data_IT_to_US($value); break; default: } } } return true; } } Now i'm working on data_IT_to_US() (looking for a smart & easy method) :) On 25 Nov, 09:51, Adam Royle <[EMAIL PROTECTED]> wrote: > I do a similar thing in my AppModel. Look at the Model methods and > also pr($this) in your AppModel to see what data you can access, etc. > You can get all thefieldnames and types easily using $this->schema() > or $this->getColumnTypes(). > > Cheers, > Adam > > On Nov 25, 2:34 am, Ernesto <[EMAIL PROTECTED]> wrote: > > > > > Hello. > > > My goal is to provide adefaultformatting, based on MySQL's fields > > types because > > the webapp i'm baking uses some differrentfieldformatthan MySQL. > > For ex: > > - Dates are "dd/mm/" instead of MySQL's "-mm-dd" > > - Floating point numbers uses commas instead of dots as decimal > > separator > > > I've made a FieldFormatHelper, called in every controller's > > beforeValidate() function but that's not very handy because i need a > > rule for everyfield. > > > So i tried to process fields in AppModel's beforeValidate() but i > > can't get the code to work. > > > How can i do? > > Is there a better way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Advanced Routes
You should be able to do something like: Router::connect('/:username/:controller/:action/*', array(), array('username' => '[a-z0-9]*')) Read through this: http://book.cakephp.org/view/542/Defining-Routes The most relevant examples are down the bottom, but work your way from the top, and try some similar routing examples that are relevant to your particular app. Best fo luck, and be sure to let us know how you go. Cheers, Graham BeroFX wrote: > Hi guys! > > Imagine you have a standard social network with users who can have > blogs, pictures and videos. > > I need to setup my routes like this: > > http://www.mysite.com/michael --> this is like / > users/view/123 > http://www.mysite.com/michael/videos/123 --> this would show > michaels video number 123 > http://www.mysite.com/michael/pictures/ --> this would be like > michaels /pictures/index > > Any 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CakePHP bbCode Helper
Hello, I've seen some reference to bbCode helper in Cakephp. Even the bakery has this feature. I did track a previous post in the group, but the url it refers to no longer seems valid. Can anyone point me in the right direction? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
> A forum, Cake needs a decent forum (www.cakephpforum.net is offline > 90% of the time), erm, we have the group - why splinter things? > a knowledge base with snippets and articles.. is that what the Bakery and Cookbook are for? jb -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Comtain, conditions and pagination: correct syntax for conditions
Have you tried just putting the conditions in the paginate call? class HotelsController extends AppController { var $paginate = array( 'Hotel' => array( 'limit' => 10, 'contain' => array( 'Hotelmaster', ... ) ) ); function search() { // Example conditions $conditions = array( 'Hotelmaster.deleted' => 0, 'Hotelmaster.name LIKE ?' => array('%novo%') ); $results = $this->paginate('Hotel', $conditions); } } Always remember that the `conditions` key in a relation is the join condition (the bit in the 'ON (...)' clause), it doesn't affect the result set. Contrast this (conditions in the relation): SELECT Hotel.*, Hotelmaster.* FROM hotels AS Hotel LEFT JOIN hotelmasters AS Hotelmaster ON (Hotelmaster.id=Hotel.hotelmaster_id AND Hotelmaster.deleted=0) with this (conditions in the find): SELECT Hotel.*, Hotelmaster.* FROM hotels AS Hotel LEFT JOIN hotelmasters AS Hotelmaster ON (Hotelmaster.id=Hotel.hotelmaster_id) WHERE Hotelmaster.deleted=0 See the difference? (Run the queries directly in phpMyAdmin to see) If you're having trouble, first unbind everything you don't need. Contain only the important models, make it work, then add the others back one by one. Also, please paste the SQL logs you're getting. It makes diagnosing the problem a lot easier :) hth grigri On Nov 25, 1:42 pm, "Liebermann, Anja Carolin" <[EMAIL PROTECTED]> wrote: > Hi everybody, > > I am trying to program a search with contain since nearly a week now and > I still don't get it right. > > What I want to do: > > Hotel belongsto Hotelmaster (Hotel is a kind of blueprint of > Hotelmaster) > I search for Hotel and want only to find datasets where the related > Hotelmaster fulfills certain conditions. > To make it worse the result should be paginated. > > What I have now in my hotels_controller.php is: > > $this->paginate['Hotel'] = array( > 'limit' => 10, > 'order' => array ('Hotel.name' => 'asc', > 'Saison.id' => 'desc'), > 'url' => $paginator_params, > 'condition' => $paramhotel, > 'contain'=> array( > 'Hotelmaster'=> array( 'conditions'=> > $parammaster, > > 'Praefix'=>array('fields'=>array('Praefix.name'))), > 'Town'=> array('fields'=> > array('Town.name','Town.id')), > 'Praefix', //and some more models of no interest > 'User'=> array('fields'=> 'User.name')) > ); > > $parammaster is an array depending on my search criteria and can look > like (simple example): > Array > ( > [Hotelmaster.deleted =] => 0 > [Hotelmaster.name LIKE] => "%Novo%" > ) > > I am not sure if the syntax of my conditions is correct. In some > examples I find on the net the syntax of the conditions within the > contain statement differ from the "normal" conditions. And to make > things worse the whole thing is in a "paginate" and not a "find". > > At the moment any search critera have no effect on my search. When I > change the search criteria to something like this > ( > Hotelmaster.deleted = 0 > Hotelmaster.name LIKE "%Novo%" > ) > > I get 5 search results when having only 2 datasets in my database. Very > weird. > > What would be the correct syntax for my $parammaster searchconditions? > > Thank you for any help > > Anja --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: calling exit() after redirect STILL redirects
There is no $this->exit() function. Perhaps you are thinking of $this- >_stop()? Also in 1.2 there is no need to manually call exit(). It is called automatically by redirect(). Your redirect call seems suspect as well. I would just use $this- >redirect('/users/login'); Of course it is always better to use array urls. -Mark On Nov 24, 4:34 pm, _Z <[EMAIL PROTECTED]> wrote: > Hello, > > I am redirecting a user to a login page after they register for an > account. A message is displayed to login with their new credentials. > However when the form is submitted to login, they are instead > redirected back to the register view. > > It would appear that code after the redirect() call is running, but I > call $this->exit() as instructed. > > I am completely stuck on this one! :p > > Sample code: > > function register() { > if (!empty($this->data)) { > > #process the data from POST. Check to see if hashed > values match > if ($this->data['User']['password'] == $this->Auth- > > >password($this->data['User']['password_confirm'])) { > > #create a new object > $this->User->create(); > > #apply this new data > $this->User->save($this->data); > > #these params in redirect will exit function > $this->Session->setFlash('Account created succesfully. > Please log in'); > $this->redirect('/users/login', null, $status = true); > $this->exit(); > } > > else { > #if dont match flash on screen and redirect > #$this->flash('passwords need to match','/user/ > register'); > $this->Session->setFlash('passwords need to match'); > > } > #empty data, this is fine. > } > > }#end register --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: 1 form, multiple actions
Brilliant Anja! That logic seems perfect! I'll give it a shot and get back with you on how affective it was for me. Thanks all. On Nov 25, 1:53 am, "Liebermann, Anja Carolin" <[EMAIL PROTECTED]> wrote: > Hi Josey, > > I had the same problem. I needed two submit buttons with different actions > behind it. What I did: > > In the view: > > echo $form->submit('saveandleave', array('div'=>false, > 'name'=>'saveandleave', 'value'=>'saveandleave')); > echo ' '; > echo $form->submit('onlysave', array('div'=>false, 'name'=>'onlysave', > 'value'=>'onlysave')); > echo $form->end();?> > > In the controller it goes to one action, but forks there depending on the > parameter: > if ($this->Mymodel->save($this->data)) { > $this->Session->setFlash(__('data saved', > true)); > //here comes the fork: > if($this->params['form']['save'] == > 'saveandleave') { > > $this->redirect(array('action'=>'index')); > } elseif($this->params['form']['save'] == > 'onlysave') { > > Hope that helps > > Anja > > -Ursprüngliche Nachricht- > Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Josey > Gesendet: Montag, 24. November 2008 23:40 > An: CakePHP > Betreff: 1 form, multiple actions > > Is it possible to have multiple controller actions in one form? > > What I'm trying to do is this: > > I have a form that lists all my posts, if you're logged in as admin you get a > checkbox beside every post. > You would select these checkboxes to perform certain actions. > > As of right now I have it pointing towards my delete action to remove > multiple rows in the database at once. Works like a charm. > > What I struggle with is the fact that "Publish/unpublish" will also be an > option alongside "Delete" so how do I tell the form what action the button is > supposed to take? > > Thanks to all. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
A forum would be quite good, but I want something better than a forum. Any more suggestions bakers On Nov 25, 1:24 pm, BeroFX <[EMAIL PROTECTED]> wrote: > A forum, Cake needs a decent forum (www.cakephpforum.netis offline > 90% of the time), > a knowledge base with snippets and articles.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: "Yet another auth/ACL" or "I'm too dumb to undestand cakephp acl"
I've already stumble upon littlehar tutorials. Regarding the password, I've managed that also. Authentication is working fine now. used the Security::setHash("md5"); entry on the app controller. and tha table has a confortable varchar(100) so the lenght of the string will be no problem. Ricardo On Tue, Nov 25, 2008 at 1:48 PM, Liebermann, Anja Carolin < [EMAIL PROTECTED]> wrote: > Hi Zen, > > I had the same trouble like you had. So I pass on Dardos good advice: Start > with a simple testapplication following this tutorial: > http://book.cakephp.org/view/641/Simple-Acl-controlled-Application > > and do a bit reading here: > http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/ > > When you have the example application working transfer parts of it to your > application. And don't forget: by default Auth uses sha1 and not md5 so you > might have to change your database structure as well to accomodate the > longer Password strings. > > Hope this helps and good luck! > > Anja > > > -- > *Von:* cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] *Im > Auftrag von *Ricardo Valfreixo > *Gesendet:* Dienstag, 25. November 2008 14:40 > *An:* cake-php@googlegroups.com > *Betreff:* "Yet another auth/ACL" or "I'm too dumb to undestand cakephp > acl" > > I simpy can't understant auth/ACL system. I can manage to get my user > authenticated (woohooo) but I can't seem to setup properly the ACL system. > > I want to group up users. That way I can give permissions to a group > creating a profile system. I currently have 5 diferent roles: > > >- sysadmin - this can see everything. it's a group i'll reserve to >configure the app in runtime >- admins - business layer. company workers >- associates - affiliate users. this is a broker system so other >companies can put their offer on the platform. >- users - this will be registered people from the general public >- guests - all unregistered users (don't know if this is a profile or >not) > > sysadmin, admins and associates will have a dedicated backoffice. users > will have a profile page and guests will only be allowed at the public pages > (articles and basic search) > > I've read a lot of articles in blogs and in documentention but can't seem > to find a working solution (or at least I'm not smart enough to get it to > work) > > So what I'm doing is: > > >1. Got a users table. Autentication's already working. Salt is empty >and I'm md5'ing the password at appcontroler and user model level. >2. got a groups table that joins with the users table using hasmany and >belongsto binding at model level. >3. I guess I need some table that lists all the actions in the app >right? I'm really puzzled with this. >4. After that I would need a table that joins permissions and groups >using correspondent id's right? >5. I'll need something in the controller to tell it to check the acl >table and see if the logged in user is authorized (or not) to visit that >specific controller/action. >6. also at view level I'll need this information to build dynamic >menus. Don't want to show what users ar not allowed to see. Or should I do >this at controller level and send a list of available actions to the view >via set? >7. also need the user info at the view to show name and other table >info. > > I know this is the million dollar issue. I've seen thousands of articles > talking about this on the internet. And yes, I've read the articles and the > documentation. I really need help on this please. I'm going in circles with > problem for the past 4 days. My project is slipping and I'm already facing a > time problem. > > Thank you so much in advance for any help you can give me. > > > Ricardo > > > > -- > *Ricardo 'Zen' Valfreixo* > Freelance Web Developer > > > *Contacts:* > E-Mail, Gtalk, MSN: [EMAIL PROTECTED] > *Web:* > http://www.minimalisticstudios.com > http://umcigarritoparadescontrair.blogspot.com > *Twitter:* > http://www.twitter.com/minimalistic > > > > -- Ricardo 'Zen' Valfreixo Freelance Web Developer Contacte-me: E-Mail, Gtalk, MSN: [EMAIL PROTECTED] Web: http://www.minimalisticstudios.com http://umcigarritoparadescontrair.blogspot.com Twitter: http://www.twitter.com/minimalistic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
AW: "Yet another auth/ACL" or "I'm too dumb to undestand cakephp acl"
Hi Zen, I had the same trouble like you had. So I pass on Dardos good advice: Start with a simple testapplication following this tutorial: http://book.cakephp.org/view/641/Simple-Acl-controlled-Application and do a bit reading here: http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tu torial-for-using-cakephps-auth-component/ When you have the example application working transfer parts of it to your application. And don't forget: by default Auth uses sha1 and not md5 so you might have to change your database structure as well to accomodate the longer Password strings. Hope this helps and good luck! Anja Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Ricardo Valfreixo Gesendet: Dienstag, 25. November 2008 14:40 An: cake-php@googlegroups.com Betreff: "Yet another auth/ACL" or "I'm too dumb to undestand cakephp acl" I simpy can't understant auth/ACL system. I can manage to get my user authenticated (woohooo) but I can't seem to setup properly the ACL system. I want to group up users. That way I can give permissions to a group creating a profile system. I currently have 5 diferent roles: * sysadmin - this can see everything. it's a group i'll reserve to configure the app in runtime * admins - business layer. company workers * associates - affiliate users. this is a broker system so other companies can put their offer on the platform. * users - this will be registered people from the general public * guests - all unregistered users (don't know if this is a profile or not) sysadmin, admins and associates will have a dedicated backoffice. users will have a profile page and guests will only be allowed at the public pages (articles and basic search) I've read a lot of articles in blogs and in documentention but can't seem to find a working solution (or at least I'm not smart enough to get it to work) So what I'm doing is: 1. Got a users table. Autentication's already working. Salt is empty and I'm md5'ing the password at appcontroler and user model level. 2. got a groups table that joins with the users table using hasmany and belongsto binding at model level. 3. I guess I need some table that lists all the actions in the app right? I'm really puzzled with this. 4. After that I would need a table that joins permissions and groups using correspondent id's right? 5. I'll need something in the controller to tell it to check the acl table and see if the logged in user is authorized (or not) to visit that specific controller/action. 6. also at view level I'll need this information to build dynamic menus. Don't want to show what users ar not allowed to see. Or should I do this at controller level and send a list of available actions to the view via set? 7. also need the user info at the view to show name and other table info. I know this is the million dollar issue. I've seen thousands of articles talking about this on the internet. And yes, I've read the articles and the documentation. I really need help on this please. I'm going in circles with problem for the past 4 days. My project is slipping and I'm already facing a time problem. Thank you so much in advance for any help you can give me. Ricardo -- Ricardo 'Zen' Valfreixo Freelance Web Developer Contacts: E-Mail, Gtalk, MSN: [EMAIL PROTECTED] Web: http://www.minimalisticstudios.com http://umcigarritoparadescontrair.blogspot.com Twitter: http://www.twitter.com/minimalistic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
Comtain, conditions and pagination: correct syntax for conditions
Hi everybody, I am trying to program a search with contain since nearly a week now and I still don't get it right. What I want to do: Hotel belongsto Hotelmaster (Hotel is a kind of blueprint of Hotelmaster) I search for Hotel and want only to find datasets where the related Hotelmaster fulfills certain conditions. To make it worse the result should be paginated. What I have now in my hotels_controller.php is: $this->paginate['Hotel'] = array( 'limit' => 10, 'order' => array ('Hotel.name' => 'asc', 'Saison.id' => 'desc'), 'url' => $paginator_params, 'condition' => $paramhotel, 'contain'=> array( 'Hotelmaster'=> array( 'conditions'=> $parammaster, 'Praefix'=>array('fields'=>array('Praefix.name'))), 'Town'=> array('fields'=> array('Town.name','Town.id')), 'Praefix', //and some more models of no interest 'User'=> array('fields'=> 'User.name')) ); $parammaster is an array depending on my search criteria and can look like (simple example): Array ( [Hotelmaster.deleted =] => 0 [Hotelmaster.name LIKE] => "%Novo%" ) I am not sure if the syntax of my conditions is correct. In some examples I find on the net the syntax of the conditions within the contain statement differ from the "normal" conditions. And to make things worse the whole thing is in a "paginate" and not a "find". At the moment any search critera have no effect on my search. When I change the search criteria to something like this ( Hotelmaster.deleted = 0 Hotelmaster.name LIKE "%Novo%" ) I get 5 search results when having only 2 datasets in my database. Very weird. What would be the correct syntax for my $parammaster searchconditions? Thank you for any help Anja --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
"Yet another auth/ACL" or "I'm too dumb to undestand cakephp acl"
I simpy can't understant auth/ACL system. I can manage to get my user authenticated (woohooo) but I can't seem to setup properly the ACL system. I want to group up users. That way I can give permissions to a group creating a profile system. I currently have 5 diferent roles: - sysadmin - this can see everything. it's a group i'll reserve to configure the app in runtime - admins - business layer. company workers - associates - affiliate users. this is a broker system so other companies can put their offer on the platform. - users - this will be registered people from the general public - guests - all unregistered users (don't know if this is a profile or not) sysadmin, admins and associates will have a dedicated backoffice. users will have a profile page and guests will only be allowed at the public pages (articles and basic search) I've read a lot of articles in blogs and in documentention but can't seem to find a working solution (or at least I'm not smart enough to get it to work) So what I'm doing is: 1. Got a users table. Autentication's already working. Salt is empty and I'm md5'ing the password at appcontroler and user model level. 2. got a groups table that joins with the users table using hasmany and belongsto binding at model level. 3. I guess I need some table that lists all the actions in the app right? I'm really puzzled with this. 4. After that I would need a table that joins permissions and groups using correspondent id's right? 5. I'll need something in the controller to tell it to check the acl table and see if the logged in user is authorized (or not) to visit that specific controller/action. 6. also at view level I'll need this information to build dynamic menus. Don't want to show what users ar not allowed to see. Or should I do this at controller level and send a list of available actions to the view via set? 7. also need the user info at the view to show name and other table info. I know this is the million dollar issue. I've seen thousands of articles talking about this on the internet. And yes, I've read the articles and the documentation. I really need help on this please. I'm going in circles with problem for the past 4 days. My project is slipping and I'm already facing a time problem. Thank you so much in advance for any help you can give me. Ricardo -- *Ricardo 'Zen' Valfreixo* Freelance Web Developer *Contacts:* E-Mail, Gtalk, MSN: [EMAIL PROTECTED] *Web:* http://www.minimalisticstudios.com http://umcigarritoparadescontrair.blogspot.com *Twitter:* http://www.twitter.com/minimalistic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Parameter passing in URL
Hi, thanks for your support. I think Mathew got it pretty good, let's say I want to safe the parameter in the URL for bookmarking. Also, the user can have some tabs open with different IDs (actually, location IDs he can change at any time). Best Regards, Daniel RyOnLife wrote: > > Daniel, I'm a big fan of Firecake. Big time saver!! > > Back to your problem: You've described it in pretty general terms, which I > think is usually a good idea for posting in a forum. In this case though, > maybe if you provided some background and gave more specifics on what you're > trying to do, myself or others could help you think through the logic. Some > for the issue with IDs/tabs would be helpful. > > -Ryan > > > > Feanor's Curse wrote: >> >> Well, thanks for the tool RyOnLife, that's very nice indeed. Yet, I do >> not see how this will solve the general problem. There is an ID which >> has to be assigned to every page. The user can change this ID, but this >> should not affect any opened tabs, where he still must be able to >> continue with the old ID. So I do not think that the session can be used >> here. >> >> Best Regards, >> Daniel Süpke >> >> RyOnLife wrote: >>> Daniel, I suggest you download the Firebug Firefox add-on and try it out >>> with >>> the http://bakery.cakephp.org/articles/view/firecake-helper Firecake >>> helper >>> for CakePHP. Makes it really easy to see what's going on with session >>> variables. >>> >>> >>> >>> Feanor's Curse wrote: How? If the user opens a new tab and changes the ID there (in the session), it will affect all other tabs, won't it? Best Regards, Daniel Süpke RyOnLife wrote: > Multiple tabs won't inhibit the use of sessions. > > > Feanor's Curse wrote: >> Thanks for the suggestion, but session variable won't work since the >> user could have open multiple tabs with different IDs. >> >> Best Regards, >> Daniel Süpke >> >> On Oct 27, 4:06 pm, RyOnLife <[EMAIL PROTECTED]> wrote: >>> Any reason setting a session variable wouldn't work? >>> >>> >>> >>> Feanor's Curse wrote: >>> Hi, we are using CakePHP 1.2 and I was wondering how it could be achieved to pass a parameter along every URL. We have a parameter set to an ID and it needs to be included in every URL in the application. Now, the first solution was to create a LinkHelper which added the location via $_GET, but this is not working when forms are validated by Cake, since then the url is not going via the LinkHelper. So, is there any easy way to pass around a parameter in the URL in the entire application? Best Regards, Daniel Süpke >>> -- >>> View this message in >>> context:http://n2.nabble.com/Parameter-passing-in-URL-tp1118744p1382739.html >>> Sent from the CakePHP mailing list archive at Nabble.com. >>> -- Dipl.-Inform. Daniel Süpke Universität Oldenburg Abt. Wirtschaftsinformatik I Very Large Business Applications Ammerländer Heerstr. 114-118 26129 Oldenburg Raum: A4-3-327 Tel: 0441/798-4471 Fax: 0441/798-4472 >> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
A new cakesite...
Hi guys, I am planning on building (maybe) a site for us cakephp users. I would like to know weather it would be a good idea to build such a site and what type of feature you would suggest. The question I ask is this, would you use such a site and what would like to see in it? Any comment will be great appreciated. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Parameter passing in URL
Hi Mathew, thanks for the help (and sorry for the delay in answering). That's a good idea and I followed your advise, but still one problem persists: If, in step 3 there is something wrong in validation, cake will return to the form again. But now, the ID is no longer in the URL, so there is an error about that. I think, passing a parameter along the URL is a pretty common task, isn't it? There should be more support for that in cake. For example, if I add it to the form action (helper), cake gets all confused about it. Yet, that would be the simplest solution. Best Regards, Daniel Süpke Mathew wrote: > Hi Daniel, > > You want to include the ID in the URL so that it persists when > bookmarked, and using a session doesn't provide that feature. > > I understand what your trying to do, but the form action does not > require the ID to be included, because posted form requests first > require an HTML page to display the form. > > Let me example. > > 1) User follows a link with the ID. > 2) HTML with the form is shown in the browser, with the ID in the URL. > 3) User enters form data, and submits the form. > 4) A response from the server is shown to the user. > > In step #2 when the form is displayed. You should take the ID from the > URL and add it as a hidden field in the form. > In step #3 the action that handles the form request does not need the > ID in the URL because it will be in the posted data. > In step #4 as part of the response you redirect the user to a URL that > contains the ID. > > Also. > > I would create a simple Helper object for your views. Not one that > creates an HTML link, because Cake comes with Form and Html helpers to > do that. All you need to do is modified a Router array to include the > ID > > for example; > > $html->link('Somewhere',$myhelper- >> id(array('controller'=>'documents','action'=>'show'))); > > You create a helper called Myhelper, and add a function called "id" > that injects your ID from the URL into the array. Now you can call all > various helper objects that require routed links. > > I think you can inject the ID as a get request like this (I can't > remember how to handle gets with params, but I think its like this) > > function id( $arr ) > { > $arr['?'] = array('id'=>$this->params['id']); > } > > That should provide Html that looks like this in your view > > Somewhere > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: A new cakesite...
A forum, Cake needs a decent forum (www.cakephpforum.net is offline 90% of the time), a knowledge base with snippets and articles.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
AW: Pagination with containable: Contain has to effect
Hi Sebastian, No problem. Yes you still have to include it manually or you include it for all models via an entry in the app_model.php. Which I did, but placed it in a folder where it couldn't be found. Anja -Ursprüngliche Nachricht- Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Sebastian Veggiani Gesendet: Dienstag, 25. November 2008 14:03 An: CakePHP Betreff: Re: Pagination with containable: Contain has to effect Anja, I'm sorry for the mistake. I remember that in first 1.2 versions Containable was a behaviour you had to include manually. Greetings PS: sorry for my poor english :) On Nov 25, 9:23 am, Sebastian Veggiani <[EMAIL PROTECTED]> wrote: > May be he's using an older version of 1.2. ¿or not? > > On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]> > wrote: > > > [2] What do you mean you had the file in the wrong place? > > Containable is part of the core. > > > Liebermann, Anja Carolin wrote: > > > [2] I have contaninable for all my models But I had the file > > > placed in the wrong folder. Ouch > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Mambo on CakePHP brainstorm
Hi James, > On Nov 25, 1:27 am, James K <[EMAIL PROTECTED]> wrote: > > > Simple - if you're starting from scratch, seriously start over and > > rethink a lot of the fundamentals. > > > Mambo's idea of what content is and how it should be organized within > > a CMS is very outdated and short sighted. > > > Joomla's been making a valiant effort to modernize the Mambo codebase, > > but it still suffers from several of the same fatal flaws in terms of > > execution. Why in the world can I only organize content 2 levels deep? > > Why can I only add content to a single category? > > > In addition, it would be wise to look into broadening Mambo's idea of > > "content". Drupal does a pretty good job of making it easy to create > > several different content types (ie blog posts, news items, products, > > etc) and handle them in different ways without having to make very > > literal "sections" > > > Why are the security permissions hard coded? I know Joomla's in the > > middle of a really messy migration to a proper ACL implementation, but > > they're not anywhere near close yet. Security roles should be > > flexible, customizable, granular, and hierarchical. > > > Mambo's 8 years old now and while it may be tempting to give Mambo's > > users something very familiar in execution, you'd just be doing the > > project a disservice by ignoring the vast innovations that have > > occurred in the CMS space since Mambo was originally architected. > > > There are lots of good CMSes on the market - both commercial and open > > source that are doing a lot of really interesting things these days. > > Do your research, take all the lessons learned from Mambo development > > over the years and get crackin! Before writing a line of code, you > > should put a lot of thought and time into the database design. Many > > fundamental design choices will be made at that point which will be > > hard to go back on once you've written a significant amount of code. > > > The more planning you do, the better the end product will be. > > > Good luck! > Thanks for all your comments, it sure will be part of our discussions :) we also are interested in to know about the expectations about the CMS framework, things like: Been a cake developer, would you use/integrate your projects in a cms ? What must accomplish that cms to be considered in your cake projects ? Mambo is not just a CMS but a framework too, it should help the developers to create his own pieces of software and reuse the ones that the cms currently have. Thanks Andrés --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Pagination with containable: Contain has to effect
Anja, I'm sorry for the mistake. I remember that in first 1.2 versions Containable was a behaviour you had to include manually. Greetings PS: sorry for my poor english :) On Nov 25, 9:23 am, Sebastian Veggiani <[EMAIL PROTECTED]> wrote: > May be he's using an older version of 1.2. ¿or not? > > On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]> > wrote: > > > [2] What do you mean you had the file in the wrong place? Containable is > > part of the core. > > > Liebermann, Anja Carolin wrote: > > > [2] I have contaninable for all my models But I had the file placed > > > in the wrong folder. Ouch > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 to get code coverage analysis working?
On Nov 19, 10:12 pm, mark_story <[EMAIL PROTECTED]> wrote: > To resurrect this threadcodecoveragewas broken for me on my new > computer. But by changing line 115 of /cake/tests/lib/ > code_coverage_manager.php to > > xdebug_start_code_coverage(XDEBUG_CC_UNUSED); > > it started to work! Hope it solves someone else's issues too is working here too! Thank you Mark! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 should I associate these tables?
Thanks, teknoid! But now I'm having a new problem... My applications uses tables separated in different schemas. These tables are related one each other as shown above. I'm trying the HBTM association between "geo.plots" and "dme.addresses" tables. I created the "geo.addresses_plots" table but when I run my application I receives the message bellow: Warning (2): pg_query() [function.pg-query]: Query failed: ERRO: relation "addresses_plots" do not exists [CORE.rc2/libs/model/ datasources/dbo/dbo_postgres.php, line 152] Can you help me once more? I hope so. On 24 nov, 18:50, teknoid <[EMAIL PROTECTED]> wrote: > This is a basic HABTM (hasAndBelongsToMany) relationship. > Read up on it in the manual... you should also rename the join table > (if you'd like to keep consistent with conventions). > > On Nov 24, 2:40 pm, Antônio Marco <[EMAIL PROTECTED]> wrote: > > > Hi folks! > > > I created 3 tables as shown bellow: > > > CREATE TABLE geo.plots > > ( > > id serial NOT NULL, > > created timestamp, > > modifiedtimestamp, > > > the_geomvarchar(255), > > > inscricao_imobiliaria varchar(14) NOT NULL, > > > quadra varchar(10), > > lotesmallint, > > > numero_residencial_previo smallint, > > > PRIMARY KEY (id) > > ) > > WITH OIDS; > > > CREATE TABLE geo.plot_addresses > > ( > > id serial NOT NULL, > > created timestamp, > > modifiedtimestamp, > > > plot_id int NOT NULL, > > address_id int NOT NULL, > > > endereco_principal bool NOT NULL DEFAULT true, > > > PRIMARY KEY (id), > > FOREIGN KEY (plot_id) REFERENCES geo.plots (id), > > FOREIGN KEY (address_id) REFERENCES dme.addresses (id) > > ) > > WITH OIDS; > > > CREATE TABLE dme.addresses > > ( > > idserial NOT NULL, > > created timestamp, > > modified timestamp, > > > habilitadobool NOT NULL DEFAULT true, > > > street_postal_code_id int NOT NULL, > > parent_id int, > > > complemento bool NOT NULL DEFAULT false, > > > numerosmallint, > > > bloco varchar(10), > > andar smallint, > > unidade smallint, > > > posicao smallint, > > > caixa_postal smallint, > > > complemento_livre varchar(255), > > > PRIMARY KEY (id), > > > FOREIGN KEY (street_postal_code_id) REFERENCES > > dme.street_postal_codes (id), > > FOREIGN KEY (parent_id) REFERENCES dme.addresses (id) > > ) > > WITH OIDS; > > > They are associated as shown bellow: > > > // > > class Plot extends AppModel { > > var $name = 'Plot'; > > > var $useDbConfig = 'geo'; > > > var $hasMany = array( > > 'PlotAddresses' => array( > > 'className' => 'PlotAddress', > > 'foreignKey' => 'plot_id' > > ) > > ); > > > } > > > // > > class PlotAddress extends AppModel { > > var $name = 'PlotAddress'; > > > var $useDbConfig = 'geo'; > > > var $belongsTo = array( > > 'Plot' => array( > > 'className' => 'Plot', > > 'foreignKey' => 'plot_id' > > ), > > > 'Address' => array( > > 'className' => 'Address', > > 'foreignKey' => 'address_id' > > ) > > ); > > > } > > > // > > class Address extends AppModel { > > var $name = 'Address'; > > > var $useDbConfig = 'dme'; > > > var $hasOne = array( > > 'PlotAddress' => array( > > 'className' => 'PlotAddress', > > 'foreignKey' => 'address_id' > > ) > > ); > > > } > > > I have used Scaffolding in this application but when I run the index > > of PlotAddresses, I receive the message bellow: > > > Notice (8): Undefined index: Address [CORE.rc2/libs/view/scaffolds/ > > index.ctp, line 81] > > > Verifing the line, I saw that the problem is related to "belongTo" > > association. > > > Can anybody help me to solve this problem? Is my association > > incorrect? > > > Thanks a lot. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Pagination with containable: Contain has to effect
May be he's using an older version of 1.2. ¿or not? On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > [2] What do you mean you had the file in the wrong place? Containable is > part of the core. > > Liebermann, Anja Carolin wrote: > > [2] I have contaninable for all my models But I had the file placed in > > the wrong folder. Ouch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
Advanced Routes
Hi guys! Imagine you have a standard social network with users who can have blogs, pictures and videos. I need to setup my routes like this: http://www.mysite.com/michael --> this is like / users/view/123 http://www.mysite.com/michael/videos/123 --> this would show michaels video number 123 http://www.mysite.com/michael/pictures/ --> this would be like michaels /pictures/index Any 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
get value send by one model
I have two models: employee and taskassign. In employee I have a link "task assign" in which I pass $employee ['Employee']['id'] to the taskassigns/add.. and in "add function" of tasks_controller we should get the value of $employee['Employee']['id'].and this value should be passed to the foreign key employee_id of task_assigns..how can I attain that..I'm a newbie in cakephp..plz help me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Mambo on CakePHP brainstorm
Very good advice. Ignore at mambo's peril. On Nov 25, 1:27 am, James K <[EMAIL PROTECTED]> wrote: > Simple - if you're starting from scratch, seriously start over and > rethink a lot of the fundamentals. > > Mambo's idea of what content is and how it should be organized within > a CMS is very outdated and short sighted. > > Joomla's been making a valiant effort to modernize the Mambo codebase, > but it still suffers from several of the same fatal flaws in terms of > execution. Why in the world can I only organize content 2 levels deep? > Why can I only add content to a single category? > > In addition, it would be wise to look into broadening Mambo's idea of > "content". Drupal does a pretty good job of making it easy to create > several different content types (ie blog posts, news items, products, > etc) and handle them in different ways without having to make very > literal "sections" > > Why are the security permissions hard coded? I know Joomla's in the > middle of a really messy migration to a proper ACL implementation, but > they're not anywhere near close yet. Security roles should be > flexible, customizable, granular, and hierarchical. > > Mambo's 8 years old now and while it may be tempting to give Mambo's > users something very familiar in execution, you'd just be doing the > project a disservice by ignoring the vast innovations that have > occurred in the CMS space since Mambo was originally architected. > > There are lots of good CMSes on the market - both commercial and open > source that are doing a lot of really interesting things these days. > Do your research, take all the lessons learned from Mambo development > over the years and get crackin! Before writing a line of code, you > should put a lot of thought and time into the database design. Many > fundamental design choices will be made at that point which will be > hard to go back on once you've written a significant amount of code. > > The more planning you do, the better the end product will be. > > Good luck! > > - James > > On Nov 19, 9:47 am, andphe <[EMAIL PROTECTED]> wrote: > > > Hi all, I'm on Mambo Dev team, and we realize that while we are > > planning our major rewrite of Mambo based on CakePHP, we are not > > hearing what the CakePHP community have to say. > > > Specifically it would be good to have a brainstorm here, about what > > the CakePHP users/developers expect on a cake based CMS. > > > So, go ahead, lets have fun > > > Andrés --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
AW: Pagination with containable: Contain has to effect
Hi Sebastian, The "he" is a "she" and had the app_model.php file placed in the wrong folder ;-) Anja -Ursprüngliche Nachricht- Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Sebastian Veggiani Gesendet: Dienstag, 25. November 2008 13:16 An: CakePHP Betreff: Re: Pagination with containable: Contain has to effect May be he's using an older version of 1.2. ¿or not? On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > [2] What do you mean you had the file in the wrong place? Containable > is part of the core. > > Liebermann, Anja Carolin wrote: > > [2] I have contaninable for all my models But I had the file > > placed in the wrong folder. Ouch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Pagination with containable: Contain has to effect
May be he's using an older version of 1.2. ¿or not? On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > [2] What do you mean you had the file in the wrong place? Containable is > part of the core. > > Liebermann, Anja Carolin wrote: > > [2] I have contaninable for all my models But I had the file placed in > > the wrong folder. Ouch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: Pagination with containable: Contain has to effect
May be he's using an older version of 1.2. ¿or not? On Nov 24, 9:31 am, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > [2] What do you mean you had the file in the wrong place? Containable is > part of the core. > > Liebermann, Anja Carolin wrote: > > [2] I have contaninable for all my models But I had the file placed in > > the wrong folder. Ouch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 -~--~~~~--~~--~--~---
cakephp with postgresql sequence
Hi, I read from many posts about cakephp and postgresql sequence. Most of them seems implying that the sequence will be used automatically. One can override the default sequence name by declaring var $sequence = "new_sequence"; in the model class. However, I'm using postgres 8.3 with the latest cakephp rc3. I got error null value in column "id". As I've check the query shown on the page, I found that the code try to insert without calling sequence. It expects the server will generate id automatically. I've also try to remove the cache, regenerating model, etc. but still not work. I'm quite new to postgresql. The table is look simple. table name : supplier_master field : id=integer, supplier_name=charvarying. sequence name : supplier_master_id_seq Can anybody give me a clue? Thanks in Advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-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: "find" using HABTM relationship
I think I can explain it a little. It did not work because Cake does not get habtm data all in a single query. The condition you set is used for the initial query (which does not reach the User model). Set debug to 2 and check the sql output. You should see two queries (I think) for any normal habtm. This is where containable shines. You can specify conditions further "down" the associations and they will be used in the correct queries. /Martin On Nov 25, 11:09 am, pkclarke <[EMAIL PROTECTED]> wrote: > Thanks to those who tried to help. > > I was unable to use "find" to retrieve the data based on the HABTM > relationship. I ended up doing manually: > > <-- > //lookup User based on email > $user = $this->User->find('first', > array( > 'conditions'=>array('email'=>$this->data['User']['email']), > 'fields'=>array('id') > ) > ); > > //lookup SiteUsers associated with the selected User > $site_users = $this->User->SiteUser->find('list', > array( > 'conditions'=>array('user_id'=>$user['User']['id']), > 'fields'=>array('site_id') > ) > ); > > //compile an array of Sites associated with the User (based on > SiteUser) > $sites = array(); > foreach ( $site_users as $value){ > $site = $this->Site->find('first', > array( > 'conditions'=>array('Site.id'=>$value['site_id']), > 'fields'=>array('id','title') > ) > ); > $sites[$site['Site']['id']]=$site['Site']['title']; > } > > $this->set('options', $sites); > --> > > I would be interested in knowing why it didn't work, if anyone knows > why. > > Cheers Paul. > > On Nov 25, 7:06 pm, AD7six <[EMAIL PROTECTED]> wrote: > > > On Nov 25, 1:26 am, pkclarke <[EMAIL PROTECTED]> wrote: > > > > I'm a noob to CakePHP and have an issue with "find" returning results > > > from tables with a HABTM relationship. > > > > I have 2 tables that have a HABTM relationship: > > > > - Site.id > > > - Site.title > > > > - User.id > > > - User.name > > > > The HABTM join table is: > > > - SiteUser.id > > > - SiteUser.site_id > > > - SiteUser.user_id > > > > The Site relationship is defined as follows: > > > var $hasAndBelongsToMany = array( > > > 'User' => > > > array( > > > 'className'=> 'User', > > > 'joinTable'=> 'site_users', > > > 'foreignKey'=> 'site_id', > > > 'associationForeignKey'=> 'user_id', > > > 'unique'=> true > > > ) > > > ); > > > > I am trying to return Sites related to a given User using "find", as > > > follows: > > > $options = $this->User->Site->find('list', > > > array( > > > 'fields'=>array('Site.id', 'Site.title'), > > > 'conditions'=>array('User.id'=>'7') > > > ) > > > ); > > > > However, I get the following error: > > > Warning (512): SQL Error: 1054: Unknown column 'User.id' in 'where > > > clause' > > > > The SQL returned shows the HABTM relationship doesn't seem to be > > > working: > > > Query: SELECT `Site`.`id`, `Site`.`title` FROM `sites` AS `Site` > > > WHERE `User`.`id` = 7 > > > > Can anyone shed some light on what I'm doing wrong? > > > See the > > examples:http://book.cakephp.org/revisions/results/query:habtm/collection:2/la... > > > Cheers, > > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: "find" using HABTM relationship
Thanks to those who tried to help. I was unable to use "find" to retrieve the data based on the HABTM relationship. I ended up doing manually: <-- //lookup User based on email $user = $this->User->find('first', array( 'conditions'=>array('email'=>$this->data['User']['email']), 'fields'=>array('id') ) ); //lookup SiteUsers associated with the selected User $site_users = $this->User->SiteUser->find('list', array( 'conditions'=>array('user_id'=>$user['User']['id']), 'fields'=>array('site_id') ) ); //compile an array of Sites associated with the User (based on SiteUser) $sites = array(); foreach ( $site_users as $value){ $site = $this->Site->find('first', array( 'conditions'=>array('Site.id'=>$value['site_id']), 'fields'=>array('id','title') ) ); $sites[$site['Site']['id']]=$site['Site']['title']; } $this->set('options', $sites); --> I would be interested in knowing why it didn't work, if anyone knows why. Cheers Paul. On Nov 25, 7:06 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Nov 25, 1:26 am, pkclarke <[EMAIL PROTECTED]> wrote: > > > > > I'm a noob to CakePHP and have an issue with "find" returning results > > from tables with a HABTM relationship. > > > I have 2 tables that have a HABTM relationship: > > > - Site.id > > - Site.title > > > - User.id > > - User.name > > > The HABTM join table is: > > - SiteUser.id > > - SiteUser.site_id > > - SiteUser.user_id > > > The Site relationship is defined as follows: > > var $hasAndBelongsToMany = array( > > 'User' => > > array( > > 'className'=> 'User', > > 'joinTable'=> 'site_users', > > 'foreignKey'=> 'site_id', > > 'associationForeignKey'=> 'user_id', > > 'unique'=> true > > ) > > ); > > > I am trying to return Sites related to a given User using "find", as > > follows: > > $options = $this->User->Site->find('list', > > array( > > 'fields'=>array('Site.id', 'Site.title'), > > 'conditions'=>array('User.id'=>'7') > > ) > > ); > > > However, I get the following error: > > Warning (512): SQL Error: 1054: Unknown column 'User.id' in 'where > > clause' > > > The SQL returned shows the HABTM relationship doesn't seem to be > > working: > > Query: SELECT `Site`.`id`, `Site`.`title` FROM `sites` AS `Site` > > WHERE `User`.`id` = 7 > > > Can anyone shed some light on what I'm doing wrong? > > See the > examples:http://book.cakephp.org/revisions/results/query:habtm/collection:2/la... > > Cheers, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
java script query
hi, i want to call controller action when my web browser is call , for that i use javascript like: Javascript->event('window','unload',$ajax- >remoteFunction( array( 'url' => array( 'controller' => 'cart', 'action' => 'check'), 'update' => 'producttitle','position'=>'replace' ) )); ?> but this code is not working, place give me proper solution for that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to check the path of your cache view in the source code?
Did you include the CacheHelper in your $helpers array? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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 to check the path of your cache view in the source code?
yes, it was set correctly, in the cache folder, files generate for model and persistent folders but cache views are not generate for the view folders On Nov 25, 5:09 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > Have you set the correct permission levels on the tmp directories (web > server needs write access)? > > On 25 Nov 2008, at 17:53, robert123 wrote: > > > > > hi > > > I have enabled caching, in my testing environment, the cache is > > working well, and generate the views at tmp/cache/views > > > so i deploy the code in the production server, using the same code, > > but this time no views are generated at tmp/cache/views > > > I am not sure the reason, anyone can tell me the reason, or anyone can > > tell me where to find the code, where i can check the path of the > > generated view files, so that i can debug it, 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to check the path of your cache view in the source code?
Have you set the correct permission levels on the tmp directories (web server needs write access)? On 25 Nov 2008, at 17:53, robert123 wrote: > > hi > > I have enabled caching, in my testing environment, the cache is > working well, and generate the views at tmp/cache/views > > so i deploy the code in the production server, using the same code, > but this time no views are generated at tmp/cache/views > > I am not sure the reason, anyone can tell me the reason, or anyone can > tell me where to find the code, where i can check the path of the > generated view files, so that i can debug it, 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to check the path of your cache view in the source code?
hi I have enabled caching, in my testing environment, the cache is working well, and generate the views at tmp/cache/views so i deploy the code in the production server, using the same code, but this time no views are generated at tmp/cache/views I am not sure the reason, anyone can tell me the reason, or anyone can tell me where to find the code, where i can check the path of the generated view files, so that i can debug it, 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Field formatting based on MySQL fields type
I do a similar thing in my AppModel. Look at the Model methods and also pr($this) in your AppModel to see what data you can access, etc. You can get all the field names and types easily using $this->schema() or $this->getColumnTypes(). Cheers, Adam On Nov 25, 2:34 am, Ernesto <[EMAIL PROTECTED]> wrote: > Hello. > > My goal is to provide a default formatting, based on MySQL's fields > types because > the webapp i'm baking uses some differrent field format than MySQL. > For ex: > - Dates are "dd/mm/" instead of MySQL's "-mm-dd" > - Floating point numbers uses commas instead of dots as decimal > separator > > I've made a FieldFormatHelper, called in every controller's > beforeValidate() function but that's not very handy because i need a > rule for every field. > > So i tried to process fields in AppModel's beforeValidate() but i > can't get the code to work. > > How can i do? > Is there a better way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: NotContain?
Yes, often I've thought the same as well, however when things change (add an extra model, add some extra fields) you're probably going to have to change this in multiple places. Plus, I've found it better to specify what you want, rather than what you don't want, when things may change in the future. On Nov 25, 5:58 am, thatsgreat2345 <[EMAIL PROTECTED]> wrote: > I was curious if there was such a thing as notcontains, as sometimes I > just want to exclude a few fields, and sometimes the same fields such > as created / modified across a few tables. So it is some what of a > hassle to list out all the stuff for the contains parameter rather > then making something such as notcontains, or exlcude and have it > ignore those fields. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the 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: "find" using HABTM relationship
On Nov 25, 1:26 am, pkclarke <[EMAIL PROTECTED]> wrote: > I'm a noob to CakePHP and have an issue with "find" returning results > from tables with a HABTM relationship. > > I have 2 tables that have a HABTM relationship: > > - Site.id > - Site.title > > - User.id > - User.name > > The HABTM join table is: > - SiteUser.id > - SiteUser.site_id > - SiteUser.user_id > > The Site relationship is defined as follows: > var $hasAndBelongsToMany = array( > 'User' => > array( > 'className'=> 'User', > 'joinTable'=> 'site_users', > 'foreignKey'=> 'site_id', > 'associationForeignKey'=> 'user_id', > 'unique'=> true > ) > ); > > I am trying to return Sites related to a given User using "find", as > follows: > $options = $this->User->Site->find('list', > array( > 'fields'=>array('Site.id', 'Site.title'), > 'conditions'=>array('User.id'=>'7') > ) > ); > > However, I get the following error: > Warning (512): SQL Error: 1054: Unknown column 'User.id' in 'where > clause' > > The SQL returned shows the HABTM relationship doesn't seem to be > working: > Query: SELECT `Site`.`id`, `Site`.`title` FROM `sites` AS `Site` > WHERE `User`.`id` = 7 > > Can anyone shed some light on what I'm doing wrong? See the examples: http://book.cakephp.org/revisions/results/query:habtm/collection:2/lang:en Cheers, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---