Re: Cannot use Model only for Validation (no table behind) $useTable = false;
if i use $useTable = null; it throws me this error: No Database table for model Sms (expected "sms"), create it first. --~--~-~--~~~---~--~~ 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: Polymorphism in Cake Models
Thanks John. I am pretty new to PHP. Been programming in it for about 6 months and just found Cake. I'm absolutely loving it. I appreciate the help. I'll try using the functions you suggested. Brian --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to/where to set ADODB config instructions + utilise adodb methods.
Does anybody know where in cake you set adodb instructions such as $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC. Also, how do you utilise adodb methods such as execute to retrieve database records and how do these methods interact with the cake standard model methods such as findAll etc. Thanks in advance. --~--~-~--~~~---~--~~ 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: Getting Cake to work without access to the apache config file
And probably tweak the settings in index.php. See this section in the manual: http://manual.cakephp.org/chapter/installing. Chech out the "Advanced Setup: Alternative Installation Options" section. --~--~-~--~~~---~--~~ 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: Getting Cake to work without access to the apache config file
You could just use your public_html directory as the app root. --~--~-~--~~~---~--~~ 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: need to use find() on complex relationship
Thanks for your input - it has been helpful :). --~--~-~--~~~---~--~~ 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 operate relational database in cakephp
Can you post pastes of your models?http://cakephp.org/pastes/addIt seems like if you get the relationships setup right and the table structure is solid it shouldn't be a problem. I we can look at your models and possibly your DB schema we can suggest some changes and then at the very least you should be able to generate enough code with bake.php to get started. On 8/16/06, Don DeCosta <[EMAIL PROTECTED]> wrote: Chris Hartjes wrote:> Um, I think this is a question that goes beyond CakePHP. This is> basic "how to create a page that has a form that you can submit".I have the same question and I think it is a CakePHP question. I've got a view up that shows me a Client and lists its Sites and I'vegot a link that says, "Add Site" I, obviously, want to add a Site tothe current Client... How to I pass the client_id to the Add Site view? (I'm using $this->Set(...)) to pass the client_id to site's Add viewand making it a hidden field on the form which then gets submitted backto the Add Site controller.But it's not very clean and I think I'm approaching the problem wrong... I've done these types of forms before using POP (Plain ol'PHP) so I know how to do a form and submit and a MySQL UPDATE and allthat jazz but I thought Cake would be a little cleaner.Any clues to how I'm misthinking the solution would be appreciated. Don --~--~-~--~~~---~--~~ 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 do you get beforeRender to work?
Nevermind, something elsewhere wasn't loading right and it was preventing my beforeFilter action from occuring. --~--~-~--~~~---~--~~ 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: Polymorphism in Cake Models
On Aug 16, 2006, at 6:23 PM, nate wrote: > > Are you new to PHP? > > Cake is written in PHP, and PHP does not support polymorphism. So no, > Cake does not support polymorphism. You might be able to get by using some nice PHP5 functions, though: class_implements() class_parents() is_subclass_of() -- John --~--~-~--~~~---~--~~ 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 operate relational database in cakephp
Chris Hartjes wrote: > Um, I think this is a question that goes beyond CakePHP. This is > basic "how to create a page that has a form that you can submit". I have the same question and I think it is a CakePHP question. I've got a view up that shows me a Client and lists its Sites and I've got a link that says, "Add Site" I, obviously, want to add a Site to the current Client... How to I pass the client_id to the Add Site view? (I'm using $this->Set(...)) to pass the client_id to site's Add view and making it a hidden field on the form which then gets submitted back to the Add Site controller. But it's not very clean and I think I'm approaching the problem wrong... I've done these types of forms before using POP (Plain ol' PHP) so I know how to do a form and submit and a MySQL UPDATE and all that jazz but I thought Cake would be a little cleaner. Any clues to how I'm misthinking the solution would be appreciated. Don --~--~-~--~~~---~--~~ 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 do you get beforeRender to work?
i've tried added $beforeFilter = array('beforeFilter'); and it still does nothing --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
how do you get beforeRender to work?
i've added this function to my appController. as far as i know this should be called automatically by every controller on my site, however, none of them do. what am i doing wrong? -thanks function beforeFilter() { echo "WTF"; $this->set('userID', 0); $this->set('username', ''); $this->set('auth', false); $this->set('query', ''); if (isset($this->HeaderVariable)) { $this->HeaderVariable->controller = &$this; } return true; } --~--~-~--~~~---~--~~ 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: Getting Cake to work without access to the apache config file
What I'm trying to to is use a url like mysite.com/users instead of mysite.com/cake/index.php/users and instead of mysite.com/cake/users --~--~-~--~~~---~--~~ 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 actions return a value without doing anything with a view
So does that mean that the original view which makes the ajax call has access to variables that the returned view has access to? Thank you --~--~-~--~~~---~--~~ 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 associate models without tables?
The flexibility of not having a table would only be short term however.When it comes time to add features or expand your application you might be finding yourself needing to add the table anyway.It is a little more work upfront, but in the long run it can save you some headache. On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Good Idea.The flexiblity of not having to have a database table for every model would nice though. --~--~-~--~~~---~--~~ 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 associate models without tables?
Good Idea. The flexiblity of not having to have a database table for every model would nice though. --~--~-~--~~~---~--~~ 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: Polymorphism in Cake Models
Are you new to PHP? Cake is written in PHP, and PHP does not support polymorphism. So no, Cake does not support polymorphism. --~--~-~--~~~---~--~~ 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: Outputting Code on a Website
It looks like CakeBin is using GeSHli (which looks like what I was looking for).Thanks for the replies.On 8/16/06, Chris Lamb < [EMAIL PROTECTED]> wrote:HiOn Wed, 16 Aug 2006 15:19:59 -0700 "John Zimmerman [gmail]" <[EMAIL PROTECTED]> wrote:> Basically I just want to display php code within a web page.GeSHIi[0] seems to be the de-facto library for doing this. Chris[0] http://qbnz.com/highlighter/-- Chris Lamb, Cambs, UK WWW: http://chris-lamb.co.uk Q. Why is top posting bad? GPG: 0x634F9A20 A. Because it breaks the logical sequence of discussion --~--~-~--~~~---~--~~ 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: API documentation needs stylesheet change
Ralph thanks for sparking the fire and submitting some styles. John the ticket was needed, thanks for adding it. The time needed to fix it was trivial, the reason to fix it was not. Bake on. --~--~-~--~~~---~--~~ 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: Optimizing cake projects
@bwaters APC has worked well for me, seemed faster than all the others persistModel is a beauty and largely mitigates any need for view caching one thing to look at if you have a lot of associations is using unbindModel to remove any associations that will not be used for the particular action. I would not worry too much about the query caching. Cake will cache duplicate queries automagically. The view layer in Cake does a lot of work. So, using requestAction in elements will save a lot. In fact, in my opinion requestAction should not be used to return a view more than once per request, if at all. There is a long thread where i discussed that. Other than that, I think you are on the right track. --~--~-~--~~~---~--~~ 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: AJAX Update not working
josh southern wrote: > For IE - that ended up being a problem with my Norton Internet Security > Popup Blocker. If I disable that (or add the site I'm working on to the > white list), everything works perfect in IE as well. That's really disturbing to me. I'm working a very large app that relies heavily on ajax updating. I'd been having this issue in IE as well, and if it's the fault of the popup blocker, I'm going to have some trouble. Since when do popup blockers block ajax? Does anyone have any more information on this? --~--~-~--~~~---~--~~ 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: Help for a New User... Please!
On Aug 16, 2006, at 4:39 PM, Llama Llama Llama wrote: > > I'm sure there is someone on here who can help me. I am just getting > my feet wet with CakePHP, and I've hit several roadblocks. I know all > of them have to do with mod_rewrite, but I don't know how to fix them. > > One of the big problems is that my server won't allow mod_rewrite > to be > accessed from .htaccess files for security reasons. I was told that > the contents of the three .htaccess files need to be entered into a > field on my web server admin labeled "additional apache directives." > However, I can't seem to find the text of any of the .htaccess files, > making it very hard to do that. Kinda depends on where your document root is. You don't have to use mod_rewrite: you can use Cake's built-in pretty URLs by modifying a few settings in /app/config/core.php. The URLs end up looking like: http://example.com/index.php/posts/index or http://example.com/cake/index.php/posts/index Rather that the mod_rewrite ones (which would look the same, minus the index.php). > I know that there are ways to run CakePHP without using mod_rewrite, > but I can't seem to get that to work either. (I have un-commented the > line in the core.php file, but I don't know what else needs to be > done.) Delete the .htaccess files, and access Cake using the naming I've specified above. > What I am trying to do at this point is work through the SitePoint > tutorial > (http://www.sitepoint.com/article/application-development-cakephp). I > get the database to connect and all that fun stuff, but even when I > just do the scaffolding, www.mydomain.com/notes gives me a 404 error. Yeah, you might try http://yourdomain.com/index.php/notes/ -- John --~--~-~--~~~---~--~~ 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 actions return a value without doing anything with a view
On Aug 16, 2006, at 4:36 PM, codecowboy wrote: > > Hi, > > I want to make an ajax call to to a controller action that simply > returns data that is retrieved from the database. I don't want the > action to render a view or anything extra > > ex. pseudo code: > > 1 var temp > 2 ...onclick -> make ajax call > 3 store value returned from ajax call in temp > 4 print temp to screen > > Is this possible in cake? pseudo answer: 1. yes! It works like this 1. AJAX event triggered (by click, or whatever) 2. Cake action called 3. Cake does its database magic 4. Cake renders a "view" that contains only the data you want 5. The rendered "view" is used to update a specified Check out the AjaxHelper. -- J --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Help for a New User... Please!
I'm sure there is someone on here who can help me. I am just getting my feet wet with CakePHP, and I've hit several roadblocks. I know all of them have to do with mod_rewrite, but I don't know how to fix them. One of the big problems is that my server won't allow mod_rewrite to be accessed from .htaccess files for security reasons. I was told that the contents of the three .htaccess files need to be entered into a field on my web server admin labeled "additional apache directives." However, I can't seem to find the text of any of the .htaccess files, making it very hard to do that. I know that there are ways to run CakePHP without using mod_rewrite, but I can't seem to get that to work either. (I have un-commented the line in the core.php file, but I don't know what else needs to be done.) What I am trying to do at this point is work through the SitePoint tutorial (http://www.sitepoint.com/article/application-development-cakephp). I get the database to connect and all that fun stuff, but even when I just do the scaffolding, www.mydomain.com/notes gives me a 404 error. If anyone has any idea how I should proceed, that would be VERY helpful. Even if you can provide me with the text of the .htaccess files, that would be a start. Thank you in advance!!! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
can actions return a value without doing anything with a view
Hi, I want to make an ajax call to to a controller action that simply returns data that is retrieved from the database. I don't want the action to render a view or anything extra ex. pseudo code: 1 var temp 2 ...onclick -> make ajax call 3 store value returned from ajax call in temp 4 print temp to screen Is this possible in cake? Thank you --~--~-~--~~~---~--~~ 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: Outputting Code on a Website
Hi On Wed, 16 Aug 2006 15:19:59 -0700 "John Zimmerman [gmail]" <[EMAIL PROTECTED]> wrote: > Basically I just want to display php code within a web page. GeSHIi[0] seems to be the de-facto library for doing this. Chris [0] http://qbnz.com/highlighter/ -- Chris Lamb, Cambs, UK WWW: http://chris-lamb.co.uk Q. Why is top posting bad? GPG: 0x634F9A20 A. Because it breaks the logical sequence of discussion --~--~-~--~~~---~--~~ 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: Re: Outputting Code on a Website
gwoo beat me, I must be an old fart On 8/16/06, Samuel DeVore <[EMAIL PROTECTED]> wrote: > of course there is the cakebin http://cakephp.org/pastes which is in > cakeforge in rdos section I think. (uses Geshi which can be used as a > vendor) my guess is that there is something in that mythical project > known as the bakery... > > there are some other php only display dealios that I am sure could be > used as a vendor. my guess is that since you are talking about > display, you should be thinking helper not component ;) > HTH > > Sam D > > On 8/16/06, John Zimmerman [gmail] <[EMAIL PROTECTED]> wrote: > > Here is what I want to do. I have only done a little research, but just > > want to know if anyone has any recommendations. > > > > I want to output the contents of a php file to a webpage so that it will > > > > Display the complete unprocessed code within a box inside my layout > > I would like it to format and do syntax highlighting as well. > > Useable via a component or vendor call in Cake.Basically I just want to > > display php code within a web page. > > > > Something like php.net does with code examples would probably work. > > > > Any ideas are appreciated. > > > > -John > > > > > > > > > --~--~-~--~~~---~--~~ 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: Outputting Code on a Website
of course there is the cakebin http://cakephp.org/pastes which is in cakeforge in rdos section I think. (uses Geshi which can be used as a vendor) my guess is that there is something in that mythical project known as the bakery... there are some other php only display dealios that I am sure could be used as a vendor. my guess is that since you are talking about display, you should be thinking helper not component ;) HTH Sam D On 8/16/06, John Zimmerman [gmail] <[EMAIL PROTECTED]> wrote: > Here is what I want to do. I have only done a little research, but just > want to know if anyone has any recommendations. > > I want to output the contents of a php file to a webpage so that it will > > Display the complete unprocessed code within a box inside my layout > I would like it to format and do syntax highlighting as well. > Useable via a component or vendor call in Cake.Basically I just want to > display php code within a web page. > > Something like php.net does with code examples would probably work. > > Any ideas are appreciated. > > -John > > > > --~--~-~--~~~---~--~~ 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: Outputting Code on a Website
Check out cakebin. http://cakeforge.org/projects/rdos --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Outputting Code on a Website
Here is what I want to do. I have only done a little research, but just want to know if anyone has any recommendations.I want to output the contents of a php file to a webpage so that it willDisplay the complete unprocessed code within a box inside my layout I would like it to format and do syntax highlighting as well.Useable via a component or vendor call in Cake.Basically I just want to display php code within a web page.Something like php.net does with code examples would probably work.Any ideas are appreciated.-John --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Polymorphism in Cake Models
Does anyone know if Cake supports polymorphism? If so, is there a good place for me to read up on it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: How to associate models without tables?
You can setup a database table that is basically an index into your file system.This might be helpful if you want to store metadata about the files as well. Gallery does this for images too.So your table would have and id, name, description, location, etc, and a path field. The path field is where the file/picture is on the filesystem.Then cake can make associations using the standard id/inflection system.When deleting a picture in the model it will delete the database entry, you just add a piece of code to your model that also unlinks the file. Scalability wise this will also be a more robust solution.On 8/16/06, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:Models without tables should still be able to be associated. If I have aProduct hasMany ProductImage hasOne FileHandlerProductImage stores information about the file in the database.Filehandler handles uploading, deleting the file physically from the disk.I could setup a really cool way to delete all product files when theProduct is deleted. But , I need FileHandler to be associated toProductImage.Then I override function the delete function in ProductImage del($id, $cascade = true){ parent::del($id,$cascade); $this->FileHander->delete($whatever);}Perfect!!!However, Cake tries to do database stuff on FileHandler and it throws a bunch of errors.Cake should know that $useTable = false; means that, even withassociations.Yah, I know, file a ticket, I will. Anyone tried to do anything likethis successfully? --~--~-~--~~~---~--~~ 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: API documentation needs stylesheet change
All I did was file the ticket.I don't do any "actual work" :-)Thanks gwoo/nate.On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Wow! Fast work, gwoo and John. That is most helpful. You guys rock.Thank you.Best regards,Ralph --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Trying CakePHP for the first time and get error
I get the following warnings after I unzip cake into my htdocs Apache directory and then launch cake from my localhost. I'm using XAMPP and my Apache has started successfully. I must have some directory settings not set correct somewhere. Warning: opendir(C:\Program Files\xampp\xampp\htdocs\cake\app\models\) [function.opendir]: failed to open dir: Invalid argument in C:\Program Files\xampp\xampp\htdocs\cake\cake\basics.php on line 390 Warning: readdir(): supplied argument is not a valid Directory resource in C:\Program Files\xampp\xampp\htdocs\cake\cake\basics.php on line 392 Warning: closedir(): supplied argument is not a valid Directory resource in C:\Program Files\xampp\xampp\htdocs\cake\cake\basics.php on line 397 Thanks! Darren --~--~-~--~~~---~--~~ 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: Make AJAX call from onLoad event
My answer Javascript->event('window','load', $ajax->remoteFunction(array('update'=> 'menu', 'loading'=> "Element.hide('menu');Element.show('loading')", 'complete'=>"Element.hide('loading');Effect.Appear('menu')", 'url'=> '/pages/menu')));?> --~--~-~--~~~---~--~~ 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: Tree structures
On Aug 16, 2006, at 1:55 PM, Wilm wrote: > > Hello, > > First I'd like to thank the developers on the CakePHP project. It's a > great framework and it made things a lot easier. I got my new news > system up and running in no time and my boss was real happy with it. > The old news system was a big mess and refused to do its job any > longer. > > I'm currently working on a new project: It has a model named Task, > which has two relations: > > belongsTo => Task > hasMany => Task Can you show us the exact arrays as they stand in your Task model? -- John --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Tree structures
Hello, First I'd like to thank the developers on the CakePHP project. It's a great framework and it made things a lot easier. I got my new news system up and running in no time and my boss was real happy with it. The old news system was a big mess and refused to do its job any longer. I'm currently working on a new project: It has a model named Task, which has two relations: belongsTo => Task hasMany => Task You guessed it: It's a tree structure composed of tasks that can have many subtasks, which in turn again can have subtasks. Each tasks in turn can only have one parent task. I tried to run this, but I get an error when trying to display a list of tasks: Warning: Invalid argument supplied for foreach() When I set the DEBUG setting to two, I get a more detailed description of the problem and it seems that it is related to the SQL query: SELECT `Task`.`id`, `Task`.`task_id`, `Task`.`project_id`, `Task`.`description`, `Task`.`id`, `Task`.`task_id`, `Task`.`project_id`, `Task`.`description` , `Project`.`id`, `Project`.`name`, `Scheduleitem`.`id`, `Scheduleitem`.`project_id`, `Scheduleitem`.`task_id`, `Scheduleitem`.`deadline`, `Scheduleitem`.`hoursneeded`, `Scheduleitem`.`hoursscheduled` FROM `tasks` AS `Task` LEFT JOIN `tasks` AS `Task` ON `Task`.`task_id` = `Task`.`id` LEFT JOIN `projects` AS `Project` ON `Task`.`project_id` = `Project`.`id` LEFT JOIN `scheduleitems` AS `Scheduleitem` ON `Scheduleitem`.`task_id` = `Task`.`id` WHERE 1 = 1 This query generates the following error: 1066: Not unique table/alias: 'Task' Anyone have an idea how this can be solved? Or do I need to file this as a bug in the framework... --~--~-~--~~~---~--~~ 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: Routing question
> The other thing you could do is accept the parameters explicitly, as > in: > > function index($category = null, $page = null) { >// ... > } > > Makes handling the var switching a little easier IMO. I would still need to split the url from the params though, as I need the route for certain pages, but not for others, because I have say a news_controller, reports_controller as well, which both have their own routes jb -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: AJAX Update not working
I get safari crashing on me when I'm logging in. I'm not sure how to fix it really :) Everything else works fine, even IE! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pagination for hasMany assocation
Morning all, Obligatory apology if this has been discussed before. I've searched around and can't seem to find what I'm looking for so far. Basically, I've employed one of the pagination scripts from the wiki (thanks Gwoo) and it works perfectly when I am listing my top level models. However, when using a hasMany assocation or a HABTM assocation I'm using the general findAll scripts to return related models. So I end up with my array looking something like: Array ( [Image] => Array ( [id] => 25 [code] => 0001 [title] => this is a title [description] => this is a description dammnit [location] => [status] => SUSPENDED [modified] => 2006-08-16 11:30:37 [created] => -00-00 00:00:00 [deleted] => N ) [ImageVersion] => Array ( [0] => Array ( [id] => 30 [image_id] => 25 [width] => 467 [height] => 365 [dpi] => 100x100 pixels/inch [size] => 37 [modified] => 2006-08-16 14:08:01 [created] => 2006-08-16 14:08:01 [deleted] => N ) [1] => Array ( [id] => 29 [image_id] => 25 [width] => 500 [height] => 338 [dpi] => 96x96 pixels/inch [size] => 32 [modified] => 2006-08-16 13:52:10 [created] => 2006-08-16 13:52:10 [deleted] => N ) ) ) I would like to include pagination on this second level but I'm not sure how to go about it using the current components and models. I have an old pagination script I generally employ which grabs all records from the database into an array or object and then removes those that do not belong to the current page. A nicer way of doing things would obviously be to only grab 10 (or records per page parameter) records from the DB but I can't think at the moment how to go about it using the CakePHP findAll method. I'm thinking it may have something to do with bindModel on the fly but I haven't mastered that bit yet. Has anybody implemented something like this so far? Or has anyone ideas? Thanks guys, Mike --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to associate models without tables?
Models without tables should still be able to be associated. If I have a Product hasMany ProductImage hasOne FileHandler ProductImage stores information about the file in the database. Filehandler handles uploading, deleting the file physically from the disk. I could setup a really cool way to delete all product files when the Product is deleted. But , I need FileHandler to be associated to ProductImage. Then I override function the delete function in ProductImage del($id, $cascade = true){ parent::del($id,$cascade); $this->FileHander->delete($whatever); } Perfect!!! However, Cake tries to do database stuff on FileHandler and it throws a bunch of errors. Cake should know that $useTable = false; means that, even with associations. Yah, I know, file a ticket, I will. Anyone tried to do anything like this successfully? --~--~-~--~~~---~--~~ 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: Help Grasping HABTM...
Thanks, Chris. I'll try looking at some Ruby stuff, also. I've poured over the manual so many times, as well as doing searches on this group listing, and checked out the wiki. I'm just not seeing what I've done wrong. If anyone sees my mistake, I'm more than willing to learn from it. I just don't see what it is. At this point, I don't know if it is something I don't understand, a syntax error, etc. Thanks again for taking the time to help out a noobie... Chris Hartjes wrote: > I would definitely go over all the model associations stuff in the > Cake manual and even sneak a peek at how the Rails group handles habtm > relationships. A quick glance at your code makes me think you're very > close. :) > > On 8/16/06, j o e l <[EMAIL PROTECTED]> wrote: > > > > Hello, All. > > > > I hope you don't mind my posting another HABTM issue here. I've been > > trying to get this to work, and I'm sure I'm just missing something > > basic. I've been a little confused reading the manual, the google > > groups, etc. If you don't mind, I'll just post what I'm trying to do > > and then my dbase structure and code. > > > > I am trying to create a photo album for my personal site. I would like > > users to be able to search for specific categories. I've started out > > with 3 tables: one for photos, one for categories, and one for the > > join. I've created the models and controllers according to what I've > > seen in the manual, but it doesn't work. When I perform findAll() via > > the index view, it does not pull in the associated category (there is > > data in all tables). So, that is the issue. Now, here is the code... > > > > > > TABLES: > > > > * categories: id INT, name VARCHAR, description text, parent_id > > INT, created DATETIME, modified DATETIME > > * photos: id INT, file_name VARCHAR, description text, caption > > text, created DATETIME, modified DATETIME > > * categories_photos: category_id INT, photo_id INT > > > > > > MODELS: > > > > category.php: > > > > class Category extends AppModel > > { > > var $name = 'Category'; > > var $hasAndBelongsToMany = array('Photo' => > > array('className' => 'Photo', > > 'joinTable' => 'categories_photos', > > 'foreignKey' => 'category_id', > > 'associationForeignKey' => 'photo_id', > > 'conditions' => '', > > 'order' => '', > > 'limit' => '', > > 'unique' => '', > > 'finderSql' => '', > > 'deleteQuery' => '')); > > } > > > > > > photo.php: > > > > class Photo extends AppModel > > { > > var $name = 'Photo'; > > var $hasAndBelongsToMany = array('Category' => > > array('className' => 'Category', > > 'joinTable' => 'categories_photos', > > 'foreignKey' => 'photo_id', > > 'associationForeignKey' => 'category_id', > > 'conditions' => '', > > 'order' => '', > > 'limit' => '', > > 'unique' => '', > > 'finderSql' => '', > > 'deleteQuery' => '')); > > } > > > > > > Photo Controller: > > > > Everything works in my category views, so I will just paste a portion > > of my Photo Controller. > > > > > > class PhotosController extends AppController > > { > > var $name = 'Photos'; > > > > function index() > > { > > $this->set('data', $this->Photo->findAll()); > > } > > > > > > > > In my index view for the photo table, I have a table with the > > appropriate association which displays all of the data from the photo > > table just fine. However, nothing from the category table displays. > > I've tried defining it several different ways. Currently, I have this > > in the view... > > > > > > > > > > > > > > > > > > > > > > > > > > This gives me an error stating 'name' is an 'undefined index'. I > > obviously do not have a complete understanding of how this is supposed > > to work. Would someone mind kindly explaining this to me? > > > > > > Thanks in advance. I greatly appreciate it. > > > > > > -- j o e l > > > > > > > > > > > > -- > Chris Hartjes > > "The greatest inefficiencies come from solving problems you will never have." > -- Rasmus Lerdorf > > @TheBallpark - http://www.littlehart.net/attheballpark > @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 upload image? Please give me a example,thanks!
In a model you can do a $var =& new Filehandler; to load another module. Just don't put it in the constructor or you'll run into problems (http://groups.google.com/group/cake-php/browse_thread/thread/6d5c9a0cc142c453/8ceb79c8ed116a9e) Is there a better way to do this with the class registry stuff? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Optimizing cake projects
I'm almost through with our project and it's time to do some performance optimizations. I wanted to start a thread to report my progress and share tips/hints. Here is my plan. Setup a semi realistic test - I'm using microsoft web stress tool - it's free and I use windows to develop (fedora to stage/deploy). You can use ab or httpperf if you want to be opensource - happy scripting. Then I'll try the following. Here are my ideas: 1) Install opticode - apc, phpA, or zend optimizer 2) implement persistModel=true View Caching - I'm a little at a loss all of my pages are dependent upon as session and will serve unique content depending on the user that is logged in. (Note some groups will have the same content as other groups, but there are no dynamic pages that will be the same for everybody). This is going to limit what I can do with view caching for my application. 3) Run apd benchmark and analyze results 4) Eliminate any duplicate redundant queries on a page. Cache common queries in a session. What is the best way to do query Caching in cake? 5) Change controllers that have many requestAction(action, array('true)) to use RenderElement to avoid overehead of multiple view objects. Any other ideas, tips, tricks? --~--~-~--~~~---~--~~ 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 upload image? Please give me a example,thanks!
ah i was curious about that. i converted it in to an object and used it as a component from my controller, but it would make more sense to be able to have access to the file handling functions from my file model. so, if i convert it back to a model and put it in my /app/models/ then i can access it from any of my models yes? how do i go about doing that? thanks guys, i think there is going to be something new to be learnt everyday. Cake Rocks! On 16/08/06, JitZhang <[EMAIL PROTECTED]> wrote: > > $this->params['form']['file'] > it 's what mean? > > save($this->params['form']['data']['Product']['imgname']['tmp_name'], > > $this->params['form']['data']['Product']['imgname']['name'], > $directory="img/", $overwrite=false) ; > > is right? > > but > $this->params['form']['data']['Product']['imgname']['tmp_name'] value > is "D" > $this->params['form']['data']['Product']['imgname']['name'] value is > also "D" > > can you send mail ([EMAIL PROTECTED]) to me a case? > thanks! > > > > > --~--~-~--~~~---~--~~ 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: Deployment
I use sitecopy with a custom shell script to do an automatic update. On my todo list is to implement phing to get an ant style build and deploy http://phing.info/ --~--~-~--~~~---~--~~ 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: More than one way to skin a concatenate... (generateList)
[EMAIL PROTECTED] wrote: > Mini, > > That's a great suggestion. I'm also using sql views (not to be confused > with Cake views!) to make things easier in my project. > > Incidentally, I wonder if the use of Postgres could reduce the number > of steps in that solution by means of triggers. I suspect a calculated > field could be constructed transparently, including updates, in > Postgres. I've used postgres outside of cake and found it very pleasurable to use, particularly when it came to creating functions (I'm a pre mysql 5.x user). As for triggers, the cake steps might be reduced, but then the dbserver has to deal with the triggers. On mysql 5.x for example triggers occur on INSERT, UPDATE, and DELETE. I don't see where it can deal with calculated fields in this case (other than creating a field inside of the users table and call it full_name and have the trigger concatenate lastname and firstname each time on INSERTS and UPDATES). > I looked into Postgres for myproject, and was pleased that the > translation from Mysql to Postgres was really quite easy, and worked > fine --- but Mysql seems to have better development tools available, at > least in my limited investigation. Not sure what you mean by tools, but there are plenty out there for both I suppose. > Regards, > > Ralph Thanks for the additional information. --~--~-~--~~~---~--~~ 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: Inheritance on models
Is anyone else dong inheritance with models. Is this a good approach? --~--~-~--~~~---~--~~ 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: MySQL Dump and Restore with Cake
Hi teemow, Thanks for your reply.On 8/16/06, teemow <[EMAIL PROTECTED]> wrote: there is a script for database migrations:http://wiki.cakephp.org/tutorials:cake_migrations I had a look at this before but didn't want to get into it yet until I have do my first release. Then I might use it for migrations. I never thought of it for testing though. it would be better to usea mock object instead. hmmm... I've been having some discussions about this topic on some other forums and I think it'd be more suitable to mock the Model from the controller, but when testing the Models themselves I should test against a real database.. I think. I've started using exec() to read in the dumpfile and using "mysql -u[username] -p[password] [database_name] < [filename.sql]" What do you think of this? Cheers, Sonic --~--~-~--~~~---~--~~ 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: Routing question
The other thing you could do is accept the parameters explicitly, as in: function index($category = null, $page = null) { // ... } Makes handling the var switching a little easier IMO. --~--~-~--~~~---~--~~ 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: Routing question
> ahh, got ya, haev found a workaround, which seems to work fine, what > do you think? > > function index () > { > (!empty($args[0])) ? $category = $args[0]: $category = null; > (!empty($args[1])) ? $handle = $args[1]: $handle = null; > (!empty($args[2])) ? $subHandle = $args[2]: $subHandle = null; > } > woops, forgot how to show how was I getting $args $args = explode ('/', $this->params['url']['url']); hehe jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: AJAX Update not working
Thanks for the update Josh, that's actually really helpful. I had heard a few reports of things crashing (actually, the week after I wrote the Ajax div stuff, Apple released a new version of Safari that crashed on it occasionally :-/). Glad you sorted it out. --~--~-~--~~~---~--~~ 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: Routing question
> This route, on the other hand: > $Route->connect ('/who_we_are/*', array('controller' => 'pages', > 'action' => 'index', 'who_we_are')); > still matches /who_we_are/, but it also matches anything after it. The > problem is, the two routes are effectively the same. All you're doing > by passing 'who_we_are' as the default value is telling the router to > pass that as the default value if no other value is specified. > Unfortunately, you can't do both-and. ahh, got ya, haev found a workaround, which seems to work fine, what do you think? function index () { (!empty($args[0])) ? $category = $args[0]: $category = null; (!empty($args[1])) ? $handle = $args[1]: $handle = null; (!empty($args[2])) ? $subHandle = $args[2]: $subHandle = null; } I can then use the route below which works fine: $Route->connect ('/who_we_are/*', array('controller' => 'pages', 'action' => 'index','who_we_are')); hopefully should be easy to rework when 1.2 is out. thanks, jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: AJAX Update not working
I figured out all the problems. Being new to this whole Prototype thing, I had downloaded the "latest version" of Prototype from the Prototype website (version 1.4), then downloaded Scriptaculous. I just noticed that the Scriptaculous download contains the *actual* latest version of the Prototype library (1.5), and after uploading that file, everything works great in Firefox. For IE - that ended up being a problem with my Norton Internet Security Popup Blocker. If I disable that (or add the site I'm working on to the white list), everything works perfect in IE 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: Cannot use Model only for Validation (no table behind) $useTable = false;
var $useTable = null; On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > HI everybody, > > I want to use a model only for my validation logic! So i set my model > up with $useTable = false, but then cake generates a "startup" query on > my database. How can i fix that problem? > > My CakeVersion is CakePHP 1.1.7.3363 > > The SQL Log says: > 3 startup 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 'startup' at line 10 > > greets alex > > > > > --~--~-~--~~~---~--~~ 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: Help Grasping HABTM...
I would definitely go over all the model associations stuff in the Cake manual and even sneak a peek at how the Rails group handles habtm relationships. A quick glance at your code makes me think you're very close. :) On 8/16/06, j o e l <[EMAIL PROTECTED]> wrote: > > Hello, All. > > I hope you don't mind my posting another HABTM issue here. I've been > trying to get this to work, and I'm sure I'm just missing something > basic. I've been a little confused reading the manual, the google > groups, etc. If you don't mind, I'll just post what I'm trying to do > and then my dbase structure and code. > > I am trying to create a photo album for my personal site. I would like > users to be able to search for specific categories. I've started out > with 3 tables: one for photos, one for categories, and one for the > join. I've created the models and controllers according to what I've > seen in the manual, but it doesn't work. When I perform findAll() via > the index view, it does not pull in the associated category (there is > data in all tables). So, that is the issue. Now, here is the code... > > > TABLES: > > * categories: id INT, name VARCHAR, description text, parent_id > INT, created DATETIME, modified DATETIME > * photos: id INT, file_name VARCHAR, description text, caption > text, created DATETIME, modified DATETIME > * categories_photos: category_id INT, photo_id INT > > > MODELS: > > category.php: > > class Category extends AppModel > { > var $name = 'Category'; > var $hasAndBelongsToMany = array('Photo' => > array('className' => 'Photo', > 'joinTable' => 'categories_photos', > 'foreignKey' => 'category_id', > 'associationForeignKey' => 'photo_id', > 'conditions' => '', > 'order' => '', > 'limit' => '', > 'unique' => '', > 'finderSql' => '', > 'deleteQuery' => '')); > } > > > photo.php: > > class Photo extends AppModel > { > var $name = 'Photo'; > var $hasAndBelongsToMany = array('Category' => > array('className' => 'Category', > 'joinTable' => 'categories_photos', > 'foreignKey' => 'photo_id', > 'associationForeignKey' => 'category_id', > 'conditions' => '', > 'order' => '', > 'limit' => '', > 'unique' => '', > 'finderSql' => '', > 'deleteQuery' => '')); > } > > > Photo Controller: > > Everything works in my category views, so I will just paste a portion > of my Photo Controller. > > > class PhotosController extends AppController > { > var $name = 'Photos'; > > function index() > { > $this->set('data', $this->Photo->findAll()); > } > > > > In my index view for the photo table, I have a table with the > appropriate association which displays all of the data from the photo > table just fine. However, nothing from the category table displays. > I've tried defining it several different ways. Currently, I have this > in the view... > > > > > > > > > > > > > This gives me an error stating 'name' is an 'undefined index'. I > obviously do not have a complete understanding of how this is supposed > to work. Would someone mind kindly explaining this to me? > > > Thanks in advance. I greatly appreciate it. > > > -- j o e l > > > > > -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Notice: Only variable references .. in adodb-mysql.inc.php on line 75
I have CakePHP in production and having some problem 1. It is shared hosting and no access to httpd.conf Access to only /home/myusername /home/myusername/public_html 2. Setup /home/myusername/app /home/myusername/cake /home/myusername/vendors (<- has adodb) /home/myusername/public_ html(<- has the content of webroot) Error: It is not connecting to Mysql = Notice: Only variable references should be returned by reference in /home/myusername/vendors/adodb/drivers/adodb-mysql.inc.php on line 75 database.php = class DATABASE_CONFIG { var $default = array('driver' => 'adodb', 'connect' => 'mysql', 'host' => 'localhost', 'login' => 'fhawk', 'password' => 'KRcy599', 'database' => 'pr_phpfeedhawk'); } index.php === if (!defined('ROOT')) { define('ROOT', DS.'home'.DS.'myusername'); } if (!defined('APP_DIR')) { define('APP_DIR', 'app'); } if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', ROOT); } Have also tried putting the following lines at the top in index.php define('BASE_DIR', '/home/deepakpr/'); define('ROOT', BASE_DIR.'cake'); define ('APP_DIR', 'app'); define ('WEBROOT_DIR', 'public_html'); My problem could be else where, I am not able to google for the notice of adodb. If anyone ran into this problem, will you please share. Thanks Notice: Only variable references .. in adodb-mysql.inc.php on line 75 --~--~-~--~~~---~--~~ 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: Routing question
The who_we_are part vanishes from the URL because you specified it as a static element within your route. This route: $Route->connect ('/who_we_are/', array('controller' => 'pages', 'action' => 'index','who_we_are')); matches your first URL (/who_we_are/) because you have who_we_are and nothing after it. The only reason 'who_we_are' shows up in the parameters is because you're passing it manually in the route. This route, on the other hand: $Route->connect ('/who_we_are/*', array('controller' => 'pages', 'action' => 'index', 'who_we_are')); still matches /who_we_are/, but it also matches anything after it. The problem is, the two routes are effectively the same. All you're doing by passing 'who_we_are' as the default value is telling the router to pass that as the default value if no other value is specified. Unfortunately, you can't do both-and. Hope that makes sense. The light at the end of the tunnel is that I'm working on the Router for Cake 1.2 this week, and the new enhancements will let you specify more sophisticated matching rules. --~--~-~--~~~---~--~~ 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 operate relational database in cakephp
Um, I think this is a question that goes beyond CakePHP. This is basic "how to create a page that has a form that you can submit". In this case, I'd build the page just like it was another PHP page and use the built-in HTML and form helpers to point the form submit to your controller/action combo. On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > hi,guys: > I am new in Cake. so can any one please tell me how to solve the > issue below: > There are two tables : Clients and Sites,one client has many > sites(client_id is the foreign key in table Site).Now I want to create > a thtml page in which users can add Client's information PLUS > site_name(which is from table Site). > In this case , what should I do? > > Thank you for your support > > > > > -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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: Routing question
The who_we_are part vanishes from the URL because you specified it as a static element within your route. This route: $Route->connect ('/who_we_are/', array('controller' => 'pages', 'action' => 'index','who_we_are')); matches your first URL (/who_we_are/) because you have who_we_are and nothing after it. The only reason 'who_we_are' shows up in the parameters is because you're passing it manually in the route. This route, on the other hand: $Route->connect ('/who_we_are/*', array('controller' => 'pages', 'action' => 'index', 'who_we_are')); still matches /who_we_are/, but it also matches anything after it. The problem is, the two routes are effectively the same. All you're doing by passing 'who_we_are' as the default value is telling the router to pass that as the default value if no other value is specified. Unfortunately, you can't do both-and. Hope that makes sense. The light at the end of the tunnel is that I'm working on the Router for Cake 1.2 this week, and the new enhancements will let you specify more sophisticated matching rules. --~--~-~--~~~---~--~~ 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: $html->checkbox() and database field enum('true','false')
As i understand how the forms and the $_POST/$_GET variables work:If it's a checkbox and it's not checked, it doesnt show up in the $_POST/$_GET (could be wrong, didnt test)You may want to consider either checking if it exists and if it doesnt, then set the value, or you could use a radio button group. Hope this helps.On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:I have a database table with a field of type enum('true','false') to represent boolean data. I'd like to use HtmlHelper's checkbox functionto edit values for this field. This seems to work fine if the userchecks the checkbox, but leaves the db field blank if the user doesn'tcheck the checkbox: $html->checkbox('Content/nav', null, array('value'=>'true','checked'=>'checked')I understand that the 'value' attribute is used as the field's value ifthe checkbox is checked. Is there a way to set the value Cake will use if the checkbox is *not* checked?Would I be better off using some other type for this boolean field inthe database, so $html->checkbox() will just work without any weirdhacks on my part? [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: API documentation needs stylesheet change
Much better now ! Thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$html->checkbox() and database field enum('true','false')
I have a database table with a field of type enum('true','false') to represent boolean data. I'd like to use HtmlHelper's checkbox function to edit values for this field. This seems to work fine if the user checks the checkbox, but leaves the db field blank if the user doesn't check the checkbox: $html->checkbox('Content/nav', null, array('value'=>'true', 'checked'=>'checked') I understand that the 'value' attribute is used as the field's value if the checkbox is checked. Is there a way to set the value Cake will use if the checkbox is *not* checked? Would I be better off using some other type for this boolean field in the database, so $html->checkbox() will just work without any weird hacks on my part? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Need dynamic database config
I need a dynamic db config. I have to pick the name of the database i want to connect from my session data. In The irc channel someone told my that i have to put this in an before filter method: var $beforeFilter = array ('_selectDatabase'); and in my method: function _selectDatabase () { if (APP_TYPE == 'online') { $db =& ConnectionManager::getDataSource('default'); $db->disconnect(); $db->config['database'] = $_SESSION['datenbank']; //print_r($db->config); $db->connect(); } } but it did not work. it semms that i cannot connect to my db! The print_r($db->config); prints the correct credentials out. What i am doing wrong? greets and many thanks alex --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cannot use Model only for Validation (no table behind) $useTable = false;
HI everybody, I want to use a model only for my validation logic! So i set my model up with $useTable = false, but then cake generates a "startup" query on my database. How can i fix that problem? My CakeVersion is CakePHP 1.1.7.3363 The SQL Log says: 3 startup 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 'startup' at line 10 greets alex --~--~-~--~~~---~--~~ 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: Dynamic Navigation Menu
Second part of my question = 'There is an extra problem, each link in every menu requires arguments (like /user/view/32)'. Our site is going to allow registered users to build profiles. These profiles will be muilt-paged. We are using a navigation menu to take people to different pages inside of the profile. So each link must maintain the user id of the user who owns the profile in view. Currently, we have a massive switch stmt that takes a string condition (the name of the menu). The switch is inside of a component function function getNavigationMenuItems($strMenuName, $strParams) { switch ($strMenuName) { . . . case('View User Profile') { return array('link 1 title' => "url 1/$strParams", 'link 2 title' => "url 2/$strParams",...); } } } The controller passes the returned array to the layout. I refuse to believe that this is the best way to do this. I am currently creating a similar solution that will use DB backend. However, this solution still seems too heavy wieght just for a nav menu. BONUS -- I am also looking for a way to make the navigation menu smart so that it is aware of the content that its links are pointing at. So lets say that a user hasn't filled in a page of his/her profile. The nav link to this page should be displayed differently than the rest of the links. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Routing question
Hi, I have a few controllers, Pages (custom),News,Reports etc and on the front end I'd like to loose the method names from my URLs, eg: www.mydomain.com/news/category/category_name becomes www.mydomain.com/news/category_name and www.mydomain.com/news/article/article_name becomes www.mydomain.com/news/category_name/article_name I have this working fine for some controllers using the following route: $Route->connect ('/news/*', array('controller' => 'news', 'action' => 'index')); Where I'm coming unstuck is with my Pages controller. Each page belongs to a category, and I'm using a url friendly version of the categories name, followed by the same for the artlicles name within my index function. This works fine if I use a route like so: $Route->connect ('/pages/*', array('controller' => 'news', 'action' => 'index')); with that I can do: www.mydomain.com/pages/category_name/page_name what I'm trying to do is loose the 'pages' part of the url, because the category title signifies the seciton of the site (much in the same way that 'news' or 'reports' does), and I like to keep things uniformed. I've since tried doing: $Route->connect ('/who_we_are/', array('controller' => 'pages', 'action' => 'index','who_we_are')); $Route->connect ('/who_we_are/*', array('controller' => 'pages', 'action' => 'index','who_we_are')); but this only gives me one of the arguments from the URL, not both, eg if I debug(func_get_args($this)) at the top of my index() method: www.mydomain.com/who_we_are gives me: [0] => who_we_are and www.mydomain.com/who_we_are/company_history gives me: [0] => company_history as you can see, 'who_we_are' has vanished from the url! I'm not sure if what I'm attempting is possible or not, but I sure hope it is! many thanks, Jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: API documentation needs stylesheet change
Wow! Fast work, gwoo and John. That is most helpful. You guys rock. Thank you. Best regards, Ralph --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to operate relational database in cakephp
hi,guys: I am new in Cake. so can any one please tell me how to solve the issue below: There are two tables : Clients and Sites,one client has many sites(client_id is the foreign key in table Site).Now I want to create a thtml page in which users can add Client's information PLUS site_name(which is from table Site). In this case , what should I do? Thank you for your support --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Create Hyperlinked Images within a Auto Cascading Table PHP
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables they show images i need these images to hyperlink to other HTML pages... Note these tables are written within the area of the full Script so the basic HTML - written inside the auto table script does not work as it is HTML with PHP i need the same process to work within the generated PHP Table Easy - A - Store image (Locations) in Mysql Easy - B - Display images in Automatic Table produced by number of records in PHP Help - C - Make these same images within the Auto Table Hyperlink to other HTML pages (Note the reason this is a Auto table is simply the fact the PHP requests the number of records then with this it creates the table of fields, i need the images in those fields to hyperlink the basic within PHP does not work as the table is autogenerated all the contents need to be in the PHP Area ) Example contents Hyperlink Images ?> Echo Table Contents Pls help if you can thanks in advanced --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Create Hyperlinked Images within a Auto Cascading Table PHP
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables they show images i need these images to hyperlink to other HTML pages... Note these tables are written within the area of the full Script so the basic HTML - written inside the auto table script does not work as it is HTML with PHP i need the same process to work within the generated PHP Table Easy - A - Store image (Locations) in Mysql Easy - B - Display images in Automatic Table produced by number of records in PHP Help - C - Make these same images within the Auto Table Hyperlink to other HTML pages (Note the reason this is a Auto table is simply the fact the PHP requests the number of records then with this it creates the table of fields, i need the images in those fields to hyperlink the basic within PHP does not work as the table is autogenerated all the contents need to be in the PHP Area ) Example contents Hyperlink Images ?> Echo Table Contents Pls help if you can thanks in advanced --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Create Hyperlinked Images within a Auto Cascading Table PHP
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables they show images i need these images to hyperlink to other HTML pages... Note these tables are written within the area of the full Script so the basic HTML - written inside the auto table script does not work as it is HTML with PHP i need the same process to work within the generated PHP Table Easy - A - Store image (Locations) in Mysql Easy - B - Display images in Automatic Table produced by number of records in PHP Help - C - Make these same images within the Auto Table Hyperlink to other HTML pages (Note the reason this is a Auto table is simply the fact the PHP requests the number of records then with this it creates the table of fields, i need the images in those fields to hyperlink the basic within PHP does not work as the table is autogenerated all the contents need to be in the PHP Area ) Example contents Hyperlink Images ?> Echo Table Contents Pls help if you can thanks in advanced --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Create Hyperlinked Images within a Auto Cascading Table PHP
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables they show images i need these images to hyperlink to other HTML pages... Note these tables are written within the area of the full Script so the basic HTML - written inside the auto table script does not work as it is HTML with PHP i need the same process to work within the generated PHP Table Easy - A - Store image (Locations) in Mysql Easy - B - Display images in Automatic Table produced by number of records in PHP Help - C - Make these same images within the Auto Table Hyperlink to other HTML pages (Note the reason this is a Auto table is simply the fact the PHP requests the number of records then with this it creates the table of fields, i need the images in those fields to hyperlink the basic within PHP does not work as the table is autogenerated all the contents need to be in the PHP Area ) Example contents Hyperlink Images ?> Echo Table Contents Pls help if you can thanks in advanced --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Help in Associations
Hello Everyone, I am trying to create an application where I have currently 2 tables - a) users (id/username/password/email/name/created/modified) b) profiles (lots of blah) The association would be user hasOne profile and profile belongTo user. Now, when I am signing the user up, my signup process is spread across 2-3 pages. The fields are not such that step 1 has everything corresponding to users table and step2&3 have everything corresponding to profies table. I want to be able to take user input in any manner (not tied in with the order of fields in the db) but in the end once the user finishes the registration, all data needs to go to the correct place. So, I could keep track of all data in the session, finally do an array merge and then what should I do? If I call the save through any one controller will data go into both the tables properly because of associations? What approach should I be taking here? Could someone please help me out. Thank you, Mandy. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Help Grasping HABTM...
Hello, All. I hope you don't mind my posting another HABTM issue here. I've been trying to get this to work, and I'm sure I'm just missing something basic. I've been a little confused reading the manual, the google groups, etc. If you don't mind, I'll just post what I'm trying to do and then my dbase structure and code. I am trying to create a photo album for my personal site. I would like users to be able to search for specific categories. I've started out with 3 tables: one for photos, one for categories, and one for the join. I've created the models and controllers according to what I've seen in the manual, but it doesn't work. When I perform findAll() via the index view, it does not pull in the associated category (there is data in all tables). So, that is the issue. Now, here is the code... TABLES: * categories: id INT, name VARCHAR, description text, parent_id INT, created DATETIME, modified DATETIME * photos: id INT, file_name VARCHAR, description text, caption text, created DATETIME, modified DATETIME * categories_photos: category_id INT, photo_id INT MODELS: category.php: class Category extends AppModel { var $name = 'Category'; var $hasAndBelongsToMany = array('Photo' => array('className' => 'Photo', 'joinTable' => 'categories_photos', 'foreignKey' => 'category_id', 'associationForeignKey' => 'photo_id', 'conditions' => '', 'order' => '', 'limit' => '', 'unique' => '', 'finderSql' => '', 'deleteQuery' => '')); } photo.php: class Photo extends AppModel { var $name = 'Photo'; var $hasAndBelongsToMany = array('Category' => array('className' => 'Category', 'joinTable' => 'categories_photos', 'foreignKey' => 'photo_id', 'associationForeignKey' => 'category_id', 'conditions' => '', 'order' => '', 'limit' => '', 'unique' => '', 'finderSql' => '', 'deleteQuery' => '')); } Photo Controller: Everything works in my category views, so I will just paste a portion of my Photo Controller. class PhotosController extends AppController { var $name = 'Photos'; function index() { $this->set('data', $this->Photo->findAll()); } In my index view for the photo table, I have a table with the appropriate association which displays all of the data from the photo table just fine. However, nothing from the category table displays. I've tried defining it several different ways. Currently, I have this in the view... This gives me an error stating 'name' is an 'undefined index'. I obviously do not have a complete understanding of how this is supposed to work. Would someone mind kindly explaining this to me? Thanks in advance. I greatly appreciate it. -- j o e l --~--~-~--~~~---~--~~ 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: Re[2]: How add condition for associated model in findAll()
> In different situations in my application I need use different > conditions in model assocciations and every time i must use bindModel > or there is another way how to do it ? you could create multiple associations in your models (you can link the 2 same models using different names as many times as you wish), and then turn off the ones you don't need using unbindModel(); ? could make your code a bit easier to manage... hth jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: MySQL Dump and Restore with Cake
there is a script for database migrations: http://wiki.cakephp.org/tutorials:cake_migrations i started adding some command line options to run the migrations automatically in a deploy script and to migrate test and default database. so you can theoretically do the same thing in your tests. but i think if you use this in your setup/teardown (migrate up/down) methods it will slow down your tests totally. it would be better to use a mock object instead. --~--~-~--~~~---~--~~ 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[2]: How add condition for associated model in findAll()
Nazdar, 15. 8. 2006, Samuel DeVore napisal: > some examples can be found at > http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/ > Sam D Thanks, it works: $this->WaypointType->bindModel(array('hasMany' => array('Waypoint' =>array('foreignKey' => 'waypoint_type_id', 'conditions' => 'Waypoint.is_valid = \'yes\''; but it is "clean" way or it is "dirty hack" ? In different situations in my application I need use different conditions in model assocciations and every time i must use bindModel or there is another way how to do it ? -- pointer --~--~-~--~~~---~--~~ 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 upload image? Please give me a example,thanks!
$this->params['form']['file'] it 's what mean? save($this->params['form']['data']['Product']['imgname']['tmp_name'], $this->params['form']['data']['Product']['imgname']['name'], $directory="img/", $overwrite=false) ; is right? but $this->params['form']['data']['Product']['imgname']['tmp_name'] value is "D" $this->params['form']['data']['Product']['imgname']['name'] value is also "D" can you send mail ([EMAIL PROTECTED]) to me a case? thanks! --~--~-~--~~~---~--~~ 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 upload image? Please give me a example,thanks!
After you make the changes you can post back with code and/or errors if you are still having problems.If you paste your code into a bin at http://cakephp.org/pastes/add we can look at your code easier and apply changes.Just post back with your problem and a link to your bin.On 8/15/06, georgeL < [EMAIL PROTECTED]> wrote:you need to use the filehandler as a model and not inside your controller. just copy the snippet into your model folder.when setup as a model you can use it like mentioned in the snippet andaccess it from your product 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 -~--~~~~--~~--~--~---