Re: How to config cakephp, session seems very strange.
i fix it by myself --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Reusable code, components and controllers.
great, gonna use this one! for some kinda reason, i didn't take into consideration that you can use var $components = array( 'Session' ); in a component.. sigh! :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A gift for all to enjoy
Great guys! I'm really excited about the new 1.2 features (especially the multi-language!)! Gonna start playing with it right away! Tnxs! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Table associations the CakePHP way
I have a controller, and I want to fetch information from tables. With scaffold, it works wonderfully.. However I wanna load the information smartly for my app. These are my tables: section: id name field1 field2 layout_id category_id category: id name field3 field4 field5 field6 layout: id name field7 field8 I want to put the information from the section table in the view. the category_id and layout_id should have category.name and layout.name instead of the id of the category. I could build a MySQL query for this, but I wonder what's the CakePHP way. (The more ways, the marrier it is ;)) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP goes crazy when zend.ze1_compatibility_mode is On
Well, when I set: zend.ze1_compatibility_mode = Off everything works fine. My relations were set like this: var hasMany = 'TestOne,TestTwo' then I changed it to var hasMany = array('TestOne','TestTwo') but the problem remained. I didn't know I have to set a className property for each of these relations --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A gift for all to enjoy
Thanks to cakePHP team for making my life easier!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Table associations the CakePHP way
First you'll have to create correct associations for your Models (if you don't know how or too lazy to read the manual, ask again). Second, try dumping the whole thing you got from the Model-findAll or findBy... using debug($[modelname]-[functionname]); You'll see that accessing category.name and layout.name is just an array away from the main result. Still having problem? Print out to us the result of the steps above... On 12/26/06, phpjoy [EMAIL PROTECTED] wrote: I have a controller, and I want to fetch information from tables. With scaffold, it works wonderfully.. However I wanna load the information smartly for my app. These are my tables: section: id name field1 field2 layout_id category_id category: id name field3 field4 field5 field6 layout: id name field7 field8 I want to put the information from the section table in the view. the category_id and layout_id should have category.name and layout.name instead of the id of the category. I could build a MySQL query for this, but I wonder what's the CakePHP way. (The more ways, the marrier it is ;)) -- Adrian Godong [EMAIL PROTECTED] Microsoft Student Ambassador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Vocabulary question : What's the name of a MVC object
Hi We know what a Model is, or a Controller, or a View. For the three together however, I'm not sure. I'm saying Object or MVC Object but its quite vague and not really correct. What do you use fore that ? olivvv --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Keeping unbindModel out of your controllers
Sure, no problem. I'll wait for your feedback. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Mikee Freedom Enviado el: Martes, 26 de Diciembre de 2006 03:31 a.m. Para: cake-php@googlegroups.com Asunto: Re: Keeping unbindModel out of your controllers Apologies for not getting on to this sooner - chrissy and all! Will get stuck in to it later today or tomorrow and let you know. Thanks for taking the time out to really help me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Vocabulary question : What's the name of a MVC object
I think he's referring to how to generally name an MVC View, an MVC Model or an MVC Controller, using just one term. I would say call it an MVC Element. Such as: One of the first things you'll need to learn before proceeding is how each MVC Element plays a different role on the system... -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Adrian Godong Enviado el: Martes, 26 de Diciembre de 2006 11:07 a.m. Para: cake-php@googlegroups.com Asunto: Re: Vocabulary question : What's the name of a MVC object It's called pattern. MVC is a software pattern. On 12/26/06, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: We know what a Model is, or a Controller, or a View. For the three together however, I'm not sure. I'm saying Object or MVC Object but its quite vague and not really correct. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Update on translations.
Where I can download Spanish Translation? Cheers 2006/12/25, Shunro Dozono [EMAIL PROTECTED]: Hello, translators: FYI: If you are using FireFox, you can view other translations of translation.cakephp.org. For example (Windows platform), download 1) Locale-Switcher Extension for Firefox and Thunderbird http://benjamin.smedbergs.us/switch-locales/ (All you have to do is just click the files and accept it.) 2) Language Packs http://releases.mozilla.org/pub/mozilla.org/firefox/releases/2.0/win32/xpi/ Then, after choosing a language, restart FireFox. And visit http://translation.cakephp.org You can see other languages! Shunro Dozono http://www.cba-japan.com -- Salu2 ReynierPM | 5to. Ing Informática --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Vocabulary question : What's the name of a MVC object
Thanks a lot Mariano that sounds good :-) Mariano Iglesias wrote: I think he's referring to how to generally name an MVC View, an MVC Model or an MVC Controller, using just one term. I would say call it an MVC Element. Such as: One of the first things you'll need to learn before proceeding is how each MVC Element plays a different role on the system... -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Adrian Godong Enviado el: Martes, 26 de Diciembre de 2006 11:07 a.m. Para: cake-php@googlegroups.com Asunto: Re: Vocabulary question : What's the name of a MVC object It's called pattern. MVC is a software pattern. On 12/26/06, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: We know what a Model is, or a Controller, or a View. For the three together however, I'm not sure. I'm saying Object or MVC Object but its quite vague and not really correct. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Table associations the CakePHP way
hey adrian, the table names are right, and work great with scuffold. it works without scuffold too, i just want to make it more efficient. on some of the models i used hasmany, belongsto, and hasone. i get the table category and layout dumped, the problem is that i get all of the information from the fields = and not just category.name, or layout.name. there are a few ways to handle this. there are two ways I know: 1) do a mysql query 2) ask for specific fields in the hasone/belongsto/hasmany, .. i just wanna hear what else you guys are doing.. the cakephp way. :) yossi Adrian Godong wrote: First you'll have to create correct associations for your Models (if you don't know how or too lazy to read the manual, ask again). Second, try dumping the whole thing you got from the Model-findAll or findBy... using debug($[modelname]-[functionname]); You'll see that accessing category.name and layout.name is just an array away from the main result. Still having problem? Print out to us the result of the steps above... On 12/26/06, phpjoy [EMAIL PROTECTED] wrote: I have a controller, and I want to fetch information from tables. With scaffold, it works wonderfully.. However I wanna load the information smartly for my app. These are my tables: section: id name field1 field2 layout_id category_id category: id name field3 field4 field5 field6 layout: id name field7 field8 I want to put the information from the section table in the view. the category_id and layout_id should have category.name and layout.name instead of the id of the category. I could build a MySQL query for this, but I wonder what's the CakePHP way. (The more ways, the marrier it is ;)) -- Adrian Godong [EMAIL PROTECTED] Microsoft Student Ambassador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: Update on translations.
Current translations are listed here: http://translation.cakephp.org/languages They all come bundled with CakePHP 1.2, which you can download here: http://cakeforge.org/frs/?group_id=23release_id=171 After downloading you can see bundled language packs at: cake/locale The Spanish pack is at: cake/locale/spa/LC_MESSAGES -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de ReynierPM Enviado el: Martes, 26 de Diciembre de 2006 11:56 a.m. Para: cake-php@googlegroups.com Asunto: Re: Update on translations. Where I can download Spanish Translation? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Table associations the CakePHP way
you can ask for just the specific fields but if the other fields aren't too heavy (in terms of bytes of returned content) I don't think there is a reason to do so. I would avoid using a custom query unless you absolutely need it. You are able to specify the fields you want returned without using a custom query. On Dec 26, 10:32 am, phpjoy [EMAIL PROTECTED] wrote: hey adrian, the table names are right, and work great with scuffold. it works without scuffold too, i just want to make it more efficient. on some of the models i used hasmany, belongsto, and hasone. i get the table category and layout dumped, the problem is that i get all of the information from the fields = and not just category.name, or layout.name. there are a few ways to handle this. there are two ways I know: 1) do a mysql query 2) ask for specific fields in the hasone/belongsto/hasmany, .. i just wanna hear what else you guys are doing.. the cakephp way. :) yossi Adrian Godong wrote: First you'll have to create correct associations for your Models (if you don't know how or too lazy to read the manual, ask again). Second, try dumping the whole thing you got from the Model-findAll or findBy... using debug($[modelname]-[functionname]); You'll see that accessing category.name and layout.name is just an array away from the main result. Still having problem? Print out to us the result of the steps above... On 12/26/06, phpjoy [EMAIL PROTECTED] wrote: I have a controller, and I want to fetch information from tables. With scaffold, it works wonderfully.. However I wanna load the information smartly for my app. These are my tables: section: id name field1 field2 layout_id category_id category: id name field3 field4 field5 field6 layout: id name field7 field8 I want to put the information from the section table in the view. the category_id and layout_id should have category.name and layout.name instead of the id of the category. I could build a MySQL query for this, but I wonder what's the CakePHP way. (The more ways, the marrier it is ;)) -- Adrian Godong [EMAIL PROTECTED] Microsoft Student Ambassador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Vocabulary question : What's the name of a MVC object
I like to call them tiers. The Model tier handles data, Controller tier handles business logic, and the View tier displays the data to the user. Refer to the Cake logo, it has three tiers. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Opinion: Best way to create data entry form
First I will describe my model and then present the way I see to create the data entry. I'm looking for a user friendly solution. I'm building an application for a record store so they can send out a weekly newsletter. The newsletter can have a blog entry and multiple record albums. Each record album can have multiple songs. So i was thinking of doing a wizard style data entry... 1- Create news letter with blog 2- Create album 3- Create and attach song to album 4- Cycle back to 2 5- Finish One thing was mentioned that there will never be more then 4-5 song per album so the I though to myself the album and song form can be one, where at the top you enter the album info and under you have 4-5 slots for the tracks! But I figure now I have to manually iterate through the form data to split everything up. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Vocabulary question : What's the name of a MVC object
And those three tiers are a MVC element, that's right ? gwoo wrote: I like to call them tiers. The Model tier handles data, Controller tier handles business logic, and the View tier displays the data to the user. Refer to the Cake logo, it has three tiers. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Vocabulary question : What's the name of a MVC object
Together, the three tiers form the MVC pattern. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: othAuth not reading cookie value
I'm also wondering about this problem; I want every user to be able to access his own profile, but not that of other users. I'm guessing there's a better way to accomplish this than to add a group and permission for every single user? [EMAIL PROTECTED] schreef: Logging in works perfectly. A cookie is stored which is valid until 2009, but when I reload the page a couple of hours later, I'm not logged in anymore... I modified the OthAuth settings like this: var $cookie_active= true; var $cookie_lifetime = '+999 day'; The cookie is still on my PC, it looks like it's just not being read for some reason. This is some of my app_controller.php code: function beforeFilter() { $auth_conf = array( 'mode' = 'oth', 'login_page' = '/users/login', 'logout_page' = '/users/logout', 'access_page' = '/cpanel/index', 'noaccess_page' = '/users/noaccess', 'strict_gid_check' = false ); $this-othAuth-controller = $this; $this-othAuth-init($auth_conf); $this-othAuth-check(); if (!isset($this-User)) { $this-User = new User(); } $email = $this-othAuth-user('email'); if (!empty($email)) // Only if the user is logged in { $user = $this-User-findByEmail($email); $this-set('userInfo',$user); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: othAuth not reading cookie value
Nevermind that second question, I solved it with a few lines of code in the beforeFilter(). I'm still having problems with the cookie not being read 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?hl=en -~--~~~~--~~--~--~---
Re: how would you scale a cake app?
Dr. Tarique Sani wrote: Not to sound like a prick but 400,000 page views are not much for a typical 3+1 configuration. Given your estimate of higher performance you say you will reach about 1.2 million page views on the same setup which again makes me want to know your hardware configuration. Firstly, I don't claim to be a hardware guru, and my estimations are purely based on brief conversations with the techs who run the servers. So with that in mind... all the machines are dual xeon 2.8GHz with 2Gb of memory. But like I said, the machines have not flinched even at peak traffic so far (I've rarely seen them above 0.1), whether we could handle 1.2mil or 10mil page views a day on the current hardware was just speculation on my end. The decision to use 3+1 straight off the bat was mainly due to the need for handling rapid expansion -- the site only launched 2 weeks ago. Add to the mix the need for video transcoding and an element of the unknown in this respect meant it was easier to start with more than less. To put things from my perspective - we have conventional php application which manages 12 to 15 million page views on a 4+2 cluster. Yes the hardware on this is awesome! Sounds like a nice setup you have there :) Regards. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how would you scale a cake app?
Hi bgmill The decision to use 3+1 straight off the bat was mainly due to the need for handling rapid expansion Thanks for that info, much appreciated. One more question though, when you say 3+1 do you mean a cluster of 3 database servers and one web server? Regards, Langdon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Reverse recursive findAllThreaded queries?
I have a situation where I know the id of a child, but I need the parental hierarchy. Using the structure in this (excellent) Bakery example, I have the following: 1. Art 1. Film 2. Music 1. Jazz 2. Pop 2. History 1. Archaeology 2. War 3. Science 1. Biology 2. Chemistry 3. Physics 4. Technology 1. Computing 1. Hardware 2. Software 2. Engineering In my situation, I know of Hardware, but I need to know the following: 4. Technology 1. Computing 1. Hardware Or if I know of Physics, I need to know: 3. Science 3. Physics Does anyone know how to accomplish this in a Cake-ish way (without hacking a bunch of queries together in my controller)? 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?hl=en -~--~~~~--~~--~--~---
Re: Reverse recursive findAllThreaded queries?
Are all of the items in your hierarchy one type of data? In other words, are they all in one table with an association of has and belongs to many? Ben On Dec 26, 7:32 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a situation where I know the id of a child, but I need the parental hierarchy. Using the structure in this (excellent) Bakery example, I have the following: 1. Art 1. Film 2. Music 1. Jazz 2. Pop 2. History 1. Archaeology 2. War 3. Science 1. Biology 2. Chemistry 3. Physics 4. Technology 1. Computing 1. Hardware 2. Software 2. Engineering In my situation, I know of Hardware, but I need to know the following: 4. Technology 1. Computing 1. Hardware Or if I know of Physics, I need to know: 3. Science 3. Physics Does anyone know how to accomplish this in a Cake-ish way (without hacking a bunch of queries together in my controller)? 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?hl=en -~--~~~~--~~--~--~---
Re: Opinion: Best way to create data entry form
http://cakeforge.org/snippet/download.php?type=snippetid=158 might be a start On Dec 27, 2:08 am, Tazz [EMAIL PROTECTED] wrote: First I will describe my model and then present the way I see to create the data entry. I'm looking for a user friendly solution. I'm building an application for a record store so they can send out a weekly newsletter. The newsletter can have a blog entry and multiple record albums. Each record album can have multiple songs. So i was thinking of doing a wizard style data entry... 1- Create news letter with blog 2- Create album 3- Create and attach song to album 4- Cycle back to 2 5- Finish One thing was mentioned that there will never be more then 4-5 song per album so the I though to myself the album and song form can be one, where at the top you enter the album info and under you have 4-5 slots for the tracks! But I figure now I have to manually iterate through the form data to split everything up. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP goes crazy when zend.ze1_compatibility_mode is On
The 'className' property is set automatically based on the name of the association if you do not specify it. This is probably a bug in PHP. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Custom Class Placement?
Hi, first off, I am new to CakePHP and this group, so I apologize if this has been covered in prev. discussions (I couldn't find any...) Couple questions... Where in the file hierarchy do I put my custom classes that don't necessarily belong in models or controllers? And how do I load them? Where can I define global constants? How do I reference variables from a layout? (How do I set a variable from a controller to be used in a layout? The set function only seems work for variables referenced from the view portion... 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?hl=en -~--~~~~--~~--~--~---
Re: Reverse recursive findAllThreaded queries?
Yes, there is a single table that references itself with a parent_id field. This is pratically identical to how it laid out in this example: http://bakery.cakephp.org/articles/view/63 On Dec 26, 5:08 pm, phirschybar [EMAIL PROTECTED] wrote: Are all of the items in your hierarchy one type of data? In other words, are they all in one table with an association of has and belongs to many? Ben On Dec 26, 7:32 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a situation where I know the id of a child, but I need the parental hierarchy. Using the structure in this (excellent) Bakery example, I have the following: 1. Art 1. Film 2. Music 1. Jazz 2. Pop 2. History 1. Archaeology 2. War 3. Science 1. Biology 2. Chemistry 3. Physics 4. Technology 1. Computing 1. Hardware 2. Software 2. Engineering In my situation, I know of Hardware, but I need to know the following: 4. Technology 1. Computing 1. Hardware Or if I know of Physics, I need to know: 3. Science 3. Physics Does anyone know how to accomplish this in a Cake-ish way (without hacking a bunch of queries together in my controller)? 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?hl=en -~--~~~~--~~--~--~---
Re: how would you scale a cake app?
On 12/27/06, Langdon Stevenson [EMAIL PROTECTED] wrote: Thanks for that info, much appreciated. One more question though, when you say 3+1 do you mean a cluster of 3 database servers and one web server? I think he said 3 web servers + 1 MySQL, MySQL server is probably a master and handles all the writes and then replicated back on the 3 web servers which are used for subsequent reads. but I am just speculating here Cheers Tarique -- = PHP Applications for E-Biz: http://www.sanisoft.com Cheesecake-Photoblog: http://cheesecake-photoblog.org = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how would you scale a cake app?
On 12/27/06, bgmill [EMAIL PROTECTED] wrote: Thanks for your reply Firstly, I don't claim to be a hardware guru, and my estimations are purely based on brief conversations with the techs who run the servers. So with that in mind... all the machines are dual xeon 2.8GHz with 2Gb of memory. With this setup, I would again speculate that you would would get much more than 1.2 mill and still remain much below the load average of 3 (I keep 3 as the alarm point) May Santa give your site get many more hits so that we can test out this hypothesis :) The decision to use 3+1 straight off the bat was mainly due to the need for handling rapid expansion -- the site only launched 2 weeks ago. Add to the mix the need for video transcoding and an element of the unknown in this respect meant it was easier to start with more than less. How is the MySQL setup on this? is it like what I speculated in a message later on 1 Master + 3 Slaves ? Cheers Tarique -- = PHP Applications for E-Biz: http://www.sanisoft.com Cheesecake-Photoblog: http://cheesecake-photoblog.org = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Reverse recursive findAllThreaded queries?
So, essentially you're trying to find breadcrumbs to your selection? Maybe a function could be added to the tree helper. Like.. /// Usage in view: $tree-showCrumbs(99, 'Section/name', $data); /// New function in tree helper class: function showCrumbs($id, $name, $data) { /// .. something clever with a recursive use of php array_keys() function /// .. would have to track back to the parent returning the names and ids /// .. of the sections. Thoughts anyone? } On Dec 26, 10:35 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Yes, there is a single table that references itself with a parent_id field. This is pratically identical to how it laid out in this example:http://bakery.cakephp.org/articles/view/63 On Dec 26, 5:08 pm, phirschybar [EMAIL PROTECTED] wrote: Are all of the items in your hierarchy one type of data? In other words, are they all in one table with an association of has and belongs to many? Ben On Dec 26, 7:32 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a situation where I know the id of a child, but I need the parental hierarchy. Using the structure in this (excellent) Bakery example, I have the following: 1. Art 1. Film 2. Music 1. Jazz 2. Pop 2. History 1. Archaeology 2. War 3. Science 1. Biology 2. Chemistry 3. Physics 4. Technology 1. Computing 1. Hardware 2. Software 2. Engineering In my situation, I know of Hardware, but I need to know the following: 4. Technology 1. Computing 1. Hardware Or if I know of Physics, I need to know: 3. Science 3. Physics Does anyone know how to accomplish this in a Cake-ish way (without hacking a bunch of queries together in my controller)? 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?hl=en -~--~~~~--~~--~--~---
Re: Opinion: Best way to create data entry form
Is there any more info on this component? For instamce can I do a cycle back? To keep adding until finished? stab wrote: http://cakeforge.org/snippet/download.php?type=snippetid=158 might be a start On Dec 27, 2:08 am, Tazz [EMAIL PROTECTED] wrote: First I will describe my model and then present the way I see to create the data entry. I'm looking for a user friendly solution. I'm building an application for a record store so they can send out a weekly newsletter. The newsletter can have a blog entry and multiple record albums. Each record album can have multiple songs. So i was thinking of doing a wizard style data entry... 1- Create news letter with blog 2- Create album 3- Create and attach song to album 4- Cycle back to 2 5- Finish One thing was mentioned that there will never be more then 4-5 song per album so the I though to myself the album and song form can be one, where at the top you enter the album info and under you have 4-5 slots for the tracks! But I figure now I have to manually iterate through the form data to split everything up. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cake Development: 1.2.0.4206 Router Question
Hi, everyone, I just using Cake 1.2. Normally, in the stable version. We just need define a router like: $Route-connect('/', array('controller' = 'events','action' = 'index')); And then all the action related with events like view, edit will work perfectly. BUT in the 1.2, I also define a router like below: Router::connect('/posts', array('controller' = 'posts', 'action' = 'index')); It is only work with /posts. When I wanna brower ../cake2/posts/view/1 There is an error message like Missing View Controller. Then I define Router::connect('/posts/view/*', array('controller' = 'posts', 'action' = 'view')); It works again. Is it the way to work within 1.2 ? We should define every single action in the router? 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?hl=en -~--~~~~--~~--~--~---
RE: Reverse recursive findAllThreaded queries?
What about something like this: class SectionController extends AppController { var $uses = array('Section'); function view($nodeId) { $tree = $this-Section-findAllThreaded(); $breadCrumb = $this-_findBreadCrumb($tree, $nodeId); echo 'pre'; print_r($breadCrumb); echo '/pre'; exit; } function _findBreadCrumb($tree, $nodeId, $currentPath = array()) { $breadCrumb = array(); foreach($tree as $node) { $currentNode = $node['Section']; if ($currentNode['id'] == $nodeId) { $breadCrumb = $currentPath; $breadCrumb[] = $currentNode; return $breadCrumb; } else if (isset($node['children']) count($node['children']) 0) { $currentPath[] = $currentNode; $result = $this-_findBreadCrumb($node['children'], $nodeId, $currentPath); if (count($result) 0) { return $result; } } } return $breadCrumb; } } If for example on the DB you have something like: Articles (ID 1) Programming (ID 3) PHP (ID 7) CakePHP (ID 8) And you are looking for ID 7 (PHP) $breadCrumb should be: array( array( 'id' = 1, 'name' = 'Articles' ), array( 'id' = 3, 'name' = 'Programming' ), array( 'id' = 1, 'name' = 'PHP' ) ) I haven't tested this, so your computer may burst into flames ;) Just kidding, it should work. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de phirschybar Enviado el: Miércoles, 27 de Diciembre de 2006 01:20 a.m. Para: Cake PHP Asunto: Re: Reverse recursive findAllThreaded queries? So, essentially you're trying to find breadcrumbs to your selection? Maybe a function could be added to the tree helper. Like.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Reverse recursive findAllThreaded queries?
I like that idea, I'll try it out (and fix anything that is broken). Thanks Mariano! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Reverse recursive findAllThreaded queries?
Ok, I tried this and everything looks very nice (after the small amount of testing I did). The result is definately workable. Thanks again Mariano for your 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?hl=en -~--~~~~--~~--~--~---
Re: Avoiding unnecessary querys
Since reading this, I've been using Mariano's technique for limiting results. It's a pretty slick way of handling this problem. http://bakery.cakephp.org/articles/view/185 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: pretty-url mayhem
add ?php echo $this-base ? in the left side of your css or js url --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---