Re: Simple news site with tags
I'm experiencing a problem with this; I can't figure out how to sort the news according to their date created. They are being returned to me in an array consisting of tags, that each have a number of news associated to them. Is there an elegant way I can sort the returned news so that they're being displayed in descending order? Thanks in advance, Michael. On Apr 16, 7:21 am, John Andersen j.andersen...@gmail.com wrote: You should perform a find in the Tag model, not in the news model, like: $taggedNews = $this-Tag-find('all', array( 'conditions' = array( 'Tag.name' = [your tag value here] ), 'recursive' = 1 ) ); Enjoy, John On Apr 16, 12:55 am, Cepheus cep...@gmail.com wrote: Hey everyone, I've setup a simple news page and I'm trying to add tags to my news posts. I've read a couple of tutorials on it and I've got the HABTM relationship working. My problem is that I'm not sure how to correctly query for news items that belong to a specific tag. I'm currently doing something like this: function index() { $news = $this-News-find('all'); if (isset($this-params['requested'])) { return $news; } else { $this-set('news', $news); } } Which gives me all news items as below: Array ( [0] = Array ( [News] = Array ( [id] = 1 [title] = Hello world! [author] = Michael [content] = This is the first post! [created] = 2009-04-09 12:49:28 [modified] = 2009-04-15 23:38:23 ) [Tag] = Array ( [0] = Array ( [id] = 3 [name] = Profile [NewsTag] = Array ( [id] = 1 [news_id] = 1 [tag_id] = 3 ) ) ) ) [1] = Array ( [News] = Array ( [id] = 2 [title] = Another newspost [author] = Michael [content] = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin pellentesque dictum metus. Donec consectetur, nisi ac mollis pulvinar, urna enim semper [created] = 2009-04-09 18:29:32 [modified] = 2009-04-09 18:29:32 ) [Tag] = Array ( ) ) ... and so on. I tried rewriting it to just display news items that belong to the tag with id 3: function index() { $news = $this-News-find(array('NewsTag.tag_id'=3)); if (isset($this-params['requested'])) { return $news; } else { $this-set('news', $news); } } But this does not work, instead it gives me this error: Warning (512): SQL Error: 1054: Unknown column 'NewsTag.tag_id' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 525] Does anyone know what I can do to fix this problem? Thanks in advance, Michael. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple news site with tags
Solved it by doing the following: $this-News-NewsTag-bindModel(array('belongsTo' = array('News', 'Tag'))); $news = $this-News-NewsTag-find('all', array( 'order'='News.created DESC', 'conditions' = array('NewsTag.tag_id' = $tag_id))); On Apr 16, 8:18 am, Cepheus cep...@gmail.com wrote: I'm experiencing a problem with this; I can't figure out how to sort the news according to their date created. They are being returned to me in an array consisting of tags, that each have a number of news associated to them. Is there an elegant way I can sort the returned news so that they're being displayed in descending order? Thanks in advance, Michael. On Apr 16, 7:21 am, John Andersen j.andersen...@gmail.com wrote: You should perform a find in the Tag model, not in the news model, like: $taggedNews = $this-Tag-find('all', array( 'conditions' = array( 'Tag.name' = [your tag value here] ), 'recursive' = 1 ) ); Enjoy, John On Apr 16, 12:55 am, Cepheus cep...@gmail.com wrote: Hey everyone, I've setup a simple news page and I'm trying to add tags to my news posts. I've read a couple of tutorials on it and I've got the HABTM relationship working. My problem is that I'm not sure how to correctly query for news items that belong to a specific tag. I'm currently doing something like this: function index() { $news = $this-News-find('all'); if (isset($this-params['requested'])) { return $news; } else { $this-set('news', $news); } } Which gives me all news items as below: Array ( [0] = Array ( [News] = Array ( [id] = 1 [title] = Hello world! [author] = Michael [content] = This is the first post! [created] = 2009-04-09 12:49:28 [modified] = 2009-04-15 23:38:23 ) [Tag] = Array ( [0] = Array ( [id] = 3 [name] = Profile [NewsTag] = Array ( [id] = 1 [news_id] = 1 [tag_id] = 3 ) ) ) ) [1] = Array ( [News] = Array ( [id] = 2 [title] = Another newspost [author] = Michael [content] = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin pellentesque dictum metus. Donec consectetur, nisi ac mollis pulvinar, urna enim semper [created] = 2009-04-09 18:29:32 [modified] = 2009-04-09 18:29:32 ) [Tag] = Array ( ) ) ... and so on. I tried rewriting it to just display news items that belong to the tag with id 3: function index() { $news = $this-News-find(array('NewsTag.tag_id'=3)); if (isset($this-params['requested'])) { return $news; } else { $this-set('news', $news); } } But this does not work, instead it gives me this error: Warning (512): SQL Error: 1054: Unknown column 'NewsTag.tag_id' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 525] Does anyone know what I can do to fix this problem? Thanks in advance, Michael. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with linked models
There isn't a find call, I was relying on automatic call, as this seems to get it almost right. Do I need to specify the find call myself then? T On Apr 16, 6:24 am, John Andersen j.andersen...@gmail.com wrote: How does the find call look like in your controller? John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with linked models
In your controller, which fetches all the StockItems for a given product, how does it do that? Sorry for asking, but I do not see anything automatically fetching the required information, but I don't know all about CakePHP yet :) If you know the product, then you should fetch the stockitems from the product model point of view, not from the stockitem model point of view. John On Apr 16, 10:07 am, Toby goo...@toby-g.net wrote: There isn't a find call, I was relying on automatic call, as this seems to get it almost right. Do I need to specify the find call myself then? T On Apr 16, 6:24 am, John Andersen j.andersen...@gmail.com wrote: How does the find call look like in your controller? John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need high-level advice on how to implement cross Model csv exporter
Hi, some ramblings and vague advice... :) As long as all your normal actions and views make use of $this-data then you can get away with exporting what's on screen by simply using parseExtensions and a csv-layout (as Brandead points out). But since you mention tens of thousands of results I imagine you want to export all records from a model and not just the current items on screen. I would probably give AppModel a special method or a find type (depending on your preference on that issue). But (looking at your example line) there is no need to pass the instance of Product to the method since you are running it on that instance already. Checking the schema of the model instance will enable your export to adapt to any of your models. I have added a hidden_fields attribute to my models at one time to make sure I can choose to not export some fields like created if that has no relevance. Your biggest problem is the possible processing time and memory usage for those 10'000 records. You can try to just tell php to not time out but that might not be enough or allowed or even desirable. Ways I would consider to get around it: Cache the csv file and only process the very latest records on request. A nightly cron, during low traffic, could keep the csv updated. This would only work for WORM-type records and not continually changing (editable) data. Another problem is to get an efficient way to determine which records were cached. The modified time of the csv file might be enough. Keep a background task on the server that does the actual processing and let the web-interface keep polling for it to be completed. This would be similar to how bleep.com create a zip-archive of music you purchase before you download. I have slightly similar tasks that take (thousands of) transactions and process them into statistically friendly data in another table. Since there are literally millions of rows I run this from a shell to avoid timeouts. I also page the query to around 1000 records at a time in a loop to avoid memory problems. Since I store the results in another table I can keep the id of the original record in the statistical table so that I do not create duplicate entries. This also enables me to fix calculation errors and re-process all the data is necessary since I can update the existing records with new figures. /Martin On Apr 15, 5:49 pm, Chez17 che...@gmail.com wrote: Hello all, I have a client that wants to be able to export any results he sees on screen to a csv file. This will be used for different models and will need to work on large queries. I was wondering if anyone would be willing to share their thoughts on the best 'cake' way to do this. I'm asking for high level, no code, thoughts. Here is sort of what I am brainstorming. If I modify app_model to have an exporter function that takes an model instance and a conditions array that might make a lot of sense, so I could do things like this: $this-Product-csvExporter($this-Product, $conditions); This would work for multiple models. Would a component make more sense? The issue this brings up is that how do I pass the information to get the conditions? Some of these queries will be returning tens of thousands of results. I was thinking of having a link on all the pages like Export this to csv and it would open a new window so if it took some time, the user could do other things. So I have to get the current conditions to the new window somehow. Any thoughts on this would be most appreciated. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Cake
I'd say go for a framework. I learned a lot more php a lot faster when I started using a framework. (a long long time ago in a framework far far away) You will also have a good foundation to practise OO-theory or application design ideas. On Apr 16, 3:37 am, dem...@gmail.com dem...@gmail.com wrote: I am a new PHP Developer. I have read at least 2 books on PHP. I have mostly PHP down only in theory. I now want to develop a data based driven website in PHP. Here is my dilema. Should I learn a framework for possibly better structure and or presentation or should I just go ahead and start coding in PHP without the framework? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL clarification
Hi All, I'm setting up Auth and ACL on a site, to manage access to the admin area, and I'm just looking for clarification. I've been looking at the Simple Acl controlled Application in the example applications section of the manual, and also the Access Control Lists bit (under Core Components). It seems to me that the two examples manage access in slightly different ways - the first example creates ACOs for all controller actions, the second creates ACOs for something more akin to controllers, and then uses the granularity implicit in the aros_acos table (the CRUD fields). Firstly, have I understood the two examples correctly? And if so are there obvious pros and cons to the two approaches? Thanks, Toby --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session lost when changing from SSL to non-SSL connection
I've opened an RFC on this: - http://groups.google.com/group/tickets-cakephp/browse_thread/thread/97c06384d8cdfa4d is there somebody that could take a look at it? also, is this something that should be moved to 1.3? Many thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Plugin architecture and plugin limitations
Our lame but necessarily practical/quick solution was to give up on plugins. [...] I'm afraid we will do the same. This application will have *a lot* of Javascript which also needs to be modular and extensible. I think there won't be any problems making pluggable components for the client part, because of prototypal inheritance in JS. What a pity this is not possible in PHP. Not exactly an answer to your question but maybe a bit of our experience will bring up some ideas or nourish the discussion here. It would be great to read some more ideas here. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Session madness
Hi all, after three days of researching and trying to fix those damn sessions I am at a complete loss as to why my sessions are lost at random! I have set Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'low'); to no avail. I am NOT moving from https to http so that can't be the problem. The worst thing is, the error occurs very randomly. I can add 5 Books to my basket and it breaks on the sixth. The next time the session is lost by simply navigating the site. Weird!! What could be a reason for a session to be lost? The path is always the same!?! I reverted back to the old version, which works on our live server but still it breaks. I haven't changed anything on my dev server though. This is driving me crazy - if anyone has an idea, i would greatly appreciate it! Phil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Plugin architecture and plugin limitations
Sounds interesting! Could you show some examples (code, ideas, whatever) of what you tried to accomplish, so the CakePHP community can grow from your experience and/or maybe provide additional information to assist in finding a solution? Enjoy, John On Apr 16, 12:28 pm, Jaime ja...@iteisa.com wrote: Our lame but necessarily practical/quick solution was to give up on plugins. [...] I'm afraid we will do the same. This application will have *a lot* of Javascript which also needs to be modular and extensible. I think there won't be any problems making pluggable components for the client part, because of prototypal inheritance in JS. What a pity this is not possible in PHP. Not exactly an answer to your question but maybe a bit of our experience will bring up some ideas or nourish the discussion here. It would be great to read some more ideas here. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Reserved words in CakePHP?
yeah i once proposed to change components into $this-FileComponent-foo() etc with Component attached to prevent this from happening but they did not care about that much in the core team at that point in time :) PS: same with helpers (conflicts between vars from controller): $poll (content array from table polls) $poll (helper) - better: $this-poll (like inside other helpers), or at lest $pollHelper-... On 16 Apr., 06:59, John Andersen j.andersen...@gmail.com wrote: Thanks Dr. Loboto, That may be, but not in my case, as I don't use any components together with my installations controller, and each model, loaded by request, does not have any conflict with CakePHP or other parts, so to sum it up, I am happy with that :) Enjoy, John On Apr 16, 5:36 am, Dr. Loboto drlob...@gmail.com wrote: There can be also conflict between models and components names (not classnames). On Apr 16, 1:45 am, John Andersen j.andersen...@gmail.com wrote: Thanks Dardo and Teh, but it turned out to be a conflict between all my models, when I loaded them all in an installations controller :) Solved by loading the models only by request (ClassRegistry). Enjoy, John [snip] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL clarification
Hi All, [Apologies if this turns up more than once, I seem to be having trouble posting] I'm setting up Auth and ACL on a site, to manage access to the admin area, and I'm just looking for clarification. I've been looking at the Simple Acl controlled Application in the example applications section of the manual, and also the Access Control Lists bit (under Core Components). It seems to me that the two examples manage access in slightly different ways - the first example creates ACOs for all controller actions, the second creates ACOs for something more akin to controllers, and then uses the granularity implicit in the aros_acos table (the CRUD fields). Firstly, have I understood the two examples correctly? And if so are there obvious pros and cons to the two approaches? Thanks, Toby --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session madness
After some more digging, I finally found it. My predecessor added a Session-renew() command deep inside the code which caused the problem... Cheers On Apr 16, 11:50 am, floepi flo...@gmail.com wrote: Hi all, after three days of researching and trying to fix those damn sessions I am at a complete loss as to why my sessions are lost at random! I have set Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'low'); to no avail. I am NOT moving from https to http so that can't be the problem. The worst thing is, the error occurs very randomly. I can add 5 Books to my basket and it breaks on the sixth. The next time the session is lost by simply navigating the site. Weird!! What could be a reason for a session to be lost? The path is always the same!?! I reverted back to the old version, which works on our live server but still it breaks. I haven't changed anything on my dev server though. This is driving me crazy - if anyone has an idea, i would greatly appreciate it! Phil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What do you develop in (ide, text editor, etc.)?
Franco, So I'm not alone. Yea! Do you have a good mode for javascript? php- mode is great, every thing works fine. For years, I've been using c- mode to edit javascript, and it doesn't handle json very well, or lambda functions. Do you have an alternative? On Apr 15, 10:03 am, Franco Tampieri franco.tampi...@gmail.com wrote: Emacs too! ;) Franco Tampieri Details: - Linux User #286282 - FSF Member #5827 GNU/Linux: Hardened / Embedded / H.A. Cluster / System Integrator Certification: ECDL / LPIC 1 - Acquiring Certification: Cisco CCNA / LPIC 2 Sent from Bologna, Emilia Romagna, Italia 2009/4/15 jcorrea javier.cor...@gmail.com VIM :) On Apr 15, 6:21 am, Teh Treag tehtr...@gmail.com wrote: I prefer emacs. Am I the only emacs user around here. On Feb 28, 3:14 pm, adam abennett...@sbcglobal.net wrote: I'm using Eclipse with PDT, but Dreamweaver for making layouts. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Routes Regex problem
Good day to you all, I have tried to solve this and it's killing me. My site is working well, but I am trying to perfect the URL's to optimize for search. The short question: Doe anybody know how to get the routes regex working so that all queries EXCEPT those in a given list (say, all queries except those starting with certain keywords (Like Registration, Users, Pages) get forwarded to a specific controller and action? I have tried everything I can muster. Regards, Danny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What do you develop in (ide, text editor, etc.)?
Hu, that's cool Teh!!!, well I actualy use this: http://mihai.bazon.net/projects/emacs-javascript-mode not soo bad... but it uses cc-mode too Cheers Franco Franco Tampieri Details: - Linux User #286282 - FSF Member #5827 GNU/Linux: Hardened / Embedded / H.A. Cluster / System Integrator Certification: ECDL / LPIC 1 - Acquiring Certification: Cisco CCNA / LPIC 2 Sent from Bologna, Emilia Romagna, Italia 2009/4/16 Teh Treag tehtr...@gmail.com Franco, So I'm not alone. Yea! Do you have a good mode for javascript? php- mode is great, every thing works fine. For years, I've been using c- mode to edit javascript, and it doesn't handle json very well, or lambda functions. Do you have an alternative? On Apr 15, 10:03 am, Franco Tampieri franco.tampi...@gmail.com wrote: Emacs too! ;) Franco Tampieri Details: - Linux User #286282 - FSF Member #5827 GNU/Linux: Hardened / Embedded / H.A. Cluster / System Integrator Certification: ECDL / LPIC 1 - Acquiring Certification: Cisco CCNA / LPIC 2 Sent from Bologna, Emilia Romagna, Italia 2009/4/15 jcorrea javier.cor...@gmail.com VIM :) On Apr 15, 6:21 am, Teh Treag tehtr...@gmail.com wrote: I prefer emacs. Am I the only emacs user around here. On Feb 28, 3:14 pm, adam abennett...@sbcglobal.net wrote: I'm using Eclipse with PDT, but Dreamweaver for making layouts. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Routes Regex problem
Well, I have stumbled upon something I didn't think of. By realizing that cake goes through routes in order, I simply forward the 'exceptional' routes to their proper place (controller/action) and then leave all the rest '/*' to the appropriate single controller What say 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL Child Group
I have ACL set up and running fine with 4 groups admin: access everything managers: edit all agents: read all edit only their own investors: read and edit only their own What i completely forgot is that on the Investor side the investor might be company with different users of that profile Example ABC Investors is created by Joe Smith (he can edit the ABC Investor info) but he needs to add Jen Smith as a user of that profile so she can login and view the company profile. What is the easiest way to add this into the site? I was thinking ADD USER on the company page which would create a new user but cant seem to get my heed around linking her to the company profile and setting up her access. Thoughts? Suggestions? Thanks Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with paginator
Sorry, but I still don't understand why this work: ?php echo $paginator-last('last', array('url'=0));? and produce this correct link: http://127.0.0.1/assysts/index/0/page:6 and this not: ?php echo $paginator-next('next',array('url'=0),null, array ('class'='disabled'));? and produce this crazy link: http://127.0.0.1/assysts/next On Apr 15, 8:34 pm, Stu greenmushroo...@gmail.com wrote: the next and prev functions from paginator require an Options array as the second argument as you are currently giving it a boolean. You might want to go check out the paginator helper line 189 and 201. Good luck, Stu --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with paginator
I have solved. Problem was that the behavior of array_merge() was modified in PHP 5. Unlike PHP 4, array_merge() now only accepts parameters of type array. So I have modified line 312 of paginator.php helper, with a typecast: It was:$url = array_merge(array('page' = $paging['page'] + ($which == 'Prev' ? $step * -1 : $step)), $url); now is: $url = array_merge(array('page' = $paging['page'] + ($which == 'Prev' ? $step * -1 : $step)), (array)$url); and now it seems to work. Hope will help! On Apr 15, 8:34 pm, Stu greenmushroo...@gmail.com wrote: the next and prev functions from paginator require an Options array as the second argument as you are currently giving it a boolean. You might want to go check out the paginator helper line 189 and 201. Good luck, Stu --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with paginator
Sorry, but I still don't understand why this work: ?php echo $paginator-last(' ', array('url'=0)); and produce this correct link: http://127.0.0.1/assysts/index/0/page:6 and this not: ?php echo $paginator-next(' ', array('url'=0), null, array('class'='disabled')); and produce this crazy link: http://127.0.01/assysts/ On Apr 15, 8:34 pm, Stu greenmushroo...@gmail.com wrote: the next and prev functions from paginator require an Options array as the second argument as you are currently giving it a boolean. You might want to go check out the paginator helper line 189 and 201. Good luck, Stu --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Login attempts limitation
I want to give limitation for login attempt user authentication. Suppose user fail to login in continuous 3 attempts, his account should be locked, and he should not access that account till it unlock. Is there any facility in auth component to count login attempt and check it. Please 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
input name data[_method]
i have a problem, when i generate my form if input name has more level example (data[i][Model1][j][Model2][Model3]) it becames _method, data[i][Model1][j][Model2] work when i add [model3] it does not work. can you 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Cake
Thanks man. I appreciate it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Cake
Thanks. It helps. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with linked models
here: (`StockItem`.`size_id` = `Size`.`id` AND `Size`.`size_type_id` = 'StockItem.Product.size_type_id') After 'AND' you have something that is not automatically generated by cake. You must have something extra in StockItem-find() passed, or in relation definition (ie. in conditions field). Please pass some more code. John's right - we dont have anough info :) On Apr 16, 9:34 am, John Andersen j.andersen...@gmail.com wrote: In your controller, which fetches all the StockItems for a given product, how does it do that? Sorry for asking, but I do not see anything automatically fetching the required information, but I don't know all about CakePHP yet :) If you know the product, then you should fetch the stockitems from the product model point of view, not from the stockitem model point of view. John On Apr 16, 10:07 am, Toby goo...@toby-g.net wrote: There isn't a find call, I was relying on automatic call, as this seems to get it almost right. Do I need to specify the find call myself then? T On Apr 16, 6:24 am, John Andersen j.andersen...@gmail.com wrote: How does the find call look like in your controller? John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Reserved words in CakePHP?
Additionally You rather shouldn't name Your model/controller like Object/Objects and Page/Pages ;) On Apr 16, 12:52 pm, Mark (Germany) dereurom...@googlemail.com wrote: yeah i once proposed to change components into $this-FileComponent-foo() etc with Component attached to prevent this from happening but they did not care about that much in the core team at that point in time :) PS: same with helpers (conflicts between vars from controller): $poll (content array from table polls) $poll (helper) - better: $this-poll (like inside other helpers), or at lest $pollHelper-... On 16 Apr., 06:59, John Andersen j.andersen...@gmail.com wrote: Thanks Dr. Loboto, That may be, but not in my case, as I don't use any components together with my installations controller, and each model, loaded by request, does not have any conflict with CakePHP or other parts, so to sum it up, I am happy with that :) Enjoy, John On Apr 16, 5:36 am, Dr. Loboto drlob...@gmail.com wrote: There can be also conflict between models and components names (not classnames). On Apr 16, 1:45 am, John Andersen j.andersen...@gmail.com wrote: Thanks Dardo and Teh, but it turned out to be a conflict between all my models, when I loaded them all in an installations controller :) Solved by loading the models only by request (ClassRegistry). Enjoy, John [snip] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to validate texbox which is not related to table's field
Hello all.. I have a task list page in which all task listed(simple index.ctp).. Now in that index.ctp i have set a two text box in which user can enter a startdate enddate of project respectively. and according to that dates I show the projects. Now I want to validate user has enterd a valid date or not? so for that I have to use my own javascript validation or is there inbuilt facility in cakephp?? Thanx in advance.. vikas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Access to sql queries?
Hi. I'm new to cakephp. In debug-mode i see a running queries: SELECT `Picture`.`id`, `Picture`.`project_id`, `Picture`.`name`, `Picture`.`description`, `Picture`.`type`, `Picture`.`size`, `Picture`.`data`, `Picture`.`created`, `Picture`.`modified` FROM `pictures` AS `Picture` WHERE `Picture`.`project_id` = (8) How can I access this query? I want to display all db entries I can find with this query! Thanks in advance. Best. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Access to sql queries?
Best thing to do would be to read through the blog tutorial to give yourself a better understanding of how that all works. My guess is you did something along the lines of $this-Picture-id = $id; $this-Picture-read(); If you did something like the above two lines then change it to be $myPicture = $this-Picture-read(); Then you can use $myPicture to read out all the information stored with in the $myPicture which is going to be an array. On Apr 16, 9:01 am, Clemens clemens.kro...@gmail.com wrote: Hi. I'm new to cakephp. In debug-mode i see a running queries: SELECT `Picture`.`id`, `Picture`.`project_id`, `Picture`.`name`, `Picture`.`description`, `Picture`.`type`, `Picture`.`size`, `Picture`.`data`, `Picture`.`created`, `Picture`.`modified` FROM `pictures` AS `Picture` WHERE `Picture`.`project_id` = (8) How can I access this query? I want to display all db entries I can find with this query! Thanks in advance. Best. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Run an action with out a view? Is it possible?
And since I am not technically returning anything for these functions it shouldn't matter where the sit. But I guess for best practices I will just place them at the top of each function. Thank you all for your help. On Apr 15, 9:51 pm, Dr. Loboto drlob...@gmail.com wrote: $this-autoRender = false should be set before return statement, that's all. On Apr 15, 10:09 pm, jsundquist jsundqu...@gmail.com wrote: Thank you all. $this-autoRender = false; is exactly what I was looking for. Does it have to be at the top of the function or can it just be anywhere in the function. I currently have it at the bottom and I haven't noticed any problems as of yet. So does this mean I can possible expect some in the future? On Apr 15, 8:26 am, oliver.pra...@googlemail.com oliver.pra...@googlemail.com wrote: Well what also works is just calling another action in the controller at the last line ... e.g. $this-index(); etc. ... just make sure that action is defined with a view. Its not listed, but it works (it might also not be the cake way of doing things) On Apr 15, 12:45 am, Mark (Germany) dereurom...@googlemail.com wrote: oh, i just relized that this was your first point here^^ my mistake, overread that one On 15 Apr., 00:44, Mark (Germany) dereurom...@googlemail.com wrote: you forgot one: $this-redirect() as it always ends with exit() anyway but the proper way without redirect would be: $this-autoRender = false (anywhere inside that method in the controller) On 15 Apr., 00:08, Miles J mileswjohn...@gmail.com wrote: You can either do the following: - Have the delete action redirect once the logic is finished - Put $this-autoRender = false; at the top of the action - Put an exit() at the end of the action I personally would do the 1st or 2nd. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Layout Columns
Brian is correct. You should use $this-element() to format how you want each column on your page to be displayed. So you could have a right, left, and center view in your elements folder then have a variable set in your function for the view for each column. Each column then would could use the respected variable to display the data where you want it and how you want it formatted. On Apr 15, 6:58 pm, brian bally.z...@gmail.com wrote: $content_for_layout is essentially everything in your view, after PHP has parsed it. I think what you probably want is to use $this-element(). On Wed, Apr 15, 2009 at 7:24 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: So if I had ?php echo $content_for_layout; ? in default.ctp and then in the actual ctp for action say posts/view I could inside the view.ctp have 2 variables ?php echo $leftContent_for_layout; ? and ?php echo $rightContent_for_layout; ? for each side of the columns and define what would show up there by defining it in the controller view () action? Thanks, Dave -Original Message- From: dr. Hannibal Lecter [mailto:lecter...@gmail.com] Sent: April-15-09 7:28 PM To: CakePHP Subject: Re: Layout Columns Of course you can. $content_for_layout is nothing but a regular view variable, like the ones you set in your controller with $this-set(). On Apr 15, 10:43 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: Can you take 1 template (default.ctp) and define sections within it? I have a 2 col layout and would like to define what modules to load depending on the page a user is on / if logged in / by group How can this be done if all i have is ?php echo $content_for_layout; ? Thinking of Joomla where you can set what modules for each page is the idea. Is that possible? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Plugin architecture and plugin limitations
Could you show some examples (code, ideas, whatever) of what you tried to accomplish, so the CakePHP community can grow from your experience and/or maybe provide additional information to assist in finding a solution? There is no single line of code, nor will be until all the application architecture is clearly defined and probed. The goal is to build a Rich Internet Application (RIA) as a service (SaaS) for the management of a large travel agency. Current solutions I've seen are built on top of desktop platforms such as Microsoft Dynamics Navision or as standard server/client intranets. Both approaches have limitations: desktop applications cannot be accessed from outside the company without installing software on the computer. Web applications can, but are less usable and have a slower response. I'm interested in approaching this problem from a different perspective, trying to combine the best of the two worlds: a server/ client architecture over HTTP, but the server streaming just JSON or XML after AJAX requests instead of rendering web (X)HTML pages. Have a look at this: http://qwikioffice.com/desktop-demo/login.html The UI can be built directly on the DOM of the web browser by extensive use of Javascript. I'm planning to use the ExtJs (extjs.com) framework on the client for that. DOM generated controls combined with AJAX requests are far more powerful than standard HTML form widgets. So the scenario now is a little more complex: there are two apps (one in the server and one in the client) instead of one. And they are binded in a data-centric fashion just by JSON data (no code nor markup between). On the server side I plan to use a RDBMS such as MySQL or PostgreSQL and CakePHP. There will be no (X)HTML views except for the frontpage. When the user triggers an action in the UI, an AJAX request is sent to the server and attended by a controller, which will send back just a JSON with the requested data (may be a list or a record from the DB). The pros of this approach are obvious for the user, which would be able to use a web application as a single-page website, with the benefits of desktop software: good responsiveness and shortest delays between actions. As an example, the user can open two windows (JS modal windows) in the same browser tab, each with different views (say the passenger list of two different flights) at the same time for comparing, as well as to move the windows around, resize them or edit different records at the same time. This is not possible with the traditional intranet approach, where requesting a view necessarily closes the previous one. Such an application needs to be extensible. A tiny core can be easily built to provide a basic interface to customers, workers, targets and flights, but a client may ask to a solution for managing terrestrial transport (buses, drivers, stops, timetables...). Implementing this into the core would add extra complexity and affect the stability for sure. This is why I'm interested and making some little research these days about how to build a plugin architecture for a MVC application running over PHP. AFAIK there wont be a problem in the client side, because Javascript objects can be redeclared and extended easily, but none of this can be done with PHP and Cake. Or at least that's what I have came up to. I find this is very interesting because such a plugin architecture can be later applied to many other applications and scenarios. Feel free to share your thoughts or experiences here in this thead. -- jaime a t iteisa d o t com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: EmailComponent - Proper usage for mass mailing
I've been sending 3000+ emails using SwiftMailer[1]. There's a SwiftMailerComponent at the Bakery (I had to modify it quite a bit, though). I'm sending 6000+ emails every day with SwiftMailer in a shell task and is working great! I recommend you using something like daemontask [1] to control how many cron tasks are you running. [1] http://bakery.cakephp.org/articles/view/daemontask Regards, - Dardo. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Layout Columns
Also, if you want to be able to enable/disable one or another element, have a look at this: http://snook.ca/archives/cakephp/elemental_conditional_content_with_cakephp/ It's a bit old now so I expect you'd need to update it somewhat, unless Jonathan has already done so. On Thu, Apr 16, 2009 at 10:20 AM, jsundquist jsundqu...@gmail.com wrote: Brian is correct. You should use $this-element() to format how you want each column on your page to be displayed. So you could have a right, left, and center view in your elements folder then have a variable set in your function for the view for each column. Each column then would could use the respected variable to display the data where you want it and how you want it formatted. On Apr 15, 6:58 pm, brian bally.z...@gmail.com wrote: $content_for_layout is essentially everything in your view, after PHP has parsed it. I think what you probably want is to use $this-element(). On Wed, Apr 15, 2009 at 7:24 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: So if I had ?php echo $content_for_layout; ? in default.ctp and then in the actual ctp for action say posts/view I could inside the view.ctp have 2 variables ?php echo $leftContent_for_layout; ? and ?php echo $rightContent_for_layout; ? for each side of the columns and define what would show up there by defining it in the controller view () action? Thanks, Dave -Original Message- From: dr. Hannibal Lecter [mailto:lecter...@gmail.com] Sent: April-15-09 7:28 PM To: CakePHP Subject: Re: Layout Columns Of course you can. $content_for_layout is nothing but a regular view variable, like the ones you set in your controller with $this-set(). On Apr 15, 10:43 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: Can you take 1 template (default.ctp) and define sections within it? I have a 2 col layout and would like to define what modules to load depending on the page a user is on / if logged in / by group How can this be done if all i have is ?php echo $content_for_layout; ? Thinking of Joomla where you can set what modules for each page is the idea. Is that possible? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: EmailComponent - Proper usage for mass mailing
I think I'd have to get a VPS or a PS for my host to allow that many emails per day. :) Regardless, I know CakePHP's EmailComponent is great for one-off emails, but...no one's used it for larger scale mail campaigns or sending? I'm a little surprised, I would have thought someone would have tackled that by now. From other threads on using/sending emails, there are two popular packages for sending emails, and there's always Zend's email component as a vendor, but I was really hoping someone out there tried using the internal option from CakePHP. My usage isn't nearly large enough to properly test and tweak it for large- scale use, but I still think I'll be using it. I'd still love to hear from anyone else who has been doing things with email, and I heartily thank those who have commented thus far! On Apr 16, 11:01 am, Dardo Sordi Bogado dardoso...@gmail.com wrote: I've been sending 3000+ emails using SwiftMailer[1]. There's a SwiftMailerComponent at the Bakery (I had to modify it quite a bit, though). I'm sending 6000+ emails every day with SwiftMailer in a shell task and is working great! I recommend you using something like daemontask [1] to control how many cron tasks are you running. [1]http://bakery.cakephp.org/articles/view/daemontask Regards, - Dardo. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
What CI tools does cake core use?
I'm doing some research and trying to find best tool set for projects I run. Because cake is my favourite application - CakeTeam is my favourite dev team and I probably could follow the example and find out if it suits for me. Anyway I'm wondering (or know but want to list all elements of this puzzle) which tools are used, to perform tasks as: - Source Code Management (yeah, I know it's SVN, that just for the record) - Unit Testing - It's SimpleTest, I peaked into svn source ;) - Automated builds - is it Phing? Do You use SchemaSchell to create database, and Fixtures, to populate data (probably yes) If it's Phing and SimpleTest so far: that means Phing can cooperate with simpletest (Phing site mentions just PhpUnit), right? - Continuous Integration (that glues those above)- is it Xinc? Please don't let me die for curiosity ;) Greg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to validate texbox which is not related to table's field
if you want to validate by posting, it doesnt matter if those fields are in the DB or not just set up the rules and cake will validate those as well if you want to validate them directly by JS, you have to validate it manually On 16 Apr., 15:56, vikas vikas...@gmail.com wrote: Hello all.. I have a task list page in which all task listed(simple index.ctp).. Now in that index.ctp i have set a two text box in which user can enter a startdate enddate of project respectively. and according to that dates I show the projects. Now I want to validate user has enterd a valid date or not? so for that I have to use my own javascript validation or is there inbuilt facility in cakephp?? Thanx in advance.. vikas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Helper not being found
Hi, I am new to CakePHP and have what may be a configuration problem (Vista, xampp). I installed CakePHP in the c:\xampp\htdocs\cake directory and have several projects underneath of this directory (say one and two). I then installed my first custom helper in c:\xampp\htdocs\cake\one\views \helpers directory (state_list.php). I added StateList to the helpers array in the controller but I receive an error message indicating that the helper class was not found and that I should create the file one \views\helpers\state_list.php. Any ideas? Thank you for your help. Ernie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Plugin architecture and plugin limitations
A *VERY interesting* reading on the subject: http://blog.fedecarg.com/2008/06/28/a-modular-approach-to-web-development/ MVC is about loose-coupling, and Modular Programming takes that concept to the extreme. A modular application can dynamically load and unload modules at runtime, completely separate applications in their own right, which interact with the main application and other modules to perform some set of tasks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with linked models
Ah. My fault. It would appear that I had a condition in the belongsTo relationship that was not needed... 'conditions' = array('Size.size_type_id' = 'StockItem.Product.size_type_id'), Thanks for your help. T On Apr 16, 2:49 pm, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote: here: (`StockItem`.`size_id` = `Size`.`id` AND `Size`.`size_type_id` = 'StockItem.Product.size_type_id') After 'AND' you have something that is not automatically generated by cake. You must have something extra in StockItem-find() passed, or in relation definition (ie. in conditions field). Please pass some more code. John's right - we dont have anough info :) On Apr 16, 9:34 am, John Andersen j.andersen...@gmail.com wrote: In your controller, which fetches all the StockItems for a given product, how does it do that? Sorry for asking, but I do not see anything automatically fetching the required information, but I don't know all about CakePHP yet :) If you know the product, then you should fetch the stockitems from the product model point of view, not from the stockitem model point of view. John On Apr 16, 10:07 am, Toby goo...@toby-g.net wrote: There isn't a find call, I was relying on automatic call, as this seems to get it almost right. Do I need to specify the find call myself then? T On Apr 16, 6:24 am, John Andersen j.andersen...@gmail.com wrote: How does the find call look like in your controller? John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Internationalization in find results
Hey guys, I would be surprised to find a solution to this, but here it goes. basically what I want to do is, get a list result from find while still being able to translate the resulting data with : __('word') Didn't catch that now did you? I don't blame you.. here's some code to clear it up: In my Holiday Controller: -- // Simple, just populating an array with holiday names then sending it to my view // $oneHolidays = $this-OneIvrHoliday-OneHoliday-find('list'); $this-set(compact('oneHolidays')); -- In my add.ctp -- //I'm populating my dropdown list with the array I got from my controller, but I my Internationalization to translate them echo $form-select('holiday_id', $oneHolidays, null, null, false); -- Is this even possible? Does anyone have any better advice? I'm pretty sure I'm just complicating things Thanks in advance for any help provided --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Quick debugging question
Yeah, it's just because the function went through as normal but the there was 2 columns that were left empty, I pr'd $this-data and everything was fine. My next debugging idea was to check what the query looked like. Even with the debugging at 2, it didn't show the INSERT query, so I thought there must of been a particular piece of code somewhere that printed INSERT queries as they went through...? Is there? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Quick debugging question
I just caught on to what you were saying Brian, just exit(); your controller before the redirect and they print right there... Makes sense... 'slaps forehead'. Thanks man --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using setAction
I have a need to redirect from one action to another action in the same controller and not have the URL change. I think I can use setAction to accomplish this rather than redirect but I have a couple of questions. 1. I need to pass 3 parameters but I've only seen examples using 1 parameter. Is the following code correct? function index() { $param1 = $_GET['param1']; $param2 = $_GET['param2']; $param3 = $_GET['param3']; if ($param1 == 'x') $this-setAction('view_names', $param1, $param2, $param3); //other things here $c = 0; } function view_names($a, $b, $c) { //code here } 2. When setAction is executed above, does the code that comes after also executed or do I need an exit(), similar to how redirect can be made to work? Thx. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Helper not being found
Are you calling the class right? class StateListHelper extends... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using setAction
hi! tried $this-view_names($param1, $param2, $param3); ? hope i helped. 2009/4/16 bondo kevd...@gmail.com I have a need to redirect from one action to another action in the same controller and not have the URL change. I think I can use setAction to accomplish this rather than redirect but I have a couple of questions. 1. I need to pass 3 parameters but I've only seen examples using 1 parameter. Is the following code correct? function index() { $param1 = $_GET['param1']; $param2 = $_GET['param2']; $param3 = $_GET['param3']; if ($param1 == 'x') $this-setAction('view_names', $param1, $param2, $param3); //other things here $c = 0; } function view_names($a, $b, $c) { //code here } 2. When setAction is executed above, does the code that comes after also executed or do I need an exit(), similar to how redirect can be made to work? Thx. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: XML parsing
Thanks for your help mxcdex. It all is working fine, except the line: $success = $this-Team-saveAll($xml['Teams']); This doesn't save anything, or appear to be doing anything. It doesn't produce an error message, nor does it save the records. I've tried all combinations of Team, Teams, team and teams. But none of them appear to work. Any clues? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Internationalization in find results
On Thu, Apr 16, 2009 at 2:54 PM, Stu greenmushroo...@gmail.com wrote: basically what I want to do is, get a list result from find while still being able to translate the resulting data with : __('word') You seen the TranslationBehavior? http://book.cakephp.org/pt/view/794/Attaching-the-Translate-Behavior-to-your-Models Best regards. -- MARCELO DE F. ANDRADE Belem, PA, Amazonia, Brazil Linux User #221105 http://mfandrade.wordpress.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: XML parsing
On Apr 16, 7:07 pm, smithtrev...@googlemail.com smithtrev...@googlemail.com wrote: Thanks for your help mxcdex. It all is working fine, except the line: $success = $this-Team-saveAll($xml['Teams']); This doesn't save anything, or appear to be doing anything. It doesn't produce an error message, nor does it save the records. I've tried all combinations of Team, Teams, team and teams. But none of them appear to work. Any clues? As far as errors go, what debug level do you have set in your cake app config? Does it produce any SQL? Also, for the xml at that url (the last I downloaded it), 'Teams' should be contain the array needed by saveAll to save multiple team records to the database. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
find('list'): Filtering by a related table's field
PropertyImage hasOne Property. Why can't I do this: ?php // APP/controllers/properties_controllers.php $check_property_images = $this-PropertyImage-find('list', array( 'fields' = array('id'), 'conditions' = array( array('Property.mls' = '80578'), ), )); debug($check_property_images); ? But when I use find('all') it works? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Plugin architecture and plugin limitations
Thanks Jaime, As I understand it: 1) The user interface (UI) is completely managed in the browser environment. 2) The business logic (BL) is managed in a CakePHP application in the server environment. 3) The storage logic is managed partly by the CakePHP application and a database engine (MySQL). 4) Communication between UI and BL is messages with data only. The primary issue as I see it: 1) Is the communication (messages) definitions independent of both UI and BL? If this is not the case, then yes, it will be very difficult to add new functionality without having to rewire other parts. Possible solution idea (configurable message based framework): 1) UI: sends only informative messages (I have done this message) with data. 2) BL: processes informative messages in one controller only, using request action to inform other controllers. 3) BL: uses a configurable message handling, so that new message handling can be added when new functionality is implemented. Example (simple): Use case: The UI implements the presentation of a photo album with 10 thumbnails shown per page. The user can open the photo album, turn the pages and choose a thumbnail to see the full photo. Work flow: 1) User opens the photo album. 1.1) UI sends the message open photo album. 1.2) BL looks up the configuration for open photo album 1.2.1) BL invokes request action to PhotoAlbumController for action Open. 1.2.1.1) PhotoAlbumController processes the action and returns the photoalbum data. 1.2.2) BL prepares new message photo album opened with the returned photoalbum data. 1.3) BL delivers the message photo album opened with the data. 1.4) UI presents the data in the photo album opened message. 2) User chooses a thumbnail. 2.1) UI sends the message photo thumbnail chosen. 2.2) BL looks up the configuration for photo thumbnail chosen. 2.2.1) BL invokes request action to PhotoController for action Show. 2.2.1.1) PhotoController processes the action and returns the photo data. 2.2.2) BL prepares new message photo shown with the returned photo data. 2.3) BL delivers the message photo shown with the returned photo data. 2.4) UI presents the photo. Now comes the time that new functionality is requested, when choosing a photo, the photo may have a sound track associated with it, which is to be played when showing the photo. The changes are implemented as: 2) User chooses a thumbnail. 2.1) UI sends the message photo thumbnail chosen. 2.2) BL looks up the configuration for photo thumbnail chosen. 2.2.1) BL invokes request action to PhotoController for action Show. 2.2.1.1) PhotoController processes the action and returns the photo data. 2.2.2) BL prepares new message photo shown with the returned photo data. 2.2.3) BL invokes request action to SoundController for action PhotoSound. 2.2.3.1) SoundController processes the action and returns the sound data. 2.2.4) BL prepares new message sound playing with the returned sound data. 2.3) BL delivers the messages photo shown and sound playing with the returned data. 2.4) UI presents the photo and plays the sound. Conclusion: The important part of the above, is that the UI and the BL are independent of each other. This is done by having messages that are independent of both UI and BL, but the messages can be understood by both! Well, not easy only using text to present a message based solution :) Hope this helps you on the way, John On Apr 16, 9:09 pm, Jaime ja...@iteisa.com wrote: A *VERY interesting* reading on the subject: http://blog.fedecarg.com/2008/06/28/a-modular-approach-to-web-develop... MVC is about loose-coupling, and Modular Programming takes that concept to the extreme. A modular application can dynamically load and unload modules at runtime, completely separate applications in their own right, which interact with the main application and other modules to perform some set of tasks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---