Re: Bill
Bill estou usando a versão: cake_1.2.0.6311-beta Caso vocês não acham conveniente usar esta versão por gentileza envie-me sugestões. Mas uma vez agradeço ajuda!!! --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: Bill
Olá helio, implementei em sites aqui este sistema de login e funcionou perfeitamente. http://bakery.cakephp.org/articles/view/simple-form-authentication-in-1-2-x-x O tutorial que você está usando é apra a versão 1.1.x do cake, e não a versão 1.2. Tente usar este tutorial e me fala se deu certo. Abraços Bill Bill estou usando a versão: cake_1.2.0.6311-beta Caso vocês não acham conveniente usar esta versão por gentileza envie-me sugestões. Mas uma vez agradeço ajuda!!! --~--~-~--~~~---~--~~ Você recebeu esta mensagem porque está inscrito no Grupo Cake PHP Português em Grupos do Google. Para postar neste grupo, envie um e-mail para cake-php-pt@googlegroups.com Para cancelar a sua inscrição neste grupo, envie um e-mail para [EMAIL PROTECTED] Para ver mais opções, visite este grupo em http://groups.google.com/group/cake-php-pt?hl=pt-BR -~--~~~~--~~--~--~---
Re: How to correctly use l10n and i18n in Cake 1.2?
I've been working on something similar. You don't say whether the select options are dynamic - from a db - or static. I haven't tried it yet, but can't you just pass the message names wrapped in __(), possibly with the true parameter, into the options? On Feb 20, 5:55 pm, Alan Ford [EMAIL PROTECTED] wrote: I am trying to find out the usage of i10n and i18n with Cake 1.2. Let's try a simple example: I want to develop an app with multilanguage support. For simplicity let's say we have it in English and German. Now, let's pretend we have a form where you are supposed to select your gender from a select box. In the desired language, I will need to 1) display the label for the select box 2) populate the select box with the possible options Part 1 I will do via l10n and .po files as specified inhttp://tempdocs.cakephp.org/#TOC135299 This is pretty straight forward and works nicely. But how do I implement part 2 automagically with the correct gender in the desired language? How to make Cake retrieve the right content and save it with the correct id? I've taken a look at the proposed i18n table structure but cannot figure out how to implement it. From the i18n class description I also cannot really learn anything. From what I've understood, I will use the l10n class for any content that is not database-related, e.g. labels for form elements, error messages, titles etc. I'd use i18n as soon as I have data that needs to be displayed in different languages AND saved in the database. Any help, pointers, simple solution would be greatly appreciated! Thx 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: relationships problem
Category hasMany Post , Post belongsTo Category , Post belongsTo Locality posts table must have these two fields: category_id locality_id On Feb 17, 7:04 pm, andrewharlan [EMAIL PROTECTED] wrote: hello, i understand Post hasone category and hasone locality. but can i set category to $belongsto Post and locality as $belongsto Post ?? --~--~-~--~~~---~--~~ 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: saveField issues
i agree. but whay is it generating WHERE `id` IN (21) instead of WHERE `id` = `21`? is it something to do with my model? there are some belongsTo and hasMany interactions. could that be messing with this if i have not set them up correctly? On Feb 20, 4:52 pm, Siebren Bakker [EMAIL PROTECTED] wrote: Not exactly sure about this, but shouldn't the SQL UPDATE statement be: UPDATE `lightboxes` SET `status` = 'saved' WHERE `id` = `21` instead of: UPDATE `lightboxes` SET `status` = 'saved' WHERE `id` IN (21) I'm not an SQL guru, so feel free to correct me if I'm wrong here. If that is the correct format though, according to the SQL dump, it should have updated the database correctly to set the 'status' field to be equal to 'saved' On Wed, Feb 20, 2008 at 11:53 AM, geordie [EMAIL PROTECTED] wrote: please help. probably a stupid error, but i'm having a hard time figuring out why my saveField() call does not stick. i'm relatively new to this so could be a newb problem. in lightboxes_controller i have the following lines of code... $this-Lightbox-id = $id; if($this-Lightbox-saveField('status', $status)) { $this-set('worked', worked); } else { $this-set('worked', did not work); } $this-set('data', $this-Lightbox-find( Lightbox.id = '$id')); the view just prints out $worked and $data to see what happened. from that output i would claim success. i get a worked and an array of data that shows the modified field. see here... worked Array ( [Lightbox] = Array ( [id] = 21 [user_id] = 1 [name] = 264201014 [date_saved] = 2008-02-20 [status] = saved ) [Customer] = Array ( [id] = 1 [first_name] = geordie [last_name] = speake [log_name] = gspeake [email] = [EMAIL PROTECTED] [phone] = 805xxx [pswd] = pass [is_admin] = 1 [is_customer] = 1 [is_photog] = 1 ) [LightboxImage] = Array ( [0] = Array ( [id] = 29 [image_id] = 123 [lightbox_id] = 21 [price_id] = 10 [quantity] = 1 ) ) ) i have DEBUG = 2 and i see the following... SELECT COUNT(id) AS count FROM `lightboxes` WHERE `id` = 21 SELECT COUNT(id) AS count FROM `lightboxes` WHERE `id` = 21 UPDATE `lightboxes` SET `status` = 'saved' WHERE `id` IN (21) SELECT `Lightbox`.`id`, `Lightbox`.`user_id`, `Lightbox`.`name`, `Lightbox`.`date_saved`, `Lightbox`.`status`, `Customer`.`id`, `Customer`.`first_name`, `Customer`.`last_name`, `Customer`.`log_name`, `Customer`.`email`, `Customer`.`phone`, `Customer`.`pswd`, `Customer`.`is_admin`, `Customer`.`is_customer`, `Customer`.`is_photog` FROM `lightboxes` AS `Lightbox` LEFT JOIN `users` AS `Customer` ON (`Lightbox`.`user_id` = `Customer`.`id`) WHERE `Lightbox`.`id` = '21' LIMIT 1 SELECT `LightboxImage`.`id`, `LightboxImage`.`image_id`, `LightboxImage`.`lightbox_id`, `LightboxImage`.`price_id`, `LightboxImage`.`quantity` FROM `lightbox_images` AS `LightboxImage` WHERE `LightboxImage`.`lightbox_id` IN (21) now for the problem... the table has been changed, but it now shows the field i was trying to change has been changed to the name of page's icon (sp2.ico). subsequent attempts to change the field give the same output in all responses, but i always get sp2.ico as the text in the field. what am i doing wrong? hope that wasn't too wordy. thought it better to include the code and outputs from the start before being asked. thanks. -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
hasAndBelongsToMany with additional join table columns?
Hello all, got a question that I haven't yet seen an answer to... I have a fairly standard many:many relationship, much like the classic Posts-Tags example. I have the standard join table, with an extra column, for example: posts (id, text) tags (id, name) posts_tags (post_id, tag_id, tag_link_id) So this is where it gets unorthodox. Using the standard hasAndBelongsToMany, when I'm iterating a list of posts I can easily enough get the tags. But does anyone have a suggestion for *also* getting the tag_link_id for the association? As an example, I'd like to take a Post, and iterate its array of Tags. For each Tag, I want to get Tag.name but also get the tag_link_id from the corresponding row in posts_tags. I suppose I could do a find in posts_tags using the post_id and tag_id, but that's an extra database query for data that I should already have. Any suggestions of a clever way to carry this associated data along? 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: Magic Squirrel reloaded
Thank you for spamming the CakePHP newsgroup. You have earned a special place in my heart. On Feb 20, 9:05 pm, deia [EMAIL PROTECTED] wrote: Here is the magic squirrel reloaded, she saves the forest from fire :0 http://www.mediaportal.ro/play.php?pid=12190SUPER%20COOL http://www.mediaportal.ro/play.php?pid=12419Ecureuil Enjoy it! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
newsletter / pictures
HI! I am looking for a good solution to an existing cakePHP 1.1 project. First, to integrate a newsletter, can you recommend existing components/plugins/projects? Second, to have images shown larger when the user sets the mouse over it (onmouseover). What are you experiences or proposed solutions for this? Thank you, I appreciate any help! Helmut --~--~-~--~~~---~--~~ 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: hasAndBelongsToMany with additional join table columns?
Try making PostTag a full model for posts_tags, and set hasMany/belongsTo instead of HABTM. On Thu, Feb 21, 2008 at 2:41 AM, mason [EMAIL PROTECTED] wrote: Hello all, got a question that I haven't yet seen an answer to... I have a fairly standard many:many relationship, much like the classic Posts-Tags example. I have the standard join table, with an extra column, for example: posts (id, text) tags (id, name) posts_tags (post_id, tag_id, tag_link_id) So this is where it gets unorthodox. Using the standard hasAndBelongsToMany, when I'm iterating a list of posts I can easily enough get the tags. But does anyone have a suggestion for *also* getting the tag_link_id for the association? As an example, I'd like to take a Post, and iterate its array of Tags. For each Tag, I want to get Tag.name but also get the tag_link_id from the corresponding row in posts_tags. I suppose I could do a find in posts_tags using the post_id and tag_id, but that's an extra database query for data that I should already have. Any suggestions of a clever way to carry this associated data along? 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: saveField issues
now for the problem... the table has been changed, but it now shows the field i was trying to change has been changed to the name of page's icon (sp2.ico). subsequent attempts to change the field give the same output in all responses, but i always get sp2.ico as the text in the field. what am i doing wrong? Where it is displayed like sp2.ico, as in your data dump it displays as saved? hope that wasn't too wordy. thought it better to include the code and outputs from the start before being asked. 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: Validation of one field for two different pages in cakephp.
Try searching the group, also the bakery. This has been answered before. On Thu, Feb 21, 2008 at 3:01 AM, bhushan A [EMAIL PROTECTED] wrote: Hi all, i have one field 'abc'(numeric) in 'xyz' table .i want to provide validation for two different logins.. i.e for users login, this field should not exceed '5' and for admin's login this should not exceed '1' . How to achieve this. Should i change Model or view.? Please help. Bhushan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
cakephp session+online payment
Hello, First i'd like to apologize for my english :) So, i got a website (with cakephp of course) using sessions to store some data like login, ... and a cart ! i m using an api for the payement (Mercanet) so i don't have to manage with secure payment etc. So i got my session with my cart, i choose then how i wish to pay (credit card), then it redirects me to the bank payment server, i put card number, date, etc validate and i got an autoresponse from the bank in which i can save data to database etc. so now if the buyer decide to leave his cart should be empty because he paid. but let's go back a little, i choose my card, then i am on the payment server and ho surprise ! i lost my session, and got a new one without my data. but when the payment is done and i click on back to shop i get my session back so when i want to delete my cart, i don't have cart infos in session. i hope you will understand what i wanted to explain :) and i hope someone will be able to help me, i m loosing my hairs ! :-) thx ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakephp session+online payment
You should treat session data as volatile, so therefore before sending to the payment gateway you should have the order in your database with all the information required, including an order id. Usually you send the order id along to the payment gateway as well, and they should send this order id back once the payment is finished, so you can match up the two. Cheers, Adam On Feb 21, 8:57 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, First i'd like to apologize for my english :) So, i got a website (with cakephp of course) using sessions to store some data like login, ... and a cart ! i m using an api for the payement (Mercanet) so i don't have to manage with secure payment etc. So i got my session with my cart, i choose then how i wish to pay (credit card), then it redirects me to the bank payment server, i put card number, date, etc validate and i got an autoresponse from the bank in which i can save data to database etc. so now if the buyer decide to leave his cart should be empty because he paid. but let's go back a little, i choose my card, then i am on the payment server and ho surprise ! i lost my session, and got a new one without my data. but when the payment is done and i click on back to shop i get my session back so when i want to delete my cart, i don't have cart infos in session. i hope you will understand what i wanted to explain :) and i hope someone will be able to help me, i m loosing my hairs ! :-) thx ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: hasAndBelongsToMany with additional join table columns?
Another solution might be (don't know how elegant this is) to add a finderQuery in your HABTM-relation. Just copy the present habtm-query (you'll see it with debug level 2, for example), modify it a bit and add it to your models habtm-statement. In your case the modification should be something like this: in the SELECT-section add posts_tags.tag_link_id AS Tag__tag_link_id and than modify the tag_id the JOIN's ON-section to be a magical {$__cakeID__$} and than your habtm-query should return the tag_link_id in the associated Tag- model. As I said, I don't know how elegant this approach is, but it worked for me :) On Feb 21, 6:41 am, mason [EMAIL PROTECTED] wrote: Hello all, got a question that I haven't yet seen an answer to... I have a fairly standard many:many relationship, much like the classic Posts-Tags example. I have the standard join table, with an extra column, for example: posts (id, text) tags (id, name) posts_tags (post_id, tag_id, tag_link_id) So this is where it gets unorthodox. Using the standard hasAndBelongsToMany, when I'm iterating a list of posts I can easily enough get the tags. But does anyone have a suggestion for *also* getting the tag_link_id for the association? As an example, I'd like to take a Post, and iterate its array of Tags. For each Tag, I want to get Tag.name but also get the tag_link_id from the corresponding row in posts_tags. I suppose I could do a find in posts_tags using the post_id and tag_id, but that's an extra database query for data that I should already have. Any suggestions of a clever way to carry this associated data along? 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: Version of cakephp
I'm now learning cakePHP. I had begun with the blog tutorial (good start point), then i had read the manual and now im developing a little application. I didn't knows about http://tempdocs.cakephp.org/ (i think it must be easiest to find). Even though i read the 1.1 manual, i'm using the 1.2 (with thtml). Miki --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
search between 2 tables
Hi, hou can i do search between 2 tables in cakephp, hou to write the query and join them --~--~-~--~~~---~--~~ 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: search between 2 tables
Put a function in your model and do a query();, see Model::query() in the api and manual. On Thu, Feb 21, 2008 at 10:20 AM, sou [EMAIL PROTECTED] wrote: Hi, hou can i do search between 2 tables in cakephp, hou to write the query and join them --~--~-~--~~~---~--~~ 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: Version of cakephp
Then you will love http://book.cakephp.org and http://bakery.cakephp.org On Thu, Feb 21, 2008 at 10:11 AM, Miki [EMAIL PROTECTED] wrote: I'm now learning cakePHP. I had begun with the blog tutorial (good start point), then i had read the manual and now im developing a little application. I didn't knows about http://tempdocs.cakephp.org/ (i think it must be easiest to find). Even though i read the 1.1 manual, i'm using the 1.2 (with thtml). Miki --~--~-~--~~~---~--~~ 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: User management, authentication and ACL plugin/component/helper
Hi, Cannot download the file on the website. :( On Feb 12, 4:14 pm, jakecake [EMAIL PROTECTED] wrote: Hi all, Here is the plugin to manage users/groups, registration, authentication,ACL, and the GUI to manage everything. http://conseil-recherche-innovation.net/authake This is in development so becareful before using it. I made this in few days to learn Cake (by the way, thanks to Marco Sbragi, I used its tutorial to learn). There are maybe some coding style errors, and the stability depends of the cake version fetched from the SVN... So please, don't hesitate to give feedback, patches, ideas, etc. Here are some screenshots to give you a taste ;)http://conseil-recherche-innovation.net/download/authake/screenshots/ Read you, Jakecake --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ACL explained for 1.2?
Can anybody supply a URL to a tutorial for ACL in 1.2 that actually includes everything? I have looked at a few that seem to leave vital bits out. It's a difficult topic to get your head round. 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 -~--~~~~--~~--~--~---
php $_GET routing
Before I used CakePHP, I had a page written in simple PHP. It had urls like this - mypage.com/?article=3. But now my page kas urls like this - mypage.com/article/view/3. A lot of refferring sites has the old url, but I don't want to loose my clients. How do I handle it? I tried to set the routing like this: Router::connect('/?articleid=*', array('controller' = 'articles', 'action' = 'view')); But it didn't work, cakephp says, that no controller was found. --~--~-~--~~~---~--~~ 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: php $_GET routing
It doesn't work. I even tried to place this line in all .htaccess files, but the result is the same. On Feb 21, 3:17 pm, Walker Hamilton [EMAIL PROTECTED] wrote: Use rewrite rules in htaccess instead. RewriteRule ^index.php?articleid=([0-9]+)$ /articles/view/$1 [R=301] --~--~-~--~~~---~--~~ 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: saveField issues
On Thu, Feb 21, 2008 at 2:21 AM, geordie [EMAIL PROTECTED] wrote: i agree. but whay is it generating WHERE `id` IN (21) instead of WHERE `id` = `21`? is it something to do with my model? there are some belongsTo and hasMany interactions. could that be messing with this if i have not set them up correctly? Maybe, just maybe, here is a possible explanation 1) CakePHP needs to be able to do UPDATE statements involving one or more conditions 2) Why write code for doing an update with one condition and another for multiple conditions? The only thing that matters here is this: Is it correctly updating the record? Seriously, that's the only thing that matters. Yes, I agree that 'WHERE id IN (21)' is not your typical condition for an UPDATE statement. If you disagree with this decision, then by all means file a ticket over at trac.cakephp.org about it. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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?hl=en -~--~~~~--~~--~--~---
Re: cakephp session+online payment
Thx for your answer :) i manage to transfer the session ID so i can then get infos back from the database. but the sessions infos are serialized. how can i merge infos into the new session? when i unserialize, i got nothing :s On 21 fév, 12:31, Adam Royle [EMAIL PROTECTED] wrote: You should treat session data as volatile, so therefore before sending to the payment gateway you should have the order in your database with all the information required, including an order id. Usually you send the order id along to the payment gateway as well, and they should send this order id back once the payment is finished, so you can match up the two. Cheers, Adam On Feb 21, 8:57 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, First i'd like to apologize for my english :) So, i got a website (with cakephp of course) using sessions to store some data like login, ... and a cart ! i m using an api for the payement (Mercanet) so i don't have to manage with secure payment etc. So i got my session with my cart, i choose then how i wish to pay (credit card), then it redirects me to the bank payment server, i put card number, date, etc validate and i got an autoresponse from the bank in which i can save data to database etc. so now if the buyer decide to leave his cart should be empty because he paid. but let's go back a little, i choose my card, then i am on the payment server and ho surprise ! i lost my session, and got a new one without my data. but when the payment is done and i click on back to shop i get my session back so when i want to delete my cart, i don't have cart infos in session. i hope you will understand what i wanted to explain :) and i hope someone will be able to help me, i m loosing my hairs ! :-) thx ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL explained for 1.2?
This work great: http://lemoncake.wordpress.com/2007/07/19/using-authcomponent-and-acl-in-cakephp-12/ But, before make sure you have Auth working without ACL and are comfortable with it. On Thu, Feb 21, 2008 at 11:00 AM, leo [EMAIL PROTECTED] wrote: Can anybody supply a URL to a tutorial for ACL in 1.2 that actually includes everything? I have looked at a few that seem to leave vital bits out. It's a difficult topic to get your head round. 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: How to correctly use l10n and i18n in Cake 1.2?
The data is dynamic, it is stored in the DB. Loosely speaking, I have data like in English: id: 1 desc: male id: 2 desc: female in German id: 1 desc: männlich id: 2 desc: weiblich When somebody choose a gender (or a country or some other data) the ID will be stored as a foreign key. Now...I could, of course, store the English string in the DB and pull them via __() when German or some other language is required. However, in that case, I'd have to recreate a data array as one string at a time is returned by __(). Doesn't seem like an elegant solution to me. I'm just curious if this problem is supposed to be solved via the i18n table as proposed in Cake 1.2. At this point, I just don't know how to use the proposed table structure as found in app/config/sql/i18n.sql. In other posts, I have read that other tables in the form model_i18n need to be generated. I just have not found a step by step example of how to use i18n. Does anybody know? Thx again. --~--~-~--~~~---~--~~ 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: saveField issues
i agree. but whay is it generating WHERE `id` IN (21) instead of WHERE `id` = `21`? is it something to do with my model? there are some belongsTo and hasMany interactions. could that be messing with this if i have not set them up correctly? Backticks are used for quoting field and table names (and aliases), not values. Still, the difference between WHERE `id`=21 and WHERE `id` IN(21) is zilch - the database optimizer will sort this out on its first pass. This is not your problem. the table has been changed, but it now shows the field i was trying to change has been changed to the name of page's icon (sp2.ico). subsequent attempts to change the field give the same output in all responses, but i always get sp2.ico as the text in the field. What's you view code? That's probably where the issue is - since your dump shows the correct value. On Feb 21, 2:14 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On Thu, Feb 21, 2008 at 2:21 AM, geordie [EMAIL PROTECTED] wrote: i agree. but whay is it generating WHERE `id` IN (21) instead of WHERE `id` = `21`? is it something to do with my model? there are some belongsTo and hasMany interactions. could that be messing with this if i have not set them up correctly? Maybe, just maybe, here is a possible explanation 1) CakePHP needs to be able to do UPDATE statements involving one or more conditions 2) Why write code for doing an update with one condition and another for multiple conditions? The only thing that matters here is this: Is it correctly updating the record? Seriously, that's the only thing that matters. Yes, I agree that 'WHERE id IN (21)' is not your typical condition for an UPDATE statement. If you disagree with this decision, then by all means file a ticket over at trac.cakephp.org about it. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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?hl=en -~--~~~~--~~--~--~---
How to add table prefix to HABTM finderQuery param
I need to add the table prefix to the finderQuery param in the HABTM declaration, the problem is that I don't know this table prefix beacuse the user can modify it and can't add a 'SELECT * FROM '.$this- tablePrefix.'table', for example, in the declaration. I have added it to the model constructor (__construc()) with bindModel() and works but, is there a better way? 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 -~--~~~~--~~--~--~---
Model related as condition of paginate
Hi! I have two models:(Client,purchase) One client has many purchases. In clients_controller: If I want to paginate all clients with name John I do: $this-paginate(array('Client.name' = 'John')) But how can I paginate all clients who have bought a certain product (for example, condition: purchase.name='car')? Thanks and 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: requirePost() in Security Component, what about PUT method?
Forget it, I've found the solution http://book.cakephp.org/nl/view/183/creating-forms :) On 21 feb, 12:07, Andrés Otárola [EMAIL PROTECTED] wrote: I want to check that a form was sent using a post request, using Security component requirePost() as usual, works for a normal POST request, but when I'm sending an edit form, there is a hiden field called _method, and it's value is PUT, the problem here is that it isn't recognized as a valid POST request, so it is blackholed. is this a bug of Security Component? or Am I using it the wrong way? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
requirePost() in Security Component, what about PUT method?
I want to check that a form was sent using a post request, using Security component requirePost() as usual, works for a normal POST request, but when I'm sending an edit form, there is a hiden field called _method, and it's value is PUT, the problem here is that it isn't recognized as a valid POST request, so it is blackholed. is this a bug of Security Component? or Am I using it the wrong way? --~--~-~--~~~---~--~~ 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: Model related as condition of paginate
On Thu, Feb 21, 2008 at 9:54 AM, dandreta [EMAIL PROTECTED] wrote: Hi! I have two models:(Client,purchase) One client has many purchases. In clients_controller: If I want to paginate all clients with name John I do: $this-paginate(array('Client.name' = 'John')) But how can I paginate all clients who have bought a certain product (for example, condition: purchase.name='car')? You need create paginate() and paginateCount() methods in your model to override the default ones.. I talked about this on the mailing list earlier this week, so search the google group. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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?hl=en -~--~~~~--~~--~--~---
Re: all fields valid but cannot save
I found out that for empty integer fields (that are optional of course) Cake tries to save an empty string instead of NULL. I have to handle this in Model::beforeSave() like: if ($this-data[$this-name]['number'] === '') unset($this-data[$this- name]['number']); And so the empty string becomes NULL in the SQL statement. On febr. 20, 16:06, Chris Hartjes [EMAIL PROTECTED] wrote: On Feb 20, 2008 9:31 AM, Károly Kiripolszky [EMAIL PROTECTED] wrote: Dear Cake People, I cannot debug one of my models. Model::save() always returns False, although when I print out $this-data all fields are set properly and Model::invalidFields() returns an empty array too. I'm using the latest Cake from the repo, I use no validation rules or behaviours. I don't get why the data cannot be saved. Is there a way to get the query string generated by Cake for insertion? Try pasting your code tohttp://bin.cakephp.orgso that people can see what you're trying to do. Is it only the one model that is causing a problem? -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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?hl=en -~--~~~~--~~--~--~---
Re: ACL explained for 1.2?
For starters, you need to get familiar with the Cake console ACL manager. That Lemoncake tutorial is good, but some of the stuff is a little out-of-date. There is NOT an all-inclusive page that includes everything. Here are some tips I can put in, having gone through this learning curve in January. The key for me was to install the ACL database tables and then start playing with the ACL Console manager and just looking at what happened in the database tables as I made modifications to the setup. Also, realize that if you are running Auth in 'actions' mode, the _create, _edit, _update, _delete columns in the acos_aros table need to always be set to 1 (happens automatically), because the permissions are going to be based on matching aliases and not based on crud mapping. If you use Auth in 'crud' mode, then those columns will be used and aco aliases will be less important --- I found 'actions' mode to be more flexible, and so am using that. Whenever I do a grant command, I have to add the * at the end to ensure that all four columns are set to 1. Be aware that if you are using the AclBehavior to automate things, you are going to have to create a custom function in your model to create the alias field in the aco or aro table. The AclBehavior does NOT touch help with the alias field. However, the alias field is very important, because it is what the Auth and Acl components use to determine permission. Also, in the time since some of the tutorials were written, there have been improvements made in the managing of elements in the tree. You can now more easily change the parent of an item and have it automatically moved to the correct position on the tree. As it is written, you cannot use an Aco ( in 'actions' mode ) with the alias Users/edit/53 in which 53 is the user's id, because Auth does not recognize the ID in it's action function. You will have to create a modified Auth::action() function, if you would like to use aliass such as Users/edit/53. With time you will start to get the hang of it, but be assured that it actually does work as advertised. On Feb 21, 5:54 am, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: This work great: http://lemoncake.wordpress.com/2007/07/19/using-authcomponent-and-acl... But, before make sure you have Auth working without ACL and are comfortable with it. On Thu, Feb 21, 2008 at 11:00 AM, leo [EMAIL PROTECTED] wrote: Can anybody supply a URL to a tutorial for ACL in 1.2 that actually includes everything? I have looked at a few that seem to leave vital bits out. It's a difficult topic to get your head round. 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: Site home page question
I usaully have a a different layout for my home page which consists of various elements and the elements call requestAction As Sam said, there's some docs out there about that and problems with efficiency. However, CakePHP has some beautiful caching which makes this livable On Thu, Feb 21, 2008 at 10:46 AM, jim starboard [EMAIL PROTECTED] wrote: Sorry about getting off on the wrong foot. I think my main question is: Should I create a controller for my homepage? My homepage is not really specific to a single model, so it would not be named as such. So is it OK to have something like HomeController, with an index method? In general do you create controllers that only have an index method? All the tutorials have very tight relationships between a single table, controller, view and model, I wish there were more examples of multiple models being used, as well as controllers that were not tied to as single model/table. On Feb 20, 4:36 pm, DJ Spark [EMAIL PROTECTED] wrote: Your controller will get all the info you need from models, and using $this-set('varname', $yourinfo) will make it available for the view, where you make a loop (prabably) and show your information The basic blog example inhttp://manual.cakephp.orgwill show it in a very easy way. just try it. Spark On Wed, Feb 20, 2008 at 5:43 PM, jim starboard [EMAIL PROTECTED] wrote: I'm trying to get a high-level understanding of how you would handle a site's homepage. Lets say it's a gaming site. Some of the items on the homepage would be: -userlog in -- would show logged in state, if the user was logged in. -highscores -- would show high scores in different games - featured game -- admin tools select which game is featured. I understand the basic MVC idea, and I can create models and controllers for each of my *single* items, like user, game, etc. Where I get confused is how I combine information in a view. Is the homepage a single view or multiple views combined? Do I need a controller for a page like index? Basically looking for any help here, with a high level explanation. TIA Jim -- [livesets]http://djspark.com.br/ [web]http://sydi.net [filmes]http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with import in test fixtures?
Hi. Same problem here and can't figure out why that is. Did you manage to solve it? Farez On Feb 1, 5:30 am, Micro [EMAIL PROTECTED] wrote: Hey, i got the same problem too. I am stillnotable to import my fixtures. My cakephp version is: 1.2.0.6311 beta, and my simpletest version is : 1.0.1beta2 This is my model: ?php class Stock extends AppModel { var $name = 'Stock'; var $useTable = 'stocks'; var $primaryKey = 'SYMBOL'; var $validate = array( ); ? ?php App::import('Model', 'Stock'); class StockTest extends Stock{ var $name = 'StockTest'; var $useDbConfig = 'test_suite'; var $cacheSources = false; // var $useTable = null; // var $tablePrefix = null; } class StockTestCase extends CakeTestCase { var $fixtures = array('stock_test'); function testCreateRecords() { $this-TestObject = new StockTest(); $result = $this-TestObject-findCount(); $expected = count($this-records); $this-assertEqual($result, $expected); } } ? My fixture: ?php class StockTestFixture extends CakeTestFixture { var $name = 'StockTest'; var $import = 'Stock'; var $records = array( ... ); } ? The error that i got is: Error: Database table test_suite_stocks for model Stock wasnotfound. I just don't get it. I can make myunittesting working without the fixture. But, it will go to my real table instead of thetestsuit table. Please help. I have been trying to do this for couple days now. On Jan 8, 4:35 pm, Robby Anderson [EMAIL PROTECTED] wrote: Woo hoo! Got it to work. For anyone interested, I believe it had to do with the customtablein my Model declaration (var $useTable). To solve my issue, I added two lines to myTestModel declaration: class UserTest extends User { var $name = 'UserTest'; var $useDbConfig = 'test_suite'; var $cacheSources = false; var $useTable = null; var $tablePrefix = null; } The last two lines - setting useTable and tablePrefix to null - solved my issue, and now myteststructure/data is importing perfectly! Me = :) On Jan 8, 3:55 pm, Gwoo [EMAIL PROTECTED] wrote: Robby, Come to IRC, its much more fun than having to send 4 messages in 2hrs with no response. #cakephp, irc.freenode.net Th anks, Gwoo - I'll do that. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Error with Microsoft SQL Serveur
Hello everybody, I developed an application on my mac with a mysql database. On my production server i have a microsoft sql serveur (it's a project for my school). My application work well with mysql but i have a problem with the microsoft mysql serveur. There is the error: Query: SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES Warning (512): SQL Error: Le contexte de la base de données a été changé en 'FP7'. [CORE\cake\libs\model\datasources\dbo_source.php, line 440] If anybody can help me, i have to use this server... Thanks a lot for your response. PS: Excuse me for my english, i'm french. --~--~-~--~~~---~--~~ 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: all fields valid but cannot save
I think in cases like this an optional numeric field containing an empty string should be marked as an invalid field so it would be easier to debug, or it should be typecasted or omitted... --~--~-~--~~~---~--~~ 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: Site home page question
Sorry about getting off on the wrong foot. I think my main question is: Should I create a controller for my homepage? My homepage is not really specific to a single model, so it would not be named as such. So is it OK to have something like HomeController, with an index method? In general do you create controllers that only have an index method? All the tutorials have very tight relationships between a single table, controller, view and model, I wish there were more examples of multiple models being used, as well as controllers that were not tied to as single model/table. On Feb 20, 4:36 pm, DJ Spark [EMAIL PROTECTED] wrote: Your controller will get all the info you need from models, and using $this-set('varname', $yourinfo) will make it available for the view, where you make a loop (prabably) and show your information The basic blog example inhttp://manual.cakephp.orgwill show it in a very easy way. just try it. Spark On Wed, Feb 20, 2008 at 5:43 PM, jim starboard [EMAIL PROTECTED] wrote: I'm trying to get a high-level understanding of how you would handle a site's homepage. Lets say it's a gaming site. Some of the items on the homepage would be: -userlog in -- would show logged in state, if the user was logged in. -highscores -- would show high scores in different games - featured game -- admin tools select which game is featured. I understand the basic MVC idea, and I can create models and controllers for each of my *single* items, like user, game, etc. Where I get confused is how I combine information in a view. Is the homepage a single view or multiple views combined? Do I need a controller for a page like index? Basically looking for any help here, with a high level explanation. TIA Jim -- [livesets]http://djspark.com.br/ [web]http://sydi.net [filmes]http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Site home page question
On Thu, Feb 21, 2008 at 12:28 PM, jim starboard [EMAIL PROTECTED] wrote: OK, so what's the entry point for your homepage? A controller with an index method? Or a view? In your case, /home_page/index you'd have your HomePage controller and an index view for that. Yes, you can create controllers that are not associated with a model or even grab data from multiple models for use in a view. Crazy stuff, I know. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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?hl=en -~--~~~~--~~--~--~---
Re: hasAndBelongsToMany with additional join table columns?
Yeah, I thought about doing that. Would I need to add an id column to that table then, I suppose? On Feb 21, 2:35 am, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Try making PostTag a full model for posts_tags, and set hasMany/belongsTo instead of HABTM. On Thu, Feb 21, 2008 at 2:41 AM, mason [EMAIL PROTECTED] wrote: Hello all, got a question that I haven't yet seen an answer to... I have a fairly standard many:many relationship, much like the classic Posts-Tags example. I have the standard join table, with an extra column, for example: posts (id, text) tags (id, name) posts_tags (post_id, tag_id, tag_link_id) So this is where it gets unorthodox. Using the standard hasAndBelongsToMany, when I'm iterating a list of posts I can easily enough get the tags. But does anyone have a suggestion for *also* getting the tag_link_id for the association? As an example, I'd like to take a Post, and iterate its array of Tags. For each Tag, I want to get Tag.name but also get the tag_link_id from the corresponding row in posts_tags. I suppose I could do a find in posts_tags using the post_id and tag_id, but that's an extra database query for data that I should already have. Any suggestions of a clever way to carry this associated data along? 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: saveField issues
the next time i get all fields from table, sp2.ico will be returned. confusing because immediately after saving the record, i do a findAll() and get the expected value saved. (unfortunately the value i am trying to save is the string saved so it is easy to get confused). when i come back though a second time, or list with another action in the controller, i get sp2.ico. and i can use other tools to look at the DB and see that it really is sp2.ico in the field. thanks all. On Feb 21, 2:33 am, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: now for the problem... the table has been changed, but it now shows the field i was trying to change has been changed to the name of page's icon (sp2.ico). subsequent attempts to change the field give the same output in all responses, but i always get sp2.ico as the text in the field. what am i doing wrong? Where it is displayed like sp2.ico, as in your data dump it displays as saved? hope that wasn't too wordy. thought it better to include the code and outputs from the start before being asked. 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 -~--~~~~--~~--~--~---
hasAndBelongsToMany with additional column in join table?
I have a question for HABTM experts out there. I've got a pretty standard many:many relationship through a join table, except that I have an additional column in the join table which I need access to. Use this as an example: Tables: post (id, text) tag (id, name) posts_tags (post_id, tag_id, metadata) So I've got a normal join between posts and tags, and I can easily enough get a post and its associated tags. What I want to do, though, is get a post, iterate its tags, and for each tag get both the tag name and the metadata for its association with the post. I could do an additional query to get the posts_tags row based on the post_id and tag_id, but that's one more query and it shouldn't be necessary, since of course Cake is already getting the join. Anyone have a clever way of getting at the metadata from the join table? Thanks very much. --~--~-~--~~~---~--~~ 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: Site home page question
OK, so what's the entry point for your homepage? A controller with an index method? Or a view? On Feb 21, 12:02 pm, Baz [EMAIL PROTECTED] wrote: I usaully have a a different layout for my home page which consists of various elements and the elements call requestAction As Sam said, there's some docs out there about that and problems with efficiency. However, CakePHP has some beautiful caching which makes this livable On Thu, Feb 21, 2008 at 10:46 AM, jim starboard [EMAIL PROTECTED] wrote: Sorry about getting off on the wrong foot. I think my main question is: Should I create a controller for my homepage? My homepage is not really specific to a single model, so it would not be named as such. So is it OK to have something like HomeController, with an index method? In general do you create controllers that only have an index method? All the tutorials have very tight relationships between a single table, controller, view and model, I wish there were more examples of multiple models being used, as well as controllers that were not tied to as single model/table. On Feb 20, 4:36 pm, DJ Spark [EMAIL PROTECTED] wrote: Your controller will get all the info you need from models, and using $this-set('varname', $yourinfo) will make it available for the view, where you make a loop (prabably) and show your information The basic blog example inhttp://manual.cakephp.orgwillshow it in a very easy way. just try it. Spark On Wed, Feb 20, 2008 at 5:43 PM, jim starboard [EMAIL PROTECTED] wrote: I'm trying to get a high-level understanding of how you would handle a site's homepage. Lets say it's a gaming site. Some of the items on the homepage would be: -userlog in -- would show logged in state, if the user was logged in. -highscores -- would show high scores in different games - featured game -- admin tools select which game is featured. I understand the basic MVC idea, and I can create models and controllers for each of my *single* items, like user, game, etc. Where I get confused is how I combine information in a view. Is the homepage a single view or multiple views combined? Do I need a controller for a page like index? Basically looking for any help here, with a high level explanation. TIA Jim -- [livesets]http://djspark.com.br/ [web]http://sydi.net [filmes]http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple 1.2 Ajax Form?
When I try this I get: Call to undefined method RequestHandlerComponent::setAjax() On Feb 20, 6:10 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On Wed, Feb 20, 2008 at 7:57 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Can someone post all the MVC files for a simple form submit with Ajax? For example a form with name and a radio button to un/subscribe to a mailing list (controller sends and email and sets a msg with setFlash)? --~--~-~--~~~---~--~~ http://cakebaker.wordpress.com/2006/01/18/submit-a-form-with-ajax/ -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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?hl=en -~--~~~~--~~--~--~---
Re: Cake 1.2 - Space in field name
On Wed, Feb 20, 2008 at 4:57 AM, phantz [EMAIL PROTECTED] wrote: Hey, I understand that you shouldn't use spaces in field names when using cake. But the problem is that I have been given a huge amount of data that is filled with field names containing spaces. I can't remove these spaces and I can't alter the structure of the db at all. Is there a way to use cake with field names that have spaces? Basically any query with spaces end up with the ` in the wrong place. For example this is from an association generated query: .. LEFT JOIN `new vehicles` AS `NewVehicles` ON (`VehiclesTrims`.`Vehicle` ID = `NewVehicles`.`Vehicle` ID) .. Should be: .. LEFT JOIN `new vehicles` AS `NewVehicles` ON (`VehiclesTrims`.`Vehicle ID` = `NewVehicles`.`Vehicle ID`) .. Basically it puts the second ` in between the words instead of at the end of the field name. `Vehicle` ID as apposed to `Vehicle ID` Database column names should never have spaces. Is this an MSAcces file? Is there some existing application that will be sharing the data with Cake? If the data will be fetched by Cake from a different store (say, copied from Access to MySQL) you could translate the column names on the fly whenever you dump data from one to the other. But, if both applications will be fetching from the same DB this will be a problem (and, if it is MSAccess that your web app uses you have other problems to begin with). --~--~-~--~~~---~--~~ 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: saveAll() Problems
it might also help to show us the way you have the models associated. Have you looked at the book section on associations and saving data? http://book.cakephp.org/view/66/models#associations-78 Sam D On Thu, Feb 21, 2008 at 5:41 AM, Doug @ Straw Dogs [EMAIL PROTECTED] wrote: I've been banging my head against a wall trying to get $this-Model- saveAll() working. I'm hoping someone has the answers. I've tried formating the data in the following ways: Array ( [Customer] = Array ( [site_url] = Array ( [0] = http://www.barclays.co.uk/mortgages/ [1] = http://www.fool.co.uk/mortgages/compare-mortgages.aspx [2] = http://www.tdcanadatrust.com/mortgages/index.jsp ) ) ) Array ( [Customer] = Array ( [0] = Array ( [site_url] = http://www.barclays.co.uk/mortgages/ ) [1] = Array ( [site_url] = http://www.fool.co.uk/mortgages/compare-mortgages.aspx ) [2] = Array ( [site_url] = http://www.tdcanadatrust.com/mortgages/index.jsp ) ) ) Neithewr of these array structures works. Am I missing something? The relevant part of the controller is here: $this-Customer-create(); $this-Customer-saveAll($this-data); -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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: hasAndBelongsToMany with additional column in join table?
You can do it in current versions of 1.2 by using a 'with' attribute in your models it works for me and I gathered the information I needed mostly from this thread http://groups.google.com/group/cake-php/browse_frm/thread/419c4485a99e44eb Sam D On Thu, Feb 21, 2008 at 10:40 AM, mason [EMAIL PROTECTED] wrote: I have a question for HABTM experts out there. I've got a pretty standard many:many relationship through a join table, except that I have an additional column in the join table which I need access to. Use this as an example: Tables: post (id, text) tag (id, name) posts_tags (post_id, tag_id, metadata) So I've got a normal join between posts and tags, and I can easily enough get a post and its associated tags. What I want to do, though, is get a post, iterate its tags, and for each tag get both the tag name and the metadata for its association with the post. I could do an additional query to get the posts_tags row based on the post_id and tag_id, but that's one more query and it shouldn't be necessary, since of course Cake is already getting the join. Anyone have a clever way of getting at the metadata from the join table? Thanks very much. -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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: model methods as they relate to business logic
bump... anyone? thx On Feb 19, 4:51 pm, vendejp [EMAIL PROTECTED] wrote: Im used to thinking of model objects like business objects, so if I perform some work on an object, I want to put the method in the biz object... as an example when I have a model with 2 fields: fname and lname. Rather than always doing a check of something like this in the controller (possibly lots of places): $user = $this-User-read(null, 1); if(trim($user['User']['fname'])=='' || trim($user['User'] ['lname'])=='')){ // do something } I would prefer to do this so that if I need to change the logic I do it in one place: if($this-User-isValid(1)){ // do something } The model would have something like: function isValid($id=null){ $this-id = $id; $user = $this-User-read(); if(trim($user['User']['fname'])=='' || trim($user['User'] ['lname'])=='')){ return false; } return true; } Maybe I loop through the results of a find() and I want to call this method over and over... I dont want it to do a $this-User-read() over and over. As a result, I could put this function in the model but just pass in the array representation of the object. I end up with something like this in the model: function isValid($user=null){ if(trim($user['User']['fname'])=='' || trim($user['User'] ['lname'])=='')){ return false; } return true; } What is the best practice for logic like this? That is, logic that shouldnt go into a component because it is specific to a model? 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: Site home page question
Hi Jim To me, the simplest method would be to use the built-in PagesController. you only need to create (or change the default) /app/view/pages/home.ctp and use the router to make it your root index (just like it actually is in a fresh CakePHP install: see /app/config/router.php) Then in this view (home.ctp), use renderElement and requestAction to display your elements: in general, I use renderElement for static or global bits of HTML (for example, the user login form) and requestAction to display data from other Controllers / Models (for example, the highscore display, which would probably need a method in your scores controller, and a view) +++ clément On Thu, Feb 21, 2008 at 5:46 PM, jim starboard [EMAIL PROTECTED] wrote: Sorry about getting off on the wrong foot. I think my main question is: Should I create a controller for my homepage? My homepage is not really specific to a single model, so it would not be named as such. So is it OK to have something like HomeController, with an index method? In general do you create controllers that only have an index method? All the tutorials have very tight relationships between a single table, controller, view and model, I wish there were more examples of multiple models being used, as well as controllers that were not tied to as single model/table. On Feb 20, 4:36 pm, DJ Spark [EMAIL PROTECTED] wrote: Your controller will get all the info you need from models, and using $this-set('varname', $yourinfo) will make it available for the view, where you make a loop (prabably) and show your information The basic blog example inhttp://manual.cakephp.orgwill show it in a very easy way. just try it. Spark On Wed, Feb 20, 2008 at 5:43 PM, jim starboard [EMAIL PROTECTED] wrote: I'm trying to get a high-level understanding of how you would handle a site's homepage. Lets say it's a gaming site. Some of the items on the homepage would be: -userlog in -- would show logged in state, if the user was logged in. -highscores -- would show high scores in different games - featured game -- admin tools select which game is featured. I understand the basic MVC idea, and I can create models and controllers for each of my *single* items, like user, game, etc. Where I get confused is how I combine information in a view. Is the homepage a single view or multiple views combined? Do I need a controller for a page like index? Basically looking for any help here, with a high level explanation. TIA Jim -- [livesets]http://djspark.com.br/ [web]http://sydi.net [filmes]http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Catching database errors in Cake 1.1
Whenever a database query fails (as in syntax error, missing table, no connection etc) I would like the user to be redirected to an error page, rather than execution of the request just continuing with incomplete data which could cause more errors. How come this isn't the default behaviour of Cake? Anyway, it seems the way to do this is to implement the onError function in app_model.php - is this correct? Or is there some other way of catching this? First of all: I have tried this, but it doesn't get called when I get a database error of any kind... what am I missing? class AppModel extends Model { function onError() { $this-log($some_error_info); $this-redirect($some_error_url); } } Also: when exactly does it get called? Is this fully implemented in Cake 1.1? I'm not in a position where I can upgrade to 1.2 :( It seems somehow from the code it is supposed to get called doing the normal cake findAll, save etc and I need it to be called when query() fails as well. Hope someone can help. How do you guys handle when db queries fail? Simon --~--~-~--~~~---~--~~ 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: model methods as they relate to business logic
Don't bump, please. On Thu, Feb 21, 2008 at 4:22 PM, vendejp [EMAIL PROTECTED] wrote: bump... anyone? thx On Feb 19, 4:51 pm, vendejp [EMAIL PROTECTED] wrote: Im used to thinking of model objects like business objects, so if I perform some work on an object, I want to put the method in the biz object... as an example when I have a model with 2 fields: fname and lname. Rather than always doing a check of something like this in the controller (possibly lots of places): $user = $this-User-read(null, 1); if(trim($user['User']['fname'])=='' || trim($user['User'] ['lname'])=='')){ // do something } I would prefer to do this so that if I need to change the logic I do it in one place: if($this-User-isValid(1)){ // do something } The model would have something like: function isValid($id=null){ $this-id = $id; $user = $this-User-read(); if(trim($user['User']['fname'])=='' || trim($user['User'] ['lname'])=='')){ return false; } return true; } Maybe I loop through the results of a find() and I want to call this method over and over... I dont want it to do a $this-User-read() over and over. As a result, I could put this function in the model but just pass in the array representation of the object. I end up with something like this in the model: function isValid($user=null){ if(trim($user['User']['fname'])=='' || trim($user['User'] ['lname'])=='')){ return false; } return true; } What is the best practice for logic like this? That is, logic that shouldnt go into a component because it is specific to a model? 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: User management, authentication and ACL plugin/component/helper
I downloaded this package a while back; not using it not apt for my pursposes I can email it to you off list if you like. confusingly I have to authake-app.tar.gz authsample.zip On 21/02/2008, lucaspirola [EMAIL PROTECTED] wrote: i cannot too, any news?! if someone can send me, i host ! On 21 fev, 09:49, vince [EMAIL PROTECTED] wrote: Hi, Cannot download the file on the website. :( On Feb 12, 4:14 pm, jakecake [EMAIL PROTECTED] wrote: Hi all, Here is the plugin to manage users/groups, registration, authentication,ACL, and the GUI to manage everything. http://conseil-recherche-innovation.net/authake This is in development so becareful before using it. I made this in few days to learn Cake (by the way, thanks to Marco Sbragi, I used its tutorial to learn). There are maybe some coding style errors, and the stability depends of the cake version fetched from the SVN... So please, don't hesitate to give feedback, patches, ideas, etc. Here are some screenshots to give you a taste ;)http://conseil- recherche-innovation.net/download/authake/screenshots/ Read you, Jakecake --~--~-~--~~~---~--~~ 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: User management, authentication and ACL plugin/component/helper
i cannot too, any news?! if someone can send me, i host ! On 21 fev, 09:49, vince [EMAIL PROTECTED] wrote: Hi, Cannot download the file on the website. :( On Feb 12, 4:14 pm, jakecake [EMAIL PROTECTED] wrote: Hi all, Here is the plugin to manage users/groups, registration, authentication,ACL, and the GUI to manage everything. http://conseil-recherche-innovation.net/authake This is in development so becareful before using it. I made this in few days to learn Cake (by the way, thanks to Marco Sbragi, I used its tutorial to learn). There are maybe some coding style errors, and the stability depends of the cake version fetched from the SVN... So please, don't hesitate to give feedback, patches, ideas, etc. Here are some screenshots to give you a taste ;)http://conseil-recherche-innovation.net/download/authake/screenshots/ Read you, Jakecake --~--~-~--~~~---~--~~ 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 session+online payment
Seriously, don't transfer the session ID. It's just overcomplicating matters. Follow Adam's advice - it's also how I've just handled integration with the UK secure payments company Secure Hosting. Basically, this was my process: 1. Cart contents are stored in a session. 2. On checkout, I dump the relevant details into a form as hidden fields, then pass those through to the secure server (they take the payment details on their server, rather than it being handled on mine). I also store an Order containing the full details of the order, with the status flag Payment Pending. 3. The secure server takes the payment, and calls a controller action on my site with the Order ID and transaction status, so I can then update my database appropriately. 4. The customer is redirected to either a payment failed or payment success page depending on what happened. Steve On Feb 21, 1:49 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thx for your answer :) i manage to transfer the session ID so i can then get infos back from the database. but the sessions infos are serialized. how can i merge infos into the new session? when i unserialize, i got nothing :s On 21 fév, 12:31, Adam Royle [EMAIL PROTECTED] wrote: You should treat session data as volatile, so therefore before sending to the payment gateway you should have the order in your database with all the information required, including an order id. Usually you send the order id along to the payment gateway as well, and they should send this order id back once the payment is finished, so you can match up the two. Cheers, Adam On Feb 21, 8:57 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, First i'd like to apologize for my english :) So, i got a website (with cakephp of course) using sessions to store some data like login, ... and a cart ! i m using an api for the payement (Mercanet) so i don't have to manage with secure payment etc. So i got my session with my cart, i choose then how i wish to pay (credit card), then it redirects me to the bank payment server, i put card number, date, etc validate and i got an autoresponse from the bank in which i can save data to database etc. so now if the buyer decide to leave his cart should be empty because he paid. but let's go back a little, i choose my card, then i am on the payment server and ho surprise ! i lost my session, and got a new one without my data. but when the payment is done and i click on back to shop i get my session back so when i want to delete my cart, i don't have cart infos in session. i hope you will understand what i wanted to explain :) and i hope someone will be able to help me, i m loosing my hairs ! :-) thx ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Simple 1.2 Ajax Form?
Have you included the RequestHandler in the uses clause? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
screencasts are not working
Hello. I visited the Cakephp.org site to download cake and learn more about how to implement it. However, the screencasts (mainly the blog tutorial and the bakery) are not working. Are there any alternative links that I can use to view these? 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: screencasts are not working
The screen casts do work for me, they all seem to be quicktime do you have that installed? You could try looking at the source of the page and try directly loading the video source, like the blog tutorial is http://ia300240.us.archive.org/2/items/CakePHP_BlogTutorialJohn/BlogTutorial.mov tested on my mac Sam D On Thu, Feb 21, 2008 at 11:06 AM, swhit [EMAIL PROTECTED] wrote: Hello. I visited the Cakephp.org site to download cake and learn more about how to implement it. However, the screencasts (mainly the blog tutorial and the bakery) are not working. Are there any alternative links that I can use to view these? Thanks! -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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: Simple 1.2 Ajax Form?
Not in uses... var $components = array('Email', 'RequestHandler'); var $helpers = array('Ajax'); I tried adding to uses as this... var $uses = array('MailingList', 'RequestHandler'); 'MailingList' is my model. When I do this I get... Error: Database table request_handlers for model RequestHandler was not found. On Feb 21, 12:23 pm, Jan Boonen [EMAIL PROTECTED] wrote: Have you included the RequestHandler in the uses clause? --~--~-~--~~~---~--~~ 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: model methods as they relate to business logic
Hi Josh, I don't understand entirely, but I reckon the Model is the appropriate way to go. If you google for fat models / skinny controllers, I think it'll relieve any doubts you have about putting this kind of stuff in the modell :) --~--~-~--~~~---~--~~ 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: Site home page question
Most of this community is made up of intelligent, self-sufficient people who know how to phrase their questions in order to help others help them. ... I'm sure that'll give you plenty to go on, but if not, come back here and try a few specific follow-up questions, and someone here will point you in the right direction. Nate, that was brilliantly put. In the best DRY spirit, I think it should be copied and pasted into other threads as necessary :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Formatting Arrays
I retrieved an array from my database with FindAll() which looks like this: Array ( [0] = Array ( [Tag] = Array ( [tag_name] = Searchengines [tag_count] = 51 ) ) [1] = Array ( [Tag] = Array ( [tag_name] = Blogengines [tag_count] = 25 ) ) [2] = Array ( [Tag] = Array ( [tag_name] = Motweilers [tag_count] = 14 ) ) ... etc etc. But I want it to be formatted like this: Array ( [Searchengines] = 51 [Blogengines] = 25 [Motweilers] = 14 etc.etc. ) Can anyone help me? Thanx in advance, Ape --~--~-~--~~~---~--~~ 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: screencasts are not working
Hmm...that is strange. I can view just fine the link that you have posted below. However, if I go to the cakephp.org site I have no luck at all. I have tried this in Firefox (3) and in Safari as well. On a Mac running Leopard. But, I can view some of the other tutorials just fine (the first one listed on how to get cake setup on NX for example). Also, another note - when I view the link below I get no sound. Is there suppose to be sound? Thanks! - Scott On Feb 21, 3:40 pm, Samuel DeVore [EMAIL PROTECTED] wrote: The screen casts do work for me, they all seem to be quicktime do you have that installed? You could try looking at the source of the page and try directly loading the video source, like the blog tutorial ishttp://ia300240.us.archive.org/2/items/CakePHP_BlogTutorialJohn/BlogT... tested on my mac Sam D On Thu, Feb 21, 2008 at 11:06 AM, swhit [EMAIL PROTECTED] wrote: Hello. I visited the Cakephp.org site to download cake and learn more about how to implement it. However, the screencasts (mainly the blog tutorial and the bakery) are not working. Are there any alternative links that I can use to view these? Thanks! -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Path issue passing data to Flash movie
Hi all, I have multiple pages on a site I am developing that use a Flash gallery viewer application. The movie receives a parameter via FlashVars with the path to the specific gallery xml file listing all the images to load. However as soon as I navigate away from the home page the xml file fails to load. I am new to cake and have no idea what is causing the problem. You can compare these two pages which both use the same path, same xml file: http://www.globehomesandcondos.com/ http://www.globehomesandcondos.com/props/ Any help would be greatly appreciated. --~--~-~--~~~---~--~~ 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: Formatting Arrays
On Thu, Feb 21, 2008 at 5:15 PM, Ape [EMAIL PROTECTED] wrote: Can anyone help me? Thanx in advance, Ape Read up on how to use Set::extract -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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?hl=en -~--~~~~--~~--~--~---
RE: Formatting Arrays
Set::combine($data, '{n}.Tag.tag_name', '{n}.Tag.tag_count'); Ain't that just freaking sexy -MI --- CakeFest Hispano: December, 2008 - Buenos Aires, Argentina - http://es.cakefest.org Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Chris Hartjes Enviado el: Jueves, 21 de Febrero de 2008 07:28 p.m. Para: cake-php@googlegroups.com Asunto: Re: Formatting Arrays On Thu, Feb 21, 2008 at 5:15 PM, Ape [EMAIL PROTECTED] wrote: Can anyone help me? Thanx in advance, Ape Read up on how to use Set::extract --~--~-~--~~~---~--~~ 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: Formatting Arrays
On Thu, Feb 21, 2008 at 7:04 PM, Mariano Iglesias [EMAIL PROTECTED] wrote: Set::combine($data, '{n}.Tag.tag_name', '{n}.Tag.tag_count'); Ain't that just freaking sexy I keep forgetting about Set::combine()... Thanks Mariano. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @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?hl=en -~--~~~~--~~--~--~---
Re: Path issue passing data to Flash movie
Using Firebug I can see the problem. Your /props/ page can't see the viewer_small.swf file, because it's a relative path. Make sure it's an absolute path (/viewer_small.swf) and this should fix your problems. The reason why this happens is because Flash loads assets (swfs, images, etc) relative to the page it's embedded in, not relative to the embedded swf. Cheers, Adam On Feb 22, 9:04 am, koala kid [EMAIL PROTECTED] wrote: Hi all, I have multiple pages on a site I am developing that use a Flash gallery viewer application. The movie receives a parameter via FlashVars with the path to the specific gallery xml file listing all the images to load. However as soon as I navigate away from the home page the xml file fails to load. I am new to cake and have no idea what is causing the problem. You can compare these two pages which both use the same path, same xml file:http://www.globehomesandcondos.com/http://www.globehomesandcondos.com/props/ Any help would be greatly appreciated. --~--~-~--~~~---~--~~ 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: newsletter / pictures
Helmut, Last days ago I was trying to get some Newsletter proyect, and I cant find anything. So i´s my intention to start some personal approach. If you want, we can work together and maybe make the first Newsletter plugin for Cake. Email me for this matter. About the images issue, I reccomend you to use some js framework, like jQuery(jquery.com) It´s really use to do it with jQuery. Cheers, Martin B On Feb 21, 4:32 am, Helmut Leinfellner [EMAIL PROTECTED] wrote: HI! I am looking for a good solution to an existing cakePHP 1.1 project. First, to integrate a newsletter, can you recommend existing components/plugins/projects? Second, to have images shown larger when the user sets the mouse over it (onmouseover). What are you experiences or proposed solutions for this? Thank you, I appreciate any help! Helmut --~--~-~--~~~---~--~~ 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: checking session in views
Oops.. I read your question wrong. Cake uses the Session for other things besides your login data. For example flash messages are stored in the Session also. --~--~-~--~~~---~--~~ 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: checking session in views
There is a session helper for this exact purpose. if ($session-check('myvar')){ echo 'value found'; } or echo $session-read('myvar'); It might be autoloaded if you use the session component - can't remember. Cheers, Adam On Feb 22, 10:50 am, Raistlin Majere [EMAIL PROTECTED] wrote: I was not logged in, then I visited a page with if (empty($_SESSION)), but echo $_SESSION displayed Array in that page! If I am not logged in, why is there a $_SESSION in views? The manual is telling me how to check session in controller, before all actions in controller and before a single controller action, but I need to check session in views! How can I do that? (AppServ 2.5.9 Apache 2.2.4 PHP 5.2.3 MySQL 5.0.45 phpMyAdmin-2.10.2 CakePHP 1.1.19.6305) --~--~-~--~~~---~--~~ 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: Two things I have not seen support for in Cake (group by and inner join)
I've also had to do this before. I resort back to findAll for GROUP BY. I would just do a 1=1 GROUP BY Today i've run into a similar problem by having to use a HAVING and GROUP_CONCAT. It's much easier to use custom queries for this, as long as you clean your own data. I also wish to know how to do this without breaking cake conventions. On Feb 21, 7:51 pm, rtconner [EMAIL PROTECTED] wrote: I have no found a good way to do GROUP BY queries or INNER JOIN's in cake. Was wondering if any of you have come across these and how you handled them. I have not been able to do either of them in conjunction with the find() method in any normal way.Perhaps I am missing something? I'd love to find out if I am. Are these some sort of database specific constructs? With Group by, sometimes I can get away with appending $conditions[] = 'GROUP BY field'; annd the in addition to that, manually passing in the fields to find() and prepending DISTINCT to the id column. Inner Join I have seen zero support from in Cake. Any time I've wanted to Inner join I've had to write the query manually. You know, sometimes you just need to filter your queries based on two tables, not just your primary table. Any help on these issues would be greatly appreaciated. I know I am not the only one who has had trouble with them. --~--~-~--~~~---~--~~ 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: bake on linux error
Hi Dardo, I found in /cake/cake/console/libs/templates/skel/config/sql to create the tables. Thank you for your info. -- Juan Luis Baptiste On Tue, Feb 19, 2008 at 5:04 AM, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: mysql describe aros; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+-++ | id | int(10) | NO | PRI | NULL| auto_increment | | parent_id | int(10) | YES | | NULL|| | model | varchar(255) | YES | | NULL|| | foreign_key | int(10) | YES | | NULL|| | alias | varchar(255) | YES | | NULL|| | lft | int(10) | YES | | NULL|| | rght| int(10) | YES | | NULL|| +-+--+--+-+-++ 7 rows in set (0.00 sec) mysql describe acos; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+-++ | id | int(10) | NO | PRI | NULL| auto_increment | | parent_id | int(10) | YES | | NULL|| | model | varchar(255) | YES | | NULL|| | foreign_key | int(10) | YES | | NULL|| | alias | varchar(255) | YES | | NULL|| | lft | int(10) | YES | | NULL|| | rght| int(10) | YES | | NULL|| +-+--+--+-+-++ 7 rows in set (0.00 sec) mysql describe aros_acos; +-++--+-+-++ | Field | Type | Null | Key | Default | Extra | +-++--+-+-++ | id | int(10)| NO | PRI | NULL| auto_increment | | aro_id | int(10)| NO | MUL | || | aco_id | int(10)| NO | | || | _create | varchar(2) | NO | | 0 || | _read | varchar(2) | NO | | 0 || | _update | varchar(2) | NO | | 0 || | _delete | varchar(2) | NO | | 0 || +-++--+-+-++ 7 rows in set (0.01 sec) 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?hl=en -~--~~~~--~~--~--~---
Re: checking session in views
$_SESSION is a php construct. Cake can't do anything to stop you from using it. Not that you should use it. You should use the Session component whenever possible. But if it's not, I think you can get away with things like echo $_SESSION['User']['username'] if you've stored $this-Session-write('User.username', 'jimmy'); I haven't seen a better practice for these things yet. On Feb 21, 5:50 pm, Raistlin Majere [EMAIL PROTECTED] wrote: I was not logged in, then I visited a page with if (empty($_SESSION)), but echo $_SESSION displayed Array in that page! If I am not logged in, why is there a $_SESSION in views? The manual is telling me how to check session in controller, before all actions in controller and before a single controller action, but I need to check session in views! How can I do that? (AppServ 2.5.9 Apache 2.2.4 PHP 5.2.3 MySQL 5.0.45 phpMyAdmin-2.10.2 CakePHP 1.1.19.6305) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Two things I have not seen support for in Cake (group by and inner join)
I have no found a good way to do GROUP BY queries or INNER JOIN's in cake. Was wondering if any of you have come across these and how you handled them. I have not been able to do either of them in conjunction with the find() method in any normal way.Perhaps I am missing something? I'd love to find out if I am. Are these some sort of database specific constructs? With Group by, sometimes I can get away with appending $conditions[] = 'GROUP BY field'; annd the in addition to that, manually passing in the fields to find() and prepending DISTINCT to the id column. Inner Join I have seen zero support from in Cake. Any time I've wanted to Inner join I've had to write the query manually. You know, sometimes you just need to filter your queries based on two tables, not just your primary table. Any help on these issues would be greatly appreaciated. I know I am not the only one who has had trouble with them. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
checking session in views
I was not logged in, then I visited a page with if (empty($_SESSION)), but echo $_SESSION displayed Array in that page! If I am not logged in, why is there a $_SESSION in views? The manual is telling me how to check session in controller, before all actions in controller and before a single controller action, but I need to check session in views! How can I do that? (AppServ 2.5.9 Apache 2.2.4 PHP 5.2.3 MySQL 5.0.45 phpMyAdmin-2.10.2 CakePHP 1.1.19.6305) --~--~-~--~~~---~--~~ 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: screencasts are not working
On Thu, Feb 21, 2008 at 3:25 PM, swhit [EMAIL PROTECTED] wrote: Hmm...that is strange. I can view just fine the link that you have posted below. However, if I go to the cakephp.org site I have no luck at all. I have tried this in Firefox (3) and in Safari as well. On a Mac running Leopard. But, I can view some of the other tutorials just fine (the first one listed on how to get cake setup on NX for example). Also, another note - when I view the link below I get no sound. Is there suppose to be sound?] There was no sound for me on that one S D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Formatting Arrays
somebody please document that juicy piece of sexy in the 'book' On Thu, Feb 21, 2008 at 4:15 PM, Chris Hartjes [EMAIL PROTECTED] wrote: On Thu, Feb 21, 2008 at 7:04 PM, Mariano Iglesias [EMAIL PROTECTED] wrote: Set::combine($data, '{n}.Tag.tag_name', '{n}.Tag.tag_count'); Ain't that just freaking sexy I keep forgetting about Set::combine()... Thanks Mariano. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard: http://www.littlehart.net/atthekeyboard -- -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/ http://blog.samdevore.com/cakephp-pages/i-cant-bake/ --~--~-~--~~~---~--~~ 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 to correctly use l10n and i18n in Cake 1.2?
I'll be facing this same issue very soon. I've had a look at the I18N table structure and I'm also unsure how to proceed (or that it even suits my needs). One trick I was thinking about is something I've already done fr years building English/French sites. Where I have a lookup table with values for select lists, I have fields ID, name_en, and name_fr. With Cake, one can set the display field before doing a find('list'). Here's an example from my MembersController, where I want populate a select list with region names: $this-Member-Region-displayField = name_${lang}; $this-set('regions', $this-Member-Region-find('list')); Then $regions can be passed in the view to create your select list and will contain only the english region names. ($lang is gotten from the session but has a default to avoid problems). Now, how to deal with other content i haven't figured out yet. On Thu, Feb 21, 2008 at 9:16 AM, Werschinger [EMAIL PROTECTED] wrote: The data is dynamic, it is stored in the DB. Loosely speaking, I have data like in English: id: 1 desc: male id: 2 desc: female in German id: 1 desc: männlich id: 2 desc: weiblich When somebody choose a gender (or a country or some other data) the ID will be stored as a foreign key. Now...I could, of course, store the English string in the DB and pull them via __() when German or some other language is required. However, in that case, I'd have to recreate a data array as one string at a time is returned by __(). Doesn't seem like an elegant solution to me. I'm just curious if this problem is supposed to be solved via the i18n table as proposed in Cake 1.2. At this point, I just don't know how to use the proposed table structure as found in app/config/sql/i18n.sql. In other posts, I have read that other tables in the form model_i18n need to be generated. I just have not found a step by step example of how to use i18n. Does anybody know? Thx again. --~--~-~--~~~---~--~~ 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: Are reflexive relation impossible with CakePHP ?
How much RAM have you allocated to PHP? I have a feeling that Cake was looping infinitely. If PHP had enough RAM I think it's possible that the server would just keep going until Apache pooped out (as opposed to PHP terminating that process with a msg about running out of allocated memory). Just a guess. On Tue, Feb 19, 2008 at 6:41 AM, DJ Spark [EMAIL PROTECTED] wrote: I had the same issue, and was quite hard to spot. Bake always gave me a 'Parent' relationship name, and when I loaded anything related to that , apache crashed... no log, no debug could find it :) So, watch out, every relation made with parent_id should be double checked: var $hasMany = array( 'Parent' = array('className' = 'Person', 'foreignKey' = 'parent_id') ); Should be: var $hasMany = array( 'ParentPerson' = array('className' = 'Person', 'foreignKey' = 'parent_id') ); Spark On Feb 19, 2008 7:16 AM, zeugme [EMAIL PROTECTED] wrote: It solve the problem. Thanks a lot. CakePHP power !!! grigri wrote: Try changing the alias ($hasMany key): class Person extends AppModel { var $hasMany = array( 'SomeOtherAlias' = array('className' = 'Person', 'foreignKey' = 'parent_id') ); } On Feb 19, 9:37 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've implemented several reflexive relations and never had a problem, but then I always kept recursive down. I don't see any other possible cause. On Feb 19, 11:30 am, zeugme [EMAIL PROTECTED] wrote: Hi the list ! I have a serious issue, a crash, when I try to set up a zero or more relationship from Person to Person. My Person table has several column and one called parent_id designed to contain a Person identifier. I did try var $hasMany = array( 'Person' = array ( 'className' = 'Person', 'foreignKey' = 'parent_id', //'recursive' = '2') ); with or without * recursive * the corresponding belongsto I also try to change the design for a joint able and $hasAndBelongsToMany with or without recursive. = no way ! I always got a crash from Apache log ! child pid 383 exit signal Segmentation fault (11) Even without any data, I got a crash. I'm scaffolding, this may be important to know. I'm now totally lost. Could that be a bug in CakePHP ? Are reflexive relationship impossible/forbidden to define in a Model ? OK, I could hack that by making this relation on the fly, but I do want to set that statically in the model, the normal way ... so I can benefit all that Cake power : scaffolding, bake and quick DB mapping. Thanks for your ideas, help, ... -- [livesets] http://djspark.com.br/ [web] http://sydi.net [filmes] http://melhoresfilmes.com.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are reflexive relation impossible with CakePHP ?
On Wed, Feb 20, 2008 at 4:13 AM, manish [EMAIL PROTECTED] wrote: I have also been getting problems of associations not working for me sometimes, while some other times associations work perfectly. I have some questions regarding associations. I hope I am doing no wrong by continuing this thread and not starting a new one: 1. Is there no way at all to check why my associations are not working, because nothing is shown in debugging. If association is not working, it will simply be out of your SQL, giving no clue? I wish I knew that as well. 2. How important is the name of the key?As mentioned above by DJ Spark Can the name of keys be the reason my associations are not Working? Maybe, with a good chance of probably. 3. What is the logic behind naming the key? DJ Spark above mentioned that that key name should be ParentPerson rather than Parent. I did not understand the logic of naming here. Because Cake needs some way to keep them separate or the logic wouldn't work. ParentPerson is just an alias so that Person-Person associations can be dealt with internally. Parent is appended to the associated model name to make it obvious which model it's the parent of. Imagine that you were dealing with 4 models, 2 of which were reflexively-associated with the other 2. By using ParentModelName everything is crystal clear. --~--~-~--~~~---~--~~ 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 to use gettext to change language ??
UTF-8 and BIG-5 are not language-specific. They are for the character encoding (though BIG-5 is for Chinese characters, specifically). UTF-8 can be used for many languages. If you want to change this: meta http-equiv=Content-Type content=text/html; charset=BIG-5 to: meta http-equiv=Content-Type content=text/html; charset=UTF-8 / You can use: echo $html-charset('UTF-8'); (must have HTMLHelper loaded) On Tue, Feb 19, 2008 at 4:58 AM, ghostjackyo [EMAIL PROTECTED] wrote: Excuse me . I am test the php web to change language to UTF-8. But also I am looking in the web page. It's also show the BIG-5.(I am change the chinese) I want use i18n to do this change and i test the function gettext. PS: My English was not good. please apologize. --~--~-~--~~~---~--~~ 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 to use gettext to change language ??
Oh! Thanks. I will try to test. And I also write this under my html title : meta http-equiv=Content-Type content=text/html charset=UTF-8 I am puzzled why i use xgettext to make .po file and use msgfmt to make .mo file. But why i am write with UTF-8 . Then i open the web . It's show the BIG-5 when i want see the chinese(Traditional) . PS: I am living in Taiwan . Our webs always make with Chinese People so i need the chinese language . Because i will be chang Englist to Chinese . On 2月22日, 上午11時05分, b logica [EMAIL PROTECTED] wrote: UTF-8 and BIG-5 are not language-specific. They are for the character encoding (though BIG-5 is for Chinese characters, specifically). UTF-8 can be used for many languages. If you want to change this: meta http-equiv=Content-Type content=text/html; charset=BIG-5 to: meta http-equiv=Content-Type content=text/html; charset=UTF-8 / You can use: echo $html-charset('UTF-8'); (must have HTMLHelper loaded) On Tue, Feb 19, 2008 at 4:58 AM, ghostjackyo [EMAIL PROTECTED] wrote: Excuse me . I am test the php web to change language to UTF-8. But also I am looking in the web page. It's also show the BIG-5.(I am change the chinese) I want use i18n to do this change and i test the function gettext. PS: My English was not good. please apologize. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
define() and app_controller
I have a method that runs a bunch of define statements for localizations stored in a database. function loadAll($language = 'english',$group=null){ $localizations = $this-Localization-findAll(,array('name', $language)); foreach($localizations as $localization){ define({$localization['Localization'] ['name']},{$localization['Localization'][$language]}); } } I want this to run on every page that loads but I am having trouble with where to call the method from. Calling it from a page works like from index.ctp $this-requestAction('localizations/loadAll/japanese'). However, I don't want to do that on every page. I tried making an app_controller.php in the app folder and using the beforeRender function but that didn't work. I also tried the requestAction from the default layout and that also didn't work. Please tell me what the best practice is for doing 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?hl=en -~--~~~~--~~--~--~---
Checking for config.time in cake session
In session.php in functions __checkValid There is a check with the Config.time. if ($this-_userAgent == $this-read(Config.userAgent) $this- time = $this-read(Config.time)) { We have run into issues where sometimes users get logged out and found the session id string empty but also found that commenting the second part of the above helped Is there reason for that check against Config.time - is it a security check to prevent someone writing a script to access all the pages? Also is there any reason why the session id string becomes empty? thanks Krishnan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Applying CSS
Hi I am a newbie to Cake. I am developing an application in which I want to use the Zapatec Ajax Framework with Cake. What I want to know is how does one apply CSS classes to form elements created by Cake. For example, the syntax for creating an input box is: ?php echo $html-input('Post/title')? How does one apply a CSS class to this input box? Thanks Vinayak --~--~-~--~~~---~--~~ 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: Validation of one field for two different pages in cakephp.
please share the link if u have . thanks bhushan On Feb 21, 3:40 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: Try searching the group, also the bakery. This has been answered before. On Thu, Feb 21, 2008 at 3:01 AM, bhushan A [EMAIL PROTECTED] wrote: Hi all, i have one field 'abc'(numeric) in 'xyz' table .i want to provide validation for two different logins.. i.e for users login, this field should not exceed '5' and for admin's login this should not exceed '1' . How to achieve this. Should i change Model or view.? Please help. Bhushan --~--~-~--~~~---~--~~ 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: Applying CSS
You can paas the name of the class in the attributes array like ?php echo $html-input('Post/title' , array('class' = 'test'))? Here second argument is the array for HTML elements. You can pass your html attributes including class name through this array. On Feb 22, 7:15 am, vj [EMAIL PROTECTED] wrote: Hi I am a newbie to Cake. I am developing an application in which I want to use the Zapatec Ajax Framework with Cake. What I want to know is how does one apply CSS classes to form elements created by Cake. For example, the syntax for creating an input box is: ?php echo $html-input('Post/title')? How does one apply a CSS class to this input box? Thanks Vinayak --~--~-~--~~~---~--~~ 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: Auth Component - Should authError be displayed if session times out?
I've given upSessions expire and the redirect causes issues. I thought it was a bug, but it's not...Just an annoyance. I don't know what's wrong with going the cookie route. With all the redirects, I really don't see a way around it. On Thu, Feb 21, 2008 at 10:58 PM, EchoChargen [EMAIL PROTECTED] wrote: I'm having a hard go of it on this still. Has anyone else seen the behavior above? Francky - could you elaborate a little on your approach? Thanks, Jeremy On Feb 21, 12:30 am, francky06l [EMAIL PROTECTED] wrote: I have made it work, the only thing I had problem was the first time on the page but this can be fixed with Baz approach (Cookie). Baz if you pass twice in befoeFilter, you can detect it by setting a variable (maybe static) in beforeFiler ? On Feb 21, 5:32 am, EchoChargen [EMAIL PROTECTED] wrote: Another thing of note, is if I run through the steps: 1. login, get redirected to what I have in Auth-loginRedirect 2. let session expire 3. click a link to a protected action and get redirected to Auth-loginAction, and in my case above get a flash message with your session timed out. 4. At this point, if I sit on the login page and let the session timeout again, then submit the login format this point Auth-authError is getting set, I get redirected back to Auth-loginAction and the flash.message.auth displays the message I have configured for Auth-authError. This is repeatable for me. Is this behavior anyone else has seen? --~--~-~--~~~---~--~~ 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: Auth Component - Should authError be displayed if session times out?
I'm having a hard go of it on this still. Has anyone else seen the behavior above? Francky - could you elaborate a little on your approach? Thanks, Jeremy On Feb 21, 12:30 am, francky06l [EMAIL PROTECTED] wrote: I have made it work, the only thing I had problem was the first time on the page but this can be fixed with Baz approach (Cookie). Baz if you pass twice in befoeFilter, you can detect it by setting a variable (maybe static) in beforeFiler ? On Feb 21, 5:32 am, EchoChargen [EMAIL PROTECTED] wrote: Another thing of note, is if I run through the steps: 1. login, get redirected to what I have in Auth-loginRedirect 2. let session expire 3. click a link to a protected action and get redirected to Auth-loginAction, and in my case above get a flash message with your session timed out. 4. At this point, if I sit on the login page and let the session timeout again, then submit the login format this point Auth-authError is getting set, I get redirected back to Auth-loginAction and the flash.message.auth displays the message I have configured for Auth-authError. This is repeatable for me. Is this behavior anyone else has seen? --~--~-~--~~~---~--~~ 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: Are reflexive relation impossible with CakePHP ?
why not just use findAllThreaded() ? --~--~-~--~~~---~--~~ 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: User management, authentication and ACL plugin/component/helper
Thanks for the offer, but last night it came down I think it might have been a South Africa internet problem again. :( LOL Thanks for the offer once again. So back to the topic though, I spent last night reading about ACL and finally got the whole understanding. However I was playing around with ACL last night, especially in the cake console and I find that I wasn't really able to replicate the tutorials examples, unless I did it their specific way. aro - Root Users User::1 I'm going to install authcheck today... will keep updated. On Feb 21, 9:38 pm, Sam Sherlock [EMAIL PROTECTED] wrote: I downloaded this package a while back; not using it not apt for my pursposes I can email it to you off list if you like. confusingly I have to authake-app.tar.gz authsample.zip On 21/02/2008, lucaspirola [EMAIL PROTECTED] wrote: i cannot too, any news?! if someone can send me, i host ! On 21 fev, 09:49, vince [EMAIL PROTECTED] wrote: Hi, Cannot download the file on the website. :( On Feb 12, 4:14 pm, jakecake [EMAIL PROTECTED] wrote: Hi all, Here is the plugin to manage users/groups, registration, authentication,ACL, and the GUI to manage everything. http://conseil-recherche-innovation.net/authake This is in development so becareful before using it. I made this in few days to learn Cake (by the way, thanks to Marco Sbragi, I used its tutorial to learn). There are maybe some coding style errors, and the stability depends of the cake version fetched from the SVN... So please, don't hesitate to give feedback, patches, ideas, etc. Here are some screenshots to give you a taste ;)http://conseil- recherche-innovation.net/download/authake/screenshots/ Read you, Jakecake --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Working with INNER JOIN tables
How does CakePHP handle (or With CakePHP, how do you do...) INSERT, UPDATE, and DELETE across multiple tables with an INNER JOIN query? sorry - still very very new to CakePHP. Looking for books/tutorials in working with INNER JOIN table queries since my projects use those a TON. Thanks for any help/pointers! -taka --~--~-~--~~~---~--~~ 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: IBM Cooking Websites Fast Series Part 2 Problem
Thank you so much. It finally works. On Feb 20, 9:13 am, hugsnothugs [EMAIL PROTECTED] wrote: thanks pizaninja, I think I tripped over a solution as well -- updating to the nightly and using cake acl create aro 0 Users 0 six of one half-a-dozen of the other as my old man says. On Feb 20, 3:05 am, pizaninja [EMAIL PROTECTED] wrote: I've found the solution here :http://groups.google.com/group/tickets-cakephp/browse_thread/thread/1... On line 29 of dbo_source.php, add or change by : uses('set', 'string'); It works well for me. On 20 fév, 09:48, pizaninja [EMAIL PROTECTED] wrote: Hi, I've exactly the same problem. It must be a bug from cakephp... My version : cake_1.2.0.6311-beta On 17 fév, 03:01, wizardElite [EMAIL PROTECTED] wrote: In Part 2 of theIBMCakePHP series I'm having problems working with Access Control Lists. I've created theACLtables and I'm stuck at defining defining groups In my app directory the tutorial states within the terminal define your groups with the following code. phpacl.phpcreatearo 0 null Users phpacl.phpcreatearo 0 null Dealers When I do this I get the following response... Couldnotopen input file:acl.php After some research I tried this... ../cake/console/cakeaclcreatearo / Users I then receive the following message... Fatal error:Class'String'notfoundin /Users/wizardelite/Sites/ ibmcake/cake/libs/model/datasources/dbo_source.php on line1455 Can anyone help me with 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?hl=en -~--~~~~--~~--~--~---
validation issue
Hi all there is one variable set as follows define('abc', 0.05); in core.php. This value of abc is for users login. i want to make it 0.01 for admin login. how can i achieve this. Please help Bhushan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---