Re: Problems with components in php4
The paste is deleted. Repaste it and be sure to check 'save paste' Rodrigo Perez ha escrito: > I'm using cake trunk 3363 --~--~-~--~~~---~--~~ 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: Template Extension and Smarty.
I haven't tried this in awhile. Good luck. http://projects.simpleteq.com/CakePHP/smarty.html --~--~-~--~~~---~--~~ 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: Intercepting dispatcher's routes
http://cake.insertdesignhere.com/posts/view/2 --~--~-~--~~~---~--~~ 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: output DISTINCT records
You should start using search to find help. www.cakephp.org/search See this link for help for your problem. https://trac.cakephp.org/ticket/663 --~--~-~--~~~---~--~~ 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: Field is apparently a reserved word.
inflectors is always a good place to start: http://api.cakephp.org/inflector_8php-source.html#l00264 There is also a request for a list of keywords via ticket 1318. https://trac.cakephp.org/ticket/1318 --~--~-~--~~~---~--~~ 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: Multiple select and relationship many-to-many
I'm new to cake but doesn't the many-to-many table name need to be in alphabetic order as such: "alphafirst_alphasecond", or "areas_events". Maybe that will help :) Z Kenia wrote: > Hi.. i have a problem with the multiple select in a relationship > many-to-many... > > my tables: > > event > id_event - int > name - varchar > > areas > id_area- int > name - varchar > > events_areas > area_id - int > event_id - int > > then, i need to put in the multiple select the areas of the event: add, > show, delete and edit. > > somebody could help me? > > 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: Auckland Based Bakers
I like the idea. Would be great to be able to see who else is using Cake in the area. Olwen, I don't know when next I'll be south of the border but when I do I will let you know. Likewise if you're coming up to Auckland. Cheers all, Freedom On 18/08/06, Felix Geisendörfer <[EMAIL PROTECTED]> wrote: > > Hm, > > maybe we could add a little "web 2.0" community aspect to the cake map to > allow people to get a list of the closest bakers to one's own position / > organize local meetings. Any Baker living close to Zwickau/Dresden in > Germany? : ) > > Felix > > -- > http://www.thinkingphp.org > http://www.fg-webdesign.de > > > sicapitan wrote: > and if there are any Beijing bakers, a bottle of tsingtao awaits :) > > > > > > > > > > --~--~-~--~~~---~--~~ 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: output DISTINCT records
Is it possible to do something like this? $this->set('data', $this->Post->findAll(array('DISTINCT categories.name', 'Post.category_id'=>$id))); as in putting DISTINCT in the array? --~--~-~--~~~---~--~~ 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: Filtering Data
Btw, the above example worked. 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: Dynamic Links
That worked. Thanks a lot. --~--~-~--~~~---~--~~ 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: Filtering Data
what about the HABTM associations., is there an easy method to filter information based on values in the join table? e.g. User and Group models using groups_users function index() { $conditions = array('Group.id' => 2); $this->data = $this->User->findAll($conditions); } On 19/08/06, Samuel DeVore <[EMAIL PROTECTED]> wrote: > array('Post.category_id'=>$id,'Post.author'=>'me') > > you can also have >, < and stuff like that just put it like > 'Post.category_id'=>'< ' + $id > > for a strange one. > > really you want to avoid the custom sql (using ->query) as much as possible > IMHO read the manual section on model for more information > http://manual.cakephp.org/chapter/models > > your conditions can be an array or a string (I tend to prefer the array > notation) > > sam D > > > > > On 8/18/06, c_doug <[EMAIL PROTECTED]> wrote: > > > > Thanks, I'll try that as soon as I get a chance. Can you please tell me > > how (or if it is possible) to have multiple conditions in the array? > > Similar to: WHERE category_id = 1 AND author = 'me'. > > > > Also at what point of complexity or when is it just better to use SQL > > in your model? > > > > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: inheritance beyond model?
>If Vehicle is > an abstract class that you won't be instantiating you could just put it > in your app folder, and therefore bypass any problems caused by > loadModels. hmm. that may be the way to go about things. -- Best, Irfan Baig --~--~-~--~~~---~--~~ 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 beyond model?
Those seem to be done as Components, so I imagine the way to include component classes doesn't cause the problem seen here. I'm still new to Cake (just started coding yesterday :) But the description of Components (as controllerettes, etc) doesn't necessarily match the use case here. So should one really have to set up a Component just in order to be able to subclass their models? I'm not clear, but if you (or anyone else) can tell me how this relates to the larger 'Cake way of doing things', that would be great. On 8/18/06, John David Anderson (_psychic_) <[EMAIL PROTECTED]> wrote: > > For inherited models, you might look to see how Cake's ACL models are > set up. ACO and ARO are both children of a class called AclNode. -- Best, Irfan Baig --~--~-~--~~~---~--~~ 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 beyond model?
> if (!class_exists('Vehicle')) { > class Vehicle extends AppModel > { > var $name = "Vehicle"; > } > } yep, haven't tested it, but that would probably work. damn ugly though (no offense meant - and thanks for making the effort) i just wonder if there's a legitimate reason (beyond performance issues - and yes, that's pretty legitimate :) why this should be the way things are. -- Best, Irfan Baig --~--~-~--~~~---~--~~ 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: url and routing
Yep thanks again AD7six. Your way is simple and...it works. dario --~--~-~--~~~---~--~~ 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 with Data Model for findAll querying
Hey, i've been trying to set my data model/database up to use the cake built in querying system, with partial success. I've temporarily written my own queries, except then i need to reformat the returned array to make it useful. I have several tables posts posts_users users wikis tags tags_wikis photos The logic i have setup is: posts HABTM users hasMany wikis wikis belongsTo users belongsTo posts HABTM tags hasMany photos users hasMany posts hasMany wikis tags HABTM wikis photos belongsTo wikis My goal is to do a search on post and it returns (in chunks of 5 for pagination) all the wikis and users, plus for each wiki it returns the tags and photos. The databases seem to communicate okay, but some of the parameters in my associations are completely ignored. For example i use the following statement in the controller: $this->Post->findAll(null, null, null, "5"); var $hasAndBelongsToMany = array( 'User' => array( 'className' => 'User', 'joinTable' => 'posts_users', 'foreignKey' => 'post_id', 'conditions' => '', 'order' => '', 'limit' => '', 'dependent' => true, 'exclusive' => false, 'finderSql' => '', 'deleteQuery' => '' ) ); // only return the most recent wiki var $hasMany = array( 'Wiki' => array( 'className' => 'Wiki', 'conditions' => '', 'order' => 'Wiki.created DESC', 'limit' => '1', 'foreignKey' => 'post_id', 'dependent' => true, 'exclusive' => false, 'finderSql' => '' ) ); Now when i do a find or findall cake returns array( Post = array of post row Wiki = array( 0 = array of 1st wiki row 1 = array of 2nd wiki row 2 = array of 3rd wiki row ... etc) User = array( 0 = array of 1st wiki row 1 = array of 2nd wiki row 2 = array of 3rd wiki row ... etc) ) But in my association, i asked it to only return one wiki. My first question then, is how do i get my association to only return 1 wiki, while returning 5 posts? thanks -matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cross Application Sesssion
You might hop on IRC for this one. I am not sure many of us have tried this before, but you should be able to find someone in the IRC channel to give you a definitive answer. On 8/18/06, Mandy Singh <[EMAIL PROTECTED]> wrote: > I would be really helpful to get an answer on this one. > > I even tried using the database option but somehow it just doesn't work. > > Basically, I am trying to log the user in in /app1/ and then connecting to > /app2/ which is /rdBloggery/ and want him autologged in there. > > Both apps are on the same domain but in diff folders under /cake/ > > :( > > 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 -~--~~~~--~~--~--~---
Re: Trying CakePHP for the first time and get error
Out of curiousity what zip program did you use to extract the downloaded archive. The empty directories are included in the archive, but some extraction utilities do not create the empty directories upon extraction to the filesystem. On 8/18/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Figured it out. In case others get this. I found that if I created an > empty "models" directory in the app folder, the warnings go away. > > > > > --~--~-~--~~~---~--~~ 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: Saving with hasMany
On Aug 18, 2006, at 3:54 PM, Rolo D. Monkey wrote: > > I know that you cannot save associated records directly from a model > that has a hasMany relationship, but how do you do it indirectly? I > have been all over the web for hours looking for this. > > Here is a simplified version > > Model Member hasMany Individual > Model Individual belongsTo Member > > I am importing data and I can successfully save a new Member. I have > an array of Individual names, but I don't know how to save them, and > keep the association intact. Is it some variation of > > $this->Member->Individual->save($record); You should be able to do this if the two are associated. > > or do I have to declare > > $uses = array("Member", "Individual"); > > in the MembersController, and then do > > $this->Individual->save($record); This should work as well, but $record['Individual']['member_id'] needs to be populated with the right ID. > If so, how do I get the id of the member I just saved? Model::getLastInsertId() http://manual.cakephp.org/chapter/models > By the way, CakePHP is awesome, and it has already saved me weeks > worth > of work, but there are massive holes in the documentation on simple > stuff like this. Yeah, the docs have some holes, but this is addressed in the "Saving Your Data" section of the URL provided above. Hope this works for you. -- 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 -~--~~~~--~~--~--~---
Saving with hasMany
I know that you cannot save associated records directly from a model that has a hasMany relationship, but how do you do it indirectly? I have been all over the web for hours looking for this. Here is a simplified version Model Member hasMany Individual Model Individual belongsTo Member I am importing data and I can successfully save a new Member. I have an array of Individual names, but I don't know how to save them, and keep the association intact. Is it some variation of $this->Member->Individual->save($record); or do I have to declare $uses = array("Member", "Individual"); in the MembersController, and then do $this->Individual->save($record); If so, how do I get the id of the member I just saved? By the way, CakePHP is awesome, and it has already saved me weeks worth of work, but there are massive holes in the documentation on simple stuff like 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: output DISTINCT records
You're right. Although, I wonder if there is a way to do it with model objects rather than SQL.?. --~--~-~--~~~---~--~~ 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: Session variable in $helpers array
John David Anderson (_psychic_) wrote: > Is much of your helper code the same from language to language? I > might write a single helper that is somehow aware of the session, > rather than trying to make several different helper classes that need > to be juggled. > Thanks for reply John. The main reason to separate language content into several files is - there will be much info (about 70 kb for each language) that's why I would like to include only necessary information to not overload the page. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Field is apparently a reserved word.
Field seems to be a reserved word in cake. i had a table called fields, with a model filename of field.php. A simple bake of the model and controller with scaffolding turned on gave me all sorts of warnings. i renamed it something else, and it works fine. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Find conditions for HABTM
how do you solved that? kitten wrote: > >> Right now, it seems that a custom query (over 3 tables) is necessary to get > >> the desired result... > > > > Why not create an enhancement ticket to allow for this possibility? > > Done :) > > By posting to the list, I justed wanted to be sure that I was not overseeing > somthing obvious. > > Heiner > > > > Cheers, > > > > AD7six > > PS. I thought I had about a week ago, but clearly I got disconnected > > before clicking "save". > > > > > > > --~--~-~--~~~---~--~~ 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: output DISTINCT records
I'd say to do in the SQL, otherwise you're looping through records in the foreach that you don't need. I don't see why this would be any different for Cake or any other PHP application. On 8/18/06, c_doug <[EMAIL PROTECTED]> wrote: > > Anyone? > > > > > -- 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: output DISTINCT records
Anyone? --~--~-~--~~~---~--~~ 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: Session variable in $helpers array
On Aug 18, 2006, at 2:28 PM, mutabor wrote: > According to this session variable I want to include appropriate > helper > , so I need something like that: > > var $helpers = array('Html','Pagination',$this->Session->read > ('lang')); > > but it does not work. Could anybody tell me what is the best way to > implement things I want? Is much of your helper code the same from language to language? I might write a single helper that is somehow aware of the session, rather than trying to make several different helper classes that need to be juggled. -- 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: Help with Model Design
Chris Hartjes wrote: > I'd say that it doesn't matter that there will not be a GoalieStat > record for some players. If there is an associated record, then it > will show up. > > Teams -> hasManyPlayers > Players -> hasPlayerStats, hasGoalieStats > PlayerStats -> belongsToPlayers > GoalieStats -> belongsToPlayers > > I'm of course assuming that the models will handle any missing records > with grace. :) That's kind of what I'm assuming. I still think I want to create the associated record when the Player is created. That way I don't have to worry about the record not existing, and handling special cases, etc. Not real sure how to do that just yet, but I have some ideas - just need to try them out. -Scott > > On 8/18/06, Scott Sharkey <[EMAIL PROTECTED]> wrote: >> Hi All, >> >> I'm working on a hockey league website, and need some ideas on the best >> way to handle this situation: >> >> I have models for Teams, Players, PlayerStats, GoalieStats. There will >> only be one entry in either PlayerStats or GoalieStats, depending on >> whether the player is a goalie or a skater. I think I need to create >> the corresponding record in one of the Stat's tables when the Player is >> created. So, what's the best way to do that? >> >> Does it matter that there will not be a "GoalieStat" record for some >> players, and vice versa? Or should I create empty records for both, >> then just fill in the appropriate one and ignore the other? >> >> Suggestions welcomed! >> >> -Scott >> > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Session variable in $helpers array
Hello, I am still new at Cake. Here is my question: I develop multilingual site. I am going to create some helpers to help me deal with many languages. Here is an example : var $helpers = array('Html','Pagination','En'); where 'En' is English helper, there will be also others ('GER','ESP','RUS', etc) Until user is logged on 'En' helper will be used, but when user logs in he gets $this->Session->write('lang','USER_DEFAULT_LANGUAGE_ FROM_DB'). According to this session variable I want to include appropriate helper , so I need something like that: var $helpers = array('Html','Pagination',$this->Session->read('lang')); but it does not work. Could anybody tell me what is the best way to implement things I want? --~--~-~--~~~---~--~~ 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 with Model Design
I'd say that it doesn't matter that there will not be a GoalieStat record for some players. If there is an associated record, then it will show up. Teams -> hasManyPlayers Players -> hasPlayerStats, hasGoalieStats PlayerStats -> belongsToPlayers GoalieStats -> belongsToPlayers I'm of course assuming that the models will handle any missing records with grace. :) On 8/18/06, Scott Sharkey <[EMAIL PROTECTED]> wrote: > > Hi All, > > I'm working on a hockey league website, and need some ideas on the best > way to handle this situation: > > I have models for Teams, Players, PlayerStats, GoalieStats. There will > only be one entry in either PlayerStats or GoalieStats, depending on > whether the player is a goalie or a skater. I think I need to create > the corresponding record in one of the Stat's tables when the Player is > created. So, what's the best way to do that? > > Does it matter that there will not be a "GoalieStat" record for some > players, and vice versa? Or should I create empty records for both, > then just fill in the appropriate one and ignore the other? > > Suggestions welcomed! > > -Scott > > > > -- 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: Underscores in Database Prefixes
While I'm asking questions: Cake doesn't have some kind of problem with building a MVC around the names "page/pages" does it? I keep getting all sorts of errors from VERY basic scaffold code using these names. --~--~-~--~~~---~--~~ 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: Is ACL explained in great detail anywhere
Thanks for the tip AD7six, I was also searching for easy means to implement ACL on my CakePHP app.On 8/18/06, AD7six < [EMAIL PROTECTED]> wrote:Hi Codecowboy,You might want to try installing the acm plugin (avialable from cakeforge) and just from using it ACL becomes quite easy to understand.It took me a few minutes to figure out how to set it up, (if you changethe acm_app_controller to include the config file, and edit the config file to give you the right constants it will work quite well). There isa 'hidden' method that will create you some test users if you don'thave any yet (look at the source) or you can 'auto load' your existing users into the aro table, and by using the gui you can create acoobjects for your controllers and actions.HTH,AD7six --~--~-~--~~~---~--~~ 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 with Model Design
Hi All, I'm working on a hockey league website, and need some ideas on the best way to handle this situation: I have models for Teams, Players, PlayerStats, GoalieStats. There will only be one entry in either PlayerStats or GoalieStats, depending on whether the player is a goalie or a skater. I think I need to create the corresponding record in one of the Stat's tables when the Player is created. So, what's the best way to do that? Does it matter that there will not be a "GoalieStat" record for some players, and vice versa? Or should I create empty records for both, then just fill in the appropriate one and ignore the other? Suggestions welcomed! -Scott --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
User Bar Logic
I need to send 2 variables to the default template file, 1 to say wether a user is logged in and the other containing the username. I tried using appController to do this, with a beforeFilter, but it wasn't availible for the default template. Where could I put the logic code so that I could set variables to be used by default.thtml in layouts? --~--~-~--~~~---~--~~ 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: Is ACL explained in great detail anywhere
Hi Codecowboy, You might want to try installing the acm plugin (avialable from cakeforge) and just from using it ACL becomes quite easy to understand. It took me a few minutes to figure out how to set it up, (if you change the acm_app_controller to include the config file, and edit the config file to give you the right constants it will work quite well). There is a 'hidden' method that will create you some test users if you don't have any yet (look at the source) or you can 'auto load' your existing users into the aro table, and by using the gui you can create aco objects for your controllers and actions. HTH, AD7six --~--~-~--~~~---~--~~ 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: Problems with components in php4
I'm using cake trunk 3363 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Problems with components in php4
I'm creating a i18n component based on http://wiki.cakephp.org/tutorials:i18n I have this code: http://cakephp.org/pastes/show/57fe154a13ff7d742a60470e851d6e7e In php5, all works fine ... but not in php4. In php4, in views I call $locale->__('test'); but $_messages is an empty array in LocaleComponent::__() What is wrong ? 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: Underscores in Database Prefixes
Turned out to be table permissions actually. You get the error I mentioned above if the MySQL UN/PW is valid, but not authorized to access the database/table specified in the config. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Underscores in Database Prefixes
I have underscores in the names of my table and I don't think it would much different if there was a prefix. Can you paste one of your sample models? On 8/18/06, beporter <[EMAIL PROTECTED]> wrote: > > I'm just starting to play with CakePHP and I've run into a stumbling > block that exists only because of my pure unfamiliarity with the > framework. > > I have an existing database that I'd like to link into using Cake, but > the tables are all prefixed with "pts_". The table I wish to connect > to is named "pages". When I try to set my prefix in config/database.php > for that connection, my resulting error is "No Database table for model > Page (expected "ptspages")... > > Now, I would have expected a prefix value of "pts_" plus "pages" to > equal "pts_pages" instead of "ptspages". What is causing the underscore > to be dropped and how can I fix it? > > (I realize as a general practice using an underscore in the table name > is not wise, and I realize I could change the table name, but my goal > is to supplement [for the time being: eventually replace] an existing > software package that wouldn't take too kindly to new table names so > right now all I need is a work around.) > > I would appreciate some expert advice. > > Thanks! > Brian > > > > > -- 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: can you restrict the table fields cake recursively retrieves?
I think that what you want is the fields element in the Album model's association array for Image, something like: $hasMany = array ('Image' => array ('fields' => array ('Image.name','Image.id'))) I don't remember exactly if you need the 'Image.' part or not... You can dynamically change this via the bindModel and unBindModel methods of the Model. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Underscores in Database Prefixes
I'm just starting to play with CakePHP and I've run into a stumbling block that exists only because of my pure unfamiliarity with the framework. I have an existing database that I'd like to link into using Cake, but the tables are all prefixed with "pts_". The table I wish to connect to is named "pages". When I try to set my prefix in config/database.php for that connection, my resulting error is "No Database table for model Page (expected "ptspages")... Now, I would have expected a prefix value of "pts_" plus "pages" to equal "pts_pages" instead of "ptspages". What is causing the underscore to be dropped and how can I fix it? (I realize as a general practice using an underscore in the table name is not wise, and I realize I could change the table name, but my goal is to supplement [for the time being: eventually replace] an existing software package that wouldn't take too kindly to new table names so right now all I need is a work around.) I would appreciate some expert advice. Thanks! 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 -~--~~~~--~~--~--~---
session variables
why when i close my browser and reopen it, my session variables are still valid? --~--~-~--~~~---~--~~ 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 you restrict the table fields cake recursively retrieves?
You are going to at least write do some custom functions using model::query() I would put it as a function in your model. if that doesn't work you can bypass the model code and go one level deeper and access your database singleton (datasource) this way: $db =& ConnectionManager::getDataSource(ANY_MODEL_OBJECT->useDbConfig); My .02 --~--~-~--~~~---~--~~ 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 you restrict the table fields cake recursively retrieves?
Chris, thanks for the reply and for backing up my database approach ;) Unfortunately that didn't fix the problem. The issue seems to be that, although my Album model can recursively retrieve data from the Image model, it can't access the Image model in my field list for the find() argument. Doing array('Album.name') for the argument works fine, it returns just the name of the album, and a blank array for the Image model. However, array('Album.name', 'Image.caption') gives me the error: SQL Error in model Album: 1109: Unknown table 'Image' in field list I think it's time to just start writing controller actions and some custom SQL to get the information I need. Thank you both for the 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 -~--~~~~--~~--~--~---
anyone has experience with http://www.domainsname.us.
anyone has experience with http://www.domainsname.us. The have some good expired domains for sale that i will like to purchase. 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 -~--~~~~--~~--~--~---
SOAP
Gotcha, sry if this is off topic, but.. it's friday :-p Awesome review of Snakes on a Plane for anyone interested :-p http://www.aintitcool.com/display.cgi?id=24199 --~--~-~--~~~---~--~~ 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 Links
You would have to put the link in the foreach loop. This is pretty commonly used if you have a list of items and want to delete/edit one. You can use it like this: link('edit this post', '/posts/edit/'. $post['Post']['id']) ?> Like this the id is appended to each edit link and if you have setup your controller mehtod and edit template yu are ready to go --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Is ACL explained in great detail anywhere
Hi, I am building a website that involves multiple user types and various pieces of protected data. I have read all the documentation and the wiki tutorial about cake's ACL. Even the tutorial makes it clear that it does not describe at complete solution is there a complete explanation of ACL and how to use it correctly. If not, is there anyone who would consider themselves a good candidate to build such a system (wink wink!!!) Thank you, codecowboy --~--~-~--~~~---~--~~ 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: Integrate a JS Datepicker
I finally made it .. there was another error in my code which prevented the js from executing. i had a foldername wrong which is of course casesensitive on unix. I choose this one here, because it does not need extra inline javascript: http://www.frequency-decoder.com/demo/fd-date-picker/ The Options are appended by a special class name of the inputfield, which is pretty slick. I´m trying to implement more "Unobtrusive" javascripts like this with the jQery lib. I used the js calendar mentioned by jez in other projects but right now it seems to big for what i needed. still it has a lot of good functions --~--~-~--~~~---~--~~ 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: Filtering Data
array('Post.category_id'=>$id,'Post.author'=>'me') you can also have >, < and stuff like that just put it like 'Post.category_id'=>'< ' + $idfor a strange one.really you want to avoid the custom sql (using ->query) as much as possible IMHO read the manual section on model for more information http://manual.cakephp.org/chapter/modelsyour conditions can be an array or a string (I tend to prefer the array notation)sam D On 8/18/06, c_doug <[EMAIL PROTECTED]> wrote: Thanks, I'll try that as soon as I get a chance. Can you please tell mehow (or if it is possible) to have multiple conditions in the array?Similar to: WHERE category_id = 1 AND author = 'me'.Also at what point of complexity or when is it just better to use SQL in your model? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Cross Application Sesssion
I would be really helpful to get an answer on this one.I even tried using the database option but somehow it just doesn't work.Basically, I am trying to log the user in in /app1/ and then connecting to /app2/ which is /rdBloggery/ and want him autologged in there. Both apps are on the same domain but in diff folders under /cake/:(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 -~--~~~~--~~--~--~---
Re: Integrate a JS Datepicker
I was looking for a calendar datepicker too! Thanks a lot mate ;) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cross Application Sesssion
Hi, I have 2 apps - 1. /cake/app1/ 2. /cake/app2/ In controller of app1 i set one variable in the session eg id=1 Then give a link to go to a page in /app2/ But, now session variable id is not available there. Sometimes, it works. I am confused! Is there some setting I need to change to make cross application sesssions work over the "SAME" domain? Please let me know. Thanks, 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 -~--~~~~--~~--~--~---
Re: CakePHP Syntax
Hi,take a look at this blog post from CakeBaker: http://www.google.com.br/url?sa=t&ct=res&cd=1&url="">Cheers, Marcelo.On 8/18/06, c_doug <[EMAIL PROTECTED]> wrote: Does anyone have a recommendation for the best place to learn the basic(and advavanced) meanings of the CakePHP syntax? Is it part of theregular PHP syntax? I am new to CakePHP and PHP for that matter. I just completed the blog tutorial and am trying to expand it from there.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: inheritance beyond model?
irfan baig wrote: > > Why not just put if (!class_exists('Vehicle')) > > {require("Vehicle.php");} at the top of your scooter and car model > > files? > > Won't work - the issue occurs even before that in basics.php, when > loading the models Ok continuing in the same theme.. Your vehicle model: Your sub vehicle models: There may be a tidier way of doing it, but that'll work. If Vehicle is an abstract class that you won't be instantiating you could just put it in your app folder, and therefore bypass any problems caused by loadModels. HTH, AD7six --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
CakePHP Syntax
Does anyone have a recommendation for the best place to learn the basic (and advavanced) meanings of the CakePHP syntax? Is it part of the regular PHP syntax? I am new to CakePHP and PHP for that matter. I just completed the blog tutorial and am trying to expand it from there. 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: Filtering Data
Thanks, I'll try that as soon as I get a chance. Can you please tell me how (or if it is possible) to have multiple conditions in the array? Similar to: WHERE category_id = 1 AND author = 'me'. Also at what point of complexity or when is it just better to use SQL in your 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 -~--~~~~--~~--~--~---
Dynamic Links
Can anyone tell me how to make a link name and location dynamic based on the data variables? Generic example: link('Add new post', '/posts/add') ?> How can I use a $post variable in place of 'Add new post' or '/posts/add' to make them more dynamic? --~--~-~--~~~---~--~~ 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: View Caching & IE Strict Mode
> Working solution is here: > https://trac.cakephp.org/ticket/1281 This behavior looks to me like a serious problem, so I think this ticket should be marked with higher priority then 'low' :( --~--~-~--~~~---~--~~ 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 you restrict the table fields cake recursively retrieves?
> I was expecting that response. Though I've seen many benchmarks and > quality articles that argue it's a viable solution. Afterall, why else > would MySQL bother to implement it? ;) And I'll never know which is > better if I don't try... Last I heard, flickr stored all of it's images in MySQL. I think images in databases can be acceptable, if you've tuned your database servers, if you handle (or specifically don't want) last-modified and 304, and if there's a lot of metadata associated with the images. Also, in possible answer to your main question, the fields argument needs the table names to be in the form of model names. So instead of users.name I would need to use `User`.name. Hope that helps --~--~-~--~~~---~--~~ 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 use caching of views in multilinguaal sites?
if you solution that problem maybe u can write about this in the cake wiki ? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Intercepting dispatcher's routes
Hi, I want to link to ordinary static pdf's in the app/html tree in my cake application. Is there some way of telling the dispatcher to ignore a directory in there, or do I have to create dummy models, controllers, tables etc. to serve ordinary flat pdf files? thanks, Jez. --~--~-~--~~~---~--~~ 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: Integrate a JS Datepicker
yep, I'm using a DHTML Calendar from www.dynarch.com . Just a couple of lines in afterFind() and beforeSave() to change the format around (because I like looking at dd/mm/ rather than mySQL's YY/mm/dd weirdness) and you're good to go. If you set up the Calendar to use the same format as mysql, you don't even need that! www.dynarch.com/projects/calendar georgeL wrote: > I´m looking for a JS Datepicker to use instead of those ugly 3 > datehelper fields. > i found a couple of JS to acomplish that but i got none of those to > work inside the cake enviroment. > has anybody got a suggestion or successfully done 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: Filtering Data
The problem is that cakePHP is not a clever as you think, you need to set the condition yourself. Remind yourself of the possiblitlies at the http://api.cakephp.org/class_model.html function cat($id) { $this->set('data', $this->Post->findAll(array('Post.category_id'=>$id))); }HTH The cranky old man On 8/18/06, c_doug <[EMAIL PROTECTED]> wrote: Can something like this be modified to only output records with acertain category_id for instance:function view($id){$this->Post->id = $id;$this->set('data', $this->Post->read()); }I have created a new method and modified it slightly:function cat($id){$this->Post->category_id = $id;$this->set('data', $this->Post->findAll()); }but it is still pulling up all records when using php foreach in theview. Should I be using something other than read() or findAll()? Cananyone point me to a good source of info for filtering data? --~--~-~--~~~---~--~~ 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: Template Extension and Smarty.
ad 1) create file app/views/test.php with content: and in Your controller You have to set var $view = 'Test'; ad 2) try visit http://cakephp.org/search?q=smarty BTW: You must have serious reasons for using Smarty in CakePHP IMHHO. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Integrate a JS Datepicker
I´m looking for a JS Datepicker to use instead of those ugly 3 datehelper fields. i found a couple of JS to acomplish that but i got none of those to work inside the cake enviroment. has anybody got a suggestion or successfully done 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: inheritance beyond model?
For inherited models, you might look to see how Cake's ACL models are set up. ACO and ARO are both children of a class called AclNode. -- 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: inheritance beyond model?
> Why not just put if (!class_exists('Vehicle')) > {require("Vehicle.php");} at the top of your scooter and car model > files? Won't work - the issue occurs even before that in basics.php, when loading the models - it tries to load Scooter, for e.g. before Vehicle. So even if you check if class_exists in Scooter, you get an error when loadModels() in basics.php then tries to require (not require_once) Vehicle, due to the fact that it is in the array returned by listClasses(). > I would guess that require is used instead of require_once because > *_once calls are slower (needs to check the file hasn't already been > loaded, taking care of any server path magicary). Yeah, that's what I figured. But it would still probably be quicker than analyzing the inheritance tree. There are a couple of other ways I can think of - notice in loadModels() there is already a check being done - if (!key_exists($model_fn, $loadedModels)) { but sadly, this doesn't help us, since $loadedModels is a local var to that function. If there way, say, a loadedModules singleton or registry, both loadModels() and loadModel() could refer to it, and so, in Scooter, one could do loadModel('Vehicle') and not cause a class redeclaration. -- Best, Irfan Baig --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Template Extension and Smarty.
This is actually 2 questions in 1 post. 1. where can i change the extension from thtml to html, or anything that i would want? 2. could anyone point me in the right direction for using smarty with cakephp? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Filtering Data
Can something like this be modified to only output records with a certain category_id for instance: function view($id) { $this->Post->id = $id; $this->set('data', $this->Post->read()); } I have created a new method and modified it slightly: function cat($id) { $this->Post->category_id = $id; $this->set('data', $this->Post->findAll()); } but it is still pulling up all records when using php foreach in the view. Should I be using something other than read() or findAll()? Can anyone point me to a good source of info for filtering data? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
output DISTINCT records
I know how to easily select only distinct records in SQL. However in CakePHP when using a data model without SQL what is the best way to only output distinct records? Should that be done near the '->findAll()' in the controller or near the 'php foreach' in the view? --~--~-~--~~~---~--~~ 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;
See I do use $this->ModelName->validates, but do not use $uses anymore, it just caused needless headaches. If you have access to IRC I would try to jump on and be ready to post source and let the bigger heads help you out. If you post some source in the cakebin < http://cake.php.org/pastes/add> I'm sure many people would be better able to help you.Sam DOn 8/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: That is the thin, i to nothin like $this->Model->validates, i only use$uses = array ('..', '..', 'Sms');I think its in the model initialization that causes the startup query --~--~-~--~~~---~--~~ 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 you restrict the table fields cake recursively retrieves?
John, I knew about the argument, but no where does it mention recursive fields. So after your suggestion, I decided to try specifying the table and field in the format: array('album.name', 'image.name'), but i kept getting errors that album and image were unknown tables. I tried "albums.name" and "images.name" and got the same error that albums and images were unknown tables. Here's the error if it helps: SQL Error in model Album: 1109: Unknown table 'albums' in field list Thanks in advance to anyone who can help. I'm starting to think I'll just need to retrieve associated image fields on my own... Also, to John: John David Anderson (_psychic_) wrote: > On Aug 17, 2006, at 8:01 PM, Bret Kuhns wrote: > > > Contrary to popular practice, > > There's a reason for this... ;o) I was expecting that response. Though I've seen many benchmarks and quality articles that argue it's a viable solution. Afterall, why else would MySQL bother to implement it? ;) And I'll never know which is better if I don't try... --~--~-~--~~~---~--~~ 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 beyond model?
thanks for the suggestion. I had posted about this before: http://groups.google.com/group/cake-php/browse_thread/thread/6d5c9a0cc142c453/c1d8b44b1a4e5485 I also tried using loadModel() in the header with no success. --~--~-~--~~~---~--~~ 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: Images in CSS
Nope Image paths are always relative to the current css file (execept that you use absolute paths). I always put an "images" folder inside css folder, and call my images like background:url(images/image.png); On 8/18/06, Simplerules <[EMAIL PROTECTED]> wrote: > > How can I use images in the CSS file? I need to get the correct file > location - which would need to be set by Cake PHP. > > > > > -- Armando Sosa www.nolimit-studio.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Images in CSS
How can I use images in the CSS file? I need to get the correct file location - which would need to be set by Cake 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 -~--~~~~--~~--~--~---
Re: Help with Sessions?
Hi Flickle, I don't know the reasons behind your questions of course, but if you change this in your core.php file define('CAKE_SESSION_SAVE', 'database'); and the table exists in the database (see config/sql/sessions.sql) Cake will take care of using the database table for sessions. HTH, AD7six --~--~-~--~~~---~--~~ 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: Check Controller
Hi Simplerules, Either override the method in the controller tha takes care of login and registration, or in your app_controller method check against $this->name and $this->action. HTH, AD7six --~--~-~--~~~---~--~~ 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: Trying CakePHP for the first time and get error
Figured it out. In case others get this. I found that if I created an empty "models" directory in the app folder, the warnings go away. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Check Controller
I have a function in app controller, which will check if a user is logged in and if not - then they will be redirected to a login screen, the problem is I need to know if they are already at the login screen or at the register screen. How could I check from app controller? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Help with Sessions?
I suggest you take a look at PHP's section on handling sessions: http://ca3.php.net/manual/en/ref.session.php and this tutorial on creating a custom session handler http://devzone.zend.com/node/view/id/141 Hope that helps. On 8/18/06, Flickle <[EMAIL PROTECTED]> wrote: > > After Starting a session how do you > 1) Store a session ID in a MYSQL database via PHP > 2) Send information from Mysql via PHP to store in Sessions > 3) Send Information from Sessions via PHP to Store in Mysql > > > > > -- 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 use caching of views in multilinguaal sites?
Hi AD7six and thanks for Your answer. This is exactly what I was afraid of, as it looks I have to define all my custom routes again and again for every language just in app/config/routes.php. And - I really don't want to fight again ;) with $base and similar properties of view/helper instances just for having my app compatible with any possible CakePHP directory structure (developer/production install, with/without mod_rewrite...). I was noticed nate is going to make some changes in cake's router in next few days, so I will wait for new features and then I will see what will be best approach for dynamic route rules creation with information from session (!) in file app/config/routes.php... Thank You for Your time! :) --~--~-~--~~~---~--~~ 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: url and routing
On 18/08/06, nate <[EMAIL PROTECTED]> wrote: Then you can accept the title slug as a parameter to your view action.That's the long way. If you're more experienced with regularexpressions you can make it shorter, but I'm too tired to explain thatpart. I will be doing more work on the Router this weekend to make these setups a easier, so if you can wait till then, great.Hi nate, Thanks for your quick reply, great to know Cake Core developers like you replying newbie question. I think I will try the regular-_expression_ first, cause it can't wait anymore. Thanks a lot. I'll be waiting your patch.PS: Just happened when trying this controller erros, I also found minor bug in $html->css() helpers which output wrong URI target to CSS (eg. xxx is unfounded controller, then the css is xxxcss/yourcss.css). I have submit the first my ticket at https://trac.cakephp.org/ticket/1328 Arif Widianto, Indonesian Baker --~--~-~--~~~---~--~~ 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 with Sessions?
After Starting a session how do you 1) Store a session ID in a MYSQL database via PHP 2) Send information from Mysql via PHP to store in Sessions 3) Send Information from Sessions via PHP to Store in Mysql --~--~-~--~~~---~--~~ 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: url and routing
If you're okay with going the long way, you can setup a route for each of your actions, i.e.: Router::connect('/articles/index/*', array('controller' => 'articles', 'action' => 'index')); Router::connect('/articles/view/*', array('controller' => 'articles', 'action' => 'view')); etc... then, you can add one for anything that doesn't match any of the actions: Router::connect('/articles/*', array('controller' => 'articles', 'action' => 'view')); Then you can accept the title slug as a parameter to your view action. That's the long way. If you're more experienced with regular expressions you can make it shorter, but I'm too tired to explain that part. I will be doing more work on the Router this weekend to make these setups a easier, so if you can wait till then, great. --~--~-~--~~~---~--~~ 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: Auckland Based Bakers
Hm, maybe we could add a little "web 2.0" community aspect to the cake map to allow people to get a list of the closest bakers to one's own position / organize local meetings. Any Baker living close to Zwickau/Dresden in Germany? : ) Felix -- http://www.thinkingphp.org http://www.fg-webdesign.de sicapitan wrote: and if there are any Beijing bakers, a bottle of tsingtao awaits :) --~--~-~--~~~---~--~~ 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: Auckland Based Bakers
and if there are any Beijing bakers, a bottle of tsingtao awaits :) --~--~-~--~~~---~--~~ 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: url and routing
On 18/08/06, AD7six <[EMAIL PROTECTED]> wrote: No point loading all of your IT routes, if the url tells you that thoseroutes aren't needed.Hello All,This reply seemly out of the question, but it still on the subject regarding url/routes. when I try a new URL like -> /articles/title-slugI just realized that it can't be like that, because cake look for function name "title-slug". Anybody can tell me how to solve or trick this problem? Well, it is okay if i had /articles/view/title-slug, but this is not what I really need :)I think the manual should be updated more, I'd love join this list, as far as I know more little great things like $from_url in routes above (thx Ad7), etc. -OOT, I'm happy to know Cake and really enjoy learn a lot of thing in it. I love how just including:var $users = array('Article','Edition','Comment') on my Controller, and I can access those tables at all without concerning with confusing inner join sql. All my concern is just how our tables related with others, and build them all with the controllers with easy way. Very great! Hopefully can contribute sometimes.PS: sorry my englishArif Widianto,Jakarta, Indonesian Cake Baker --~--~-~--~~~---~--~~ 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: commit, rollback and transactions
John David Anderson (_psychic_) ha scritto: > On Aug 17, 2006, at 4:27 AM, M wrote: > > > > > Hello, > > > > I read a few emails about the lacking of transaction management in > > Cake. > > As I am building a web application with Cake for a potential customer, > > i wonder how > > to assure that my application has consistent data on the database. > > > > For example, if I write some data to the DB, and at a certain point a > > SQL error occurs, how I am supposed to "rollback" the entire > > transaction? > > Is there any technique to do so or i should stop and move to another > > framework? > > Fear not, and do not abandon all hope. Rather, check out yonder API. > > Check out Model::begin(), Model::commit(), and Model::rollback(). > > Yet another baker saved from the icy clutches of a second-rate, non- > CakePHP framework. > > -- John Hello John, I tried converting a table to engine INNODB and setting the property $transactional in the corresponding model, and it works. Thank you VERY MUCH. -- Michele --~--~-~--~~~---~--~~ 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: Validation: Futureproof / Accepted Technique?
I'm also disappointed with Cake's built-in validation routine. Before I tried using Advanced Validation, but I ended up having too many extra validation methods. Right now, I'm experimenting with Advanced Validation w/ Parameters, and I'm trying to make it work automatically without the controller calling a function like load_validation(). This kind of workaround simply defies MVC principles. I tried assigning the $validate variable on the beforeValidate() callback method, but this doesn't seem to work. --~--~-~--~~~---~--~~ 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
Hi All, CodeCowboy - the wiki page I wrote was intended to 'show the way' (or at least one way) to manage dynamic menu (or other generic data for that matter) generation, but I didn't intend to address how to get the menu data as that's often project specific. As you know, writing lots of fixed arrays in a switch is a bit restrictive and cumbersome. From the sounds of it you need a DB solution so that you can just call a component/method with parameters and get back your menu array data (or to follow the withcake way). For contrast/discussion: For this case I don't need any extra parameters in my uls and recently took a different approach. I created some methods in app_controller: _defineMenuMain _defineMenuContext .. which contain some generic logic, but can be overriden of course by any controller; in the beforeRender method I call $this->set('MenuMain',$this->_defineMenuMain(); $this->set('MenuContext',$this->_defineMenuContext();); The logic in this case is that I wanted to create a context menu which with a few exceptions is based upon the controller methods (e.g. defineMenuContext returns the controller methods that can be called without parameters), and the logical place to put the code to work that out was in the controller (so that it could be overriden where needed). Re making the menu smart - you can explode the url and compare it with your controller name and action to see where you are, and Armando's funky link helper would take care of the presentation side if you pass the right parameters. HTH, AD7six --~--~-~--~~~---~--~~ 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: url and routing
Hi Dario, I think creating an IT controller is going to mean a bit of unnecessary work on Cakes part. Why not create two route files, or sections, and load the routes based upon the first parameter of the url (with a default)? So you would have in routes.php: } else // assume default language. { $route-> } ?> No point loading all of your IT routes, if the url tells you that those routes aren't needed. In your app_controller beforeFilter (or also in routes.php, if you can access the session there) you could check the url as Kitten mentioned and set the session language and off you go. HTH, AD7six --~--~-~--~~~---~--~~ 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 use caching of views in multilinguaal sites?
Hi mouth, This is the line that probably matters 4 U, in cake/bootstrap.php: $filename = CACHE . 'views' . DS . convertSlash($uri) . '.php'; Assuming that your language is stored in the session, and you want the least hacky way I would suggest an approach like this: * in /app/config/bootstrap.php check the URL and if it doesn't contain an explicit variable with the session language - add it. (e.g. /pages/home -> /de_DE/pages/home) * Create a route so that will ensure that the first parameter is not understood to be the controller ('/de_DE/:controller/:action/*') * Check that it works and renders the right cache ;) HTH, AD7six --~--~-~--~~~---~--~~ 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 beyond model?
Hi, Why not just put if (!class_exists('Vehicle')) {require("Vehicle.php");} at the top of your scooter and car model files? I would guess that require is used instead of require_once because *_once calls are slower (needs to check the file hasn't already been loaded, taking care of any server path magicary). HTH, AD7six --~--~-~--~~~---~--~~ 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
Cool, thanks very much it worked --~--~-~--~~~---~--~~ 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: Auckland Based Bakers
I'm a little way form Auckland -- an Island away. But would be interested in a beer or a vineyard lunch if you ever cross the ditch. On 18/08/06, Mikee Freedom <[EMAIL PROTECTED]> wrote: > > Hey all, > > I'm still new at this but the more I work with it the more I love it. > Was wondering if there were any bakers in the Auckland, NZ region who > wanted to catch up for a couple of beers and a bit of a Cake chat. > > Cheers, > Freedom > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---