Re: How to get all Tags in manual Saving hasAndBelongsToMany example
replying to my own it should use $this-Post-Tag-generateList() Thanks for looking --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Association help for an internal table hierarchy
I use even shorter keys id and pid since I like short names. I was writing out long names to make them obvious in the source as to what they are. Use whatever names you want. Just make sure to use cake conventions or make sure you set the table and all of the keynames in the model --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: n00b with ACM questions
Hi When is 1.0 coming out? thx :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Connecting to the database directly and cron jobs
I too will soon be requiring this sort of functionality. I would also value a definitive answer to the question. Regards, Langdon Matt wrote: I've recently started porting a site to CakePHP and have a couple of questions regarding cron jobs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Mail templates
I want to send several emails in my Cake PHP app. Is there a way to make use of the existing template system in Cake? I do not want to specify the message body directly in the code. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Connecting to the database directly and cron jobs
It seems that Rails too, and perhaps MVC frameworks in general, have similiar issues with cron jobs: http://www.rubyinside.com/rails-cron-a-way-to-run-background-tasks-with-your-rails-app-53.htm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
model query trouble
Hello! I have this in my model: return $this-execute('SELECT COUNT (*), manufacturers.id, manufacturers.name FROM manufacturers LEFT JOIN products ON manufacturers.id=products.manufacturer_id GROUP BY products.manufacturer_id'); this code works fine in phpMyAdmin, but cake debug info: SELECT COUNT (*), manufacturers.id, manufacturers.name FROM manufacturers LEFT JOIN products ON manufacturers.id=products.manufacturer_id GROUP BY products.manufacturer_id 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(*), manufacturers.id, manufacturers.name FROM manufacturers LEFT JOIN products ' at line 1 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: model query trouble
Sorry, my fault! there was a space between COUNT and (*) )) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Mail templates
see the wiki, there're tutorial for sending email using the templates of cake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Connecting to the database directly and cron jobs
Other approach is something like: http://rossoft.wordpress.com/2006/03/27/poor-mans-cron-component/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Mail templates
Thanks alot. I searched for mail with the help of the wiki search but nothing turned up. After you pointed out that there are some articles dealing with this topic, I looked at the table of contents on the front page of the wiki and discovered some useful tutorials. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: CakePHP screencasts
Great Stuff!On 6/24/06, Larry E. Masters aka PhpNut [EMAIL PROTECTED] wrote: I have created a new screencast series Getting Baked on CakePHP. The first episode, Using Debug Messages is available on our screencast page...In this 15 minute video, we will walk through building a basic cake application using the debug messages. CakePHP provides a simple debugging system that will display the sample code needed to create your models, views and controllers.http://cakephp.org/screencasts-- /*** @author Larry E. Masters* @var string $userName* @param string $realName * @returns string aka PhpNut* @accesspublic*/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
custom foreignKey not working in depper associations
Hi! Please excuse this rather long post; my English isn't that advanced and therefore it's ahrd to explain things the short way. Maybe I'm going to say the same thing twice, using another expression or so, hoping you can get the meaning out of them combined :) To describe my problem: If I show a news item, the comments are associated (i show them as well) and for each comment there's a user. The news and the comments refer to the user via 'foreignKey' = 'author_id' because that makes more sense than user_id would do while reading and writing the templates. That's no big deal, though. I created a static page, so only the sidebar contains a query to fetch the logged-in user's details. I associated news and comments to the user via User::hasMany, changing the foreignKey value to 'author_id' as well (as proposed in the manual on hasMany: http://manual.cakephp.org/chapter/6). For the sidebar there is a query for the user's data which leads to a query for his news and comments. Using debug mode on level 2, I see the query, and there are 3 news and 1 comment fetched. That's what there is in my DB, so everything is fine. Yeah, now there's a problem though. Then I show a single news post, written by me. One of the 3 the DB found for my user data above. The news post is fetched and the author (refered to as 'Author' in my relationship, so its SELECT `Author`.`id` FROM `user` as `Author` instead of `User`!) can be found as well. Remember what I told you about querying the DB for a user? Because of a high 'recursive' value, the author's contents (news and comments) should be fetched as well. And there's the problem (see the queries far below). The news item is there, then the news' author is there, but the news' authors' comments don't show up, because the author_id is tested on NULL isntead of an integer value. I suppose the WHERE-clause is made like this: ' WHERE `Comments`.`author_id` = ' . $someArray['User']['id'] wheras it should be 'Author' as well (because the news refered to the user this way). Sounds like some kind of bug to me. The tables' alias is changed in one query, but all querys afterwards expect the default alias (`User`). It's hard to express what I think because I lack a lot of English vocabulary... The supposedly used array index 'User' is derived from the model's name (class User extends AppModel), a class/model called Author is not available but supplied by the news. I hope you can get a glimpse of what I try to say... Is there a way to fix this? Using User instead of Author for describing the relationship isn't a good solution since the code will lack readability then :( Well, thanks in advance for any suggestions! - Christian The SQL queries (hopefully you all got fixed fonts :)) Fetching the news SELECT `News`.`id`, [...] ,`News`.`author_id`, `Author`.`id`, [...] ,`Author`.`email` FROM `news` AS `News` LEFT JOIN `users` AS `Author` ON `News`.`author_id` = `Author`.`id` WHERE (`News`.`id` = 6) LIMIT 1 Fetching the news' author (id=2 is me) SELECT `Author`.`id`, [...], `Author`.`email` FROM `users` AS `Author` WHERE `Author`.`id` = '2' Fetching the news' author's comments SELECT `Comments`.`id`, [...] `Comments`.`author_id` FROM `comments` AS `Comments` WHERE `Comments`.`author_id` = NULL --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Multipurpose classes
in the folder install/app/vendors/ or in /install/vendors then load the classes through vendor('mydir/myfile') -- it will load vendors/mydir/myfile.php (it looks in the two vendors folders) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: CakePHP screencasts
Really good effort. Screencasts are a very nice way for newcommers to get an idea of how to work with CakePHP. It's really not a bad way to run tutorials either. Nice work everyone involved. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: HABTM recursively
It all works as it should in my current app. What I have done (since v1.0) is to pass the recursive value as a parameter to find like this: $me = $this-Userfind(id = $myID,null,null,3); // cake 1.0 changed recursive The last parameter is the level of recursion for the find (3). All my models stopped recursing by default whe I updated Cake a few months ago. I guess the recursion is very low by default as a preformance enhancer or something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: HABTM recursively
I found out that recursion seems to work well. There is a query in debug mode 2, but the values are wrong; more precisely, the Comment.author_id is tested with NULL. Querying for a user only results in all his comments included in the result as supposed. Querying for a news item, which queryies for an 'Author', which therefore queries for comments, that doesn't work. Same with news-comments-author. I think that's because the news refer to users as 'Author' (alias in the query as well) but the author's comments may expect 'User' in some way, I don't know how cake handles this and I'm not able to find out by browsing the code :S Described the whole thing there: http://groups.google.com/group/cake-php/browse_thread/thread/25035ff3c0a24550/efda7db325b09378 But thanks for your help. Didn't know about the last parameter in find() :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: n00b with ACM questions
We are looking to get 1.0 out sometime in July. :-) Ryan Hi When is 1.0 coming out? thx :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Doesn't save, but no errors
What is loaded into your $this-data array? Check this array for possible problems. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Add script to head dynamically in controller or view
Hi - we have a customized default.thtml layout file with all of the common navigation to be displayed at the top of each page. Lots of the individual views that use this layout use external javascripts and they need script tags in the head of the page. I don't want to stick all of the script tags into the head in default.thtml, because I don't want 10 unused javascripts to be loaded on each page - I only want the needed javascript to be loaded by the view that uses it. What's the best way to dynamically insert script tags into the head tag of a layout? I've seen HeadHelper - is that what it's for? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Passing data from modelA to ModelB.
what I want too do is that every time I add a record to the Table Transacction increaso o decrease the quantity_onhand value of the table Onhand. On 6/23/06, bigdog [EMAIL PROTECTED] wrote: Would an intermediate table solve your problem to communicate with Transactions and Onhand? I saw this awhile back: http://groups.google.com/group/cake-php/browse_thread/thread/46da519d4b648d48/?hl=en# --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Add script to head dynamically in controller or view
HeadHelper is your choice :) just set $helpers=array( , 'Head' ); in your AppController, and ?php echo $head-print_registered()? in your layout. then in your views, you can do $head-register_js('myjsfile') or $head-register_jsblock('some_javascript_instructions'); (also you can use HeadHelper in your own helpers) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Where DAO object's should be?
Hi, I'm new to CakePHP and I have a simple question. Where should I put DAO object's. I don't realy understand why Model object are used to get data (isn't they only the model?) I would like to get data from databases, xml, simple files, through SOAP, etc. and use model as data beans. DAO object wil get the data from data source. Should I overide findAll etc. functions in the Model class. If Yes, where should I place DAO object in the CakePHP hierarchy? (sory for my English) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Where DAO object's should be?
Take a look at WebModel and RssModel in http://cakeforge.org/snippet/browse.php?by=langlang=5 maybe it can help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Components and Elements inside a Plugin
Does anyone know how to accomplish this? If I place a component or element in the logical place in the plugin folder I get not found errors. But if I place them in the normal Cake location it works fine. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cake Sheet
We're working on one for the rest of the API as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Doesn't save, but no errors
I've also updated to the latest stable just to see that wasn't the problem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Proofread my tutorial on contextual help
Hi everyone, I just finnished a tutorial in the wiki. Any feedback would be great. Better to catch problems before too many read it :) The tutorial is a walkthrough of a very simple context help I built for my app earlier today. The tut is here: http://wiki.cakephp.org/tutorials:simple_contextual_help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Showing errors in Comment submission on the same page as Post
Probably you might use requestAction in your articles 'view' function requestAction('/comments/add'); requestAction('/comments/index''); and, in the comments add function, use redirect() to go back to the Article page ... (just like the default delete() function) , using getReferrer(); from the requestHandler component... spark On 6/21/06, .. [EMAIL PROTECTED] wrote: Hello All, Pardon me if this has been asked before. After experimenting with the Blog tutorial I added a comments model - the association etc worked fine and I can show all the comments on the same page as the post. Next I added a Form for adding comments in the same view as post using the html helper. Everything works great if there are no data validation errors in the comment and the comment gets added and the Comment/add action redirects the user to the post page. However I cannot figure out that if any of the comment fields do not validate - how to show the same post page with the comment form filled in with the submitted data and errors. (like it happens in most blogs) I know there can be work around of showing a differnt page when an error occurs OR I use a pop-up window for comment OR I use AJAX OR worse I add an addComment action to my Posts controller (ugh) But I do not want any of these work arounds. At tips in the right direction preferably with code samples would be appreciated Thanks in advance .. -- [web] http://synapsisdi.com.br [livesets] http://djspark.com.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Can i get $webroot for a vendor library?
I found out a way by importing the $Dispatcher. function _construct($src = null) { global $Dispatcher; $this-webroot = $Dispatcher-webroot; } Any other clean way for our public? ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Can i get $webroot for a vendor library?
Any particular reason not to use Components? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Can i get $webroot for a vendor library?
Because i need to used in the view and/or the controller. Probably i'm missing something. I'm kind of new to MVC. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Doesn't save, but no errors
Are you using routes for anything in the users controller? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cross Database Association
I recently had this problem as well. I'm using the newest build. I added alternate db credentials and this fixed the issue. So for me the current code base seems not to work. Anyone have any suggestions i should look at to see what the problem could be because i'd like to have this working w/o different db info. Thanks, Jesse Shaf wrote: Thank you so much Nate, that's working perfectly now. :D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Can i get $webroot for a vendor library?
Logan wrote: Because i need to used in the view and/or the controller. Probably i'm missing something. I'm kind of new to MVC. If I'm not mistaken, you can access components from the view (just not helpers from the controller). If you are serving an image generated on the fly, you could also set a null layout and simply have the component output the headers, create the image, and read() it or whatever, then call exit. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: How to update multiple divs with one ajax call
Okay, this is working fine on the following: PC: Firefox 1.5.0.4 Mac: Firefox 1.5.0.4, and 1.0.7 Clearly there's something else at issue here. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cross Database Association
Once again, this is not a bug in Cake, it is a feature in PHP's MySQL library. See the link above for the correct changes to make in your DB config. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---