Re: controller name
I think your problem can be solved by editting inflections.php, which is located in app/config directory. To be more precisely, add niche - niches to your $irregularPlural array like this: $irregularPlural = array('niche' => 'niches'); It would work seamlessly then. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: controller name
Hello Andras, Try to declare $uses variable inside your controller somewhat like below. . . class NichesController extends AppController { var $name = 'Niches'; var $uses = array('Niche'); var $scaffold; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Need: CakePHP Contact Form Need Please
Ok, Ok, Ok, I got you. But I'm just sayingI'm pretty good at reading a manual and pasting stuff together, but when you don't know something, it's kinda hard. And as I saidThought this was for 1.1 On that note, how do I know what version certain code is for? -- Baz L Day In The Life of Baz http://www.LifeOfBaz.com On 7/27/07, cakeFreak <[EMAIL PROTECTED]> wrote: > > > Baz, come on, you getting a bit EXTRA-lazy here. > > On 27 Lug, 21:23, Baz <[EMAIL PROTECTED]> wrote: > > I saw this before, but since I'm on 1.1. It didn't work for me. Also > there's > > the language barrier. > > Language barrier??! > > Now I give you a couple of lessons of Italian. > > A) try to concentrate all your neurons for few secs > B) you have 0.5 secs for each answer > > GO! > > 1) what does "messaggio" means? > 2) what does "e-mail" means > 3) what does "nome" means? > 4) Now the most difficult: what does "cognome" means? > > ;o) > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Multiple field values in select box?
Is there any way to get values from multiple fields into a select box? After much searching, I've come to the conclusion I'm not going to find the answer without appealing to those far wiser than myself... Here's an old thread for reference, which discusses, w/o resolution, exactly what I'm looking for: "* Is it possible to use multiple fields to make up the value of the select box? Such that it would come out looking something like field2value - field3value" http://groups.google.com/group/cake-php/browse_thread/thread/50a2ecaf2e14f4eb/cc46362244303c7c?lnk=gst&q=%24column+%3D%3E+%24value&rnum=48#cc46362244303c7c So, just wondering if anyone ever made any progress on this. Saw the code in trac, but it seems to be for 1.2 (?). Couldn't get it to work, anyway. I'd find this functionality very valuable Thanks to anyone for any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Newbie Introduction Book ... reviews anyone?
On 7/27/07, Dave <[EMAIL PROTECTED]> wrote: > > > I'm working on a Newbie's Introduction to CakePHP book and would like > to invite anyone who would like to review it for errors or > considerations I may have overlooked. Let me know, and I'll send you a > PDF copy of the current edition. Has it been blessed by the Cake Foundation? If no then get it blessed before asking anyone to spend time on something which possibly may be still born Tarique -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
controller name
Hello, Quick question I have the following: niches_controller.php Calling it by www.domain/cake/niches errors out with complaining about missing model: Missing Model No class found for the Nich model. Fatal: Create the class below in file: app/models/nich.php Etc... But I have niche.php I don't understand why the exact same works with Movie - Movies but not this Niche - Niches ?? What is the best way to deal with this errors? Thank you, Andras Kende http://www.kende.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Newbie Introduction Book ... reviews anyone?
I'd like to take a look. Thanks. benhirsch AT gmail DOT com On Jul 27, 2:14 pm, Dave <[EMAIL PROTECTED]> wrote: > I'm working on a Newbie's Introduction to CakePHP book and would like > to invite anyone who would like to review it for errors or > considerations I may have overlooked. Let me know, and I'll send you a > PDF copy of the current edition. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Need: CakePHP Contact Form Need Please
If someone else can learn a language not native to them, (of course I am assuming here), I think the decent thing would be to say "Thank you" and head on over to http://www.google.com/language_tools?hl=en lol. I don't know what nome, cognome and oggetto mean but, since I am curious, I will look them up: 1.)nome - name 2.)oggetto - object 3.)cognome - since i know nome is name I would think this has to do something with a name, let's find out... sweet! It's Last Name I be learned real gud On Jul 27, 3:35 pm, cakeFreak <[EMAIL PROTECTED]> wrote: > Baz, come on, you getting a bit EXTRA-lazy here. > > On 27 Lug, 21:23, Baz <[EMAIL PROTECTED]> wrote: > > > I saw this before, but since I'm on 1.1. It didn't work for me. Also there's > > the language barrier. > > Language barrier??! > > Now I give you a couple of lessons of Italian. > > A) try to concentrate all your neurons for few secs > B) you have 0.5 secs for each answer > > GO! > > 1) what does "messaggio" means? > 2) what does "e-mail" means > 3) what does "nome" means? > 4) Now the most difficult: what does "cognome" means? > > ;o) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Need: CakePHP Contact Form Need Please
Baz, come on, you getting a bit EXTRA-lazy here. On 27 Lug, 21:23, Baz <[EMAIL PROTECTED]> wrote: > I saw this before, but since I'm on 1.1. It didn't work for me. Also there's > the language barrier. Language barrier??! Now I give you a couple of lessons of Italian. A) try to concentrate all your neurons for few secs B) you have 0.5 secs for each answer GO! 1) what does "messaggio" means? 2) what does "e-mail" means 3) what does "nome" means? 4) Now the most difficult: what does "cognome" means? ;o) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Need: CakePHP Contact Form Need Please
> > Now I give you a couple of lessons of Italian. Haha, I didn't know I was fluent in Italian - good to know : P. -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de cakeFreak wrote: > Baz, come on, you getting a bit EXTRA-lazy here. > > On 27 Lug, 21:23, Baz <[EMAIL PROTECTED]> wrote: > >> I saw this before, but since I'm on 1.1. It didn't work for me. Also there's >> the language barrier. >> > > Language barrier??! > > Now I give you a couple of lessons of Italian. > > A) try to concentrate all your neurons for few secs > B) you have 0.5 secs for each answer > > GO! > > 1) what does "messaggio" means? > 2) what does "e-mail" means > 3) what does "nome" means? > 4) Now the most difficult: what does "cognome" means? > > ;o) > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Need: CakePHP Contact Form Need Please
I usually just use the nifty isset() php function, as in: if(isset($this->data['Contact']['email']) { //do some stuff relevant to your ultimate goal } On Jul 27, 2:23 pm, Baz <[EMAIL PROTECTED]> wrote: > I'm a bit unclear here. Since there's not ->read() or ->findAll(), how do we > know that there is a $this->data['Contact']['email']? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: same directory as controller name
I have a solution. When a request is made apache checks if the directory exists. If it does, it checks if index.php, index.htm or index.html exists. If they don't, the request is forwarded to cake. And all this magic with mod_rewrite voodoo: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^$ app/webroot/ [L] # check if directory exists, if so, add default indexing script. (and do a [N]ext round so the %{REQUEST_FILENAME} gets updated. Should also work with [PT]) RewriteCond %{REQUEST_FILENAME} -d RewriteRule (.*) %{REQUEST_FILENAME}index.php [N] # if above rewrite didn't yield any success, try with .htm RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*)index.php$ $1index.htm # now try with .html RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*)index.htm$ $1index.html # last but not least, if it is a file, serve it, else strip the index.html and give it to cake :) RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*)index.html$ $1 RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*) app/webroot/$1 [L] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need help with linking models
well i tried doing that earlier on and then had to take off everything coz it wasnt well structured. i would like to at least get the associations sorted before baking. so the problem remaining is that of creating the task list >I would like the task listing to be displayed >when a user is viewed, because every user has a number of tasks in one >or more module to perform, so the idea is to have a task list. also i thought maybe someone more experienced in cake would not take long to recognize whether my associations made sense or not and just give me an indication on whether im on the right track or not. 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: adding "duplicate" to scaffolding
I wasn't saying that it is a feature that each and every application should and must have -- just a useful modification to know about. When I've fear-proofed my solution I'll pop it into a bakery article. On Jul 27, 1:23 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 7/27/07, bingomanatee <[EMAIL PROTECTED]> wrote: > > > > > True but the convenience to the end users are also a useful metric of > > an application's efficiency. especially when (as in my case) they are > > also a developer :D > > Learning to say "no" to a request is the toughest thing a developer > has to learn how to do. Just because a project is open source doesn't > mean every request has to be accommodated. > > I suggest you go over to trac.cakephp.org and file a ticket under > 'enhancments' if you feel that this is a worthwhile thing to have. > The worse thing that will happen is that the answer will be "no". > > -- > Chris Hartjes > Senior Developer > Cake Development Corporation > > My motto for 2007: "Just build it, damnit!" > > @TheBallpark -http://www.littlehart.net/attheballpark > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Newbie Introduction Book ... reviews anyone?
What version would this be for? Since I'm a newbie, I'd be a great test. On 7/27/07, Dave <[EMAIL PROTECTED]> wrote: > > > I'm working on a Newbie's Introduction to CakePHP book and would like > to invite anyone who would like to review it for errors or > considerations I may have overlooked. Let me know, and I'll send you a > PDF copy of the current edition. > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: adding "duplicate" to scaffolding
On 7/27/07, bingomanatee <[EMAIL PROTECTED]> wrote: > > True but the convenience to the end users are also a useful metric of > an application's efficiency. especially when (as in my case) they are > also a developer :D Learning to say "no" to a request is the toughest thing a developer has to learn how to do. Just because a project is open source doesn't mean every request has to be accommodated. I suggest you go over to trac.cakephp.org and file a ticket under 'enhancments' if you feel that this is a worthwhile thing to have. The worse thing that will happen is that the answer will be "no". -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: adding "duplicate" to scaffolding
True but the convenience to the end users are also a useful metric of an application's efficiency. especially when (as in my case) they are also a developer :D On Jul 27, 12:39 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 7/27/07, bingomanatee <[EMAIL PROTECTED]> wrote: > > > as to the "borderlineosity" -- its a pretty common way to moprh new > > records: pick a row that is like the new one you want, duplicate it > > and tweak it. > > What you're talking about is the lazy way of creating new records > > 1) duplicate an existing record > 2) go back and alter the existing record > > as opposed to > 1) create new record > > Notice the extra database hit. > > Correct me if I'm wrong. > > -- > Chris Hartjes > Senior Developer > Cake Development Corporation > > My motto for 2007: "Just build it, damnit!" > > @TheBallpark -http://www.littlehart.net/attheballpark > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: adding "duplicate" to scaffolding
I might work that through -- actually I worked through the index template and added a "Copy" link. http://www.wonderlandlabs.com/modules/wiwimod/index.php?page=CakeDupe as to the "borderlineosity" -- its a pretty common way to moprh new records: pick a row that is like the new one you want, duplicate it and tweak it. BTW Cake rules! > > Sounds to me like a possible solution is this: > > 1) add a checkbox to your form labeled 'duplicate' > 2) in your save action check to see if 'duplicate' has been selected. > If it is then simply save the record again. > > You'd have to make sure that whatever validation rules you have in > place would allow for a duplicate record to be put in (i.e. make sure > you have no unique fields in your databaase). > > Hope that helps. > > BTW, generating duplicate records doesn't sound like a "useful > paradigm" to me, sounds more like an edge case. Duplication of > records without a really good reason lies on the path to application > maintenance hell. > > -- > Chris Hartjes > Senior Developer > Cake Development Corporation > > My motto for 2007: "Just build it, damnit!" > > @TheBallpark -http://www.littlehart.net/attheballpark > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
PAKHostOnline.com - Web Hosting | Pakistan | http://www.pakhostonline.com/
PAKHostOnline.com offered Pakistan No.1 Web Hosting, DOMAIN Registration / Transfer, 99% UP-Time, 24/7 Technical Support at http://www.pakhostonline.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Turn off writing to debug.log
Anyone know how to turn off writing to the debug.log? I've set define('DEBUG', 0); and just about everything else I can think of off. 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: adding "duplicate" to scaffolding
On 7/27/07, bingomanatee <[EMAIL PROTECTED]> wrote: > as to the "borderlineosity" -- its a pretty common way to moprh new > records: pick a row that is like the new one you want, duplicate it > and tweak it. What you're talking about is the lazy way of creating new records 1) duplicate an existing record 2) go back and alter the existing record as opposed to 1) create new record Notice the extra database hit. Correct me if I'm wrong. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need: CakePHP Contact Form Need Please
On 7/27/07, Baz <[EMAIL PROTECTED]> wrote: > > For a Model that has no table: does populating the $validate array > automatically populate $this->data in the controller? Or is that only done > when the form returns? $this->data is populated when the form is returned. - Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need: CakePHP Contact Form Need Please
I saw this before, but since I'm on 1.1. It didn't work for me. Also there's the language barrier. I have a general question though: For a Model that has no table: does populating the $validate array automatically populate $this->data in the controller? Or is that only done when the form returns? I'm a bit unclear here. Since there's not ->read() or ->findAll(), how do we know that there is a $this->data['Contact']['email']? ThanX in advance. -- Baz L Day In The Life of Baz http://www.LifeOfBaz.com/ On 7/27/07, cakeFreak <[EMAIL PROTECTED]> wrote: > > > This is the view; > > > > VIEW: views/contacts/index.ctp > > > > Contacts: > > create('Contact', array('url'=>'/contacts'));?> > > echo $form->input('nome', array('error' => array( > 'required' => 'specifica il > tuo nome') > ) > ); > > echo $form->input('cognome', array('error' => array( > 'required' => 'specifica il > tuo cognome') > ) > ); > > echo $form->input('e-mail', array('error' => array( > 'required' => 'specifica la > tua e-mail', > 'validEmail' => 'inserisci un > e-mail valida' > ) > ) > ); > echo $form->input('oggetto', array('error' => array( > 'required' => 'specifica l > \'oggetto') > ) > ); > > echo $form->input('messaggio', array('error' => > array('required' => > 'inserisci il messaggio'), > 'type'=>'textarea', > 'cols'=>30)); > ?> > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: adding "duplicate" to scaffolding
On 7/27/07, bingomanatee <[EMAIL PROTECTED]> wrote: > > I want to add "duplicate" to the scaffolding of my site; while I can > of course envision a wholly seperate action for duplicate, I have to > think that someone with more familiarity with Cake could help me > "Tweak" the existing views to repurpose them for inserting a duplicate > record with the same values as an existing record (except ID of > course). > > Any suggestions? Sounds to me like a possible solution is this: 1) add a checkbox to your form labeled 'duplicate' 2) in your save action check to see if 'duplicate' has been selected. If it is then simply save the record again. You'd have to make sure that whatever validation rules you have in place would allow for a duplicate record to be put in (i.e. make sure you have no unique fields in your databaase). Hope that helps. BTW, generating duplicate records doesn't sound like a "useful paradigm" to me, sounds more like an edge case. Duplication of records without a really good reason lies on the path to application maintenance hell. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need: CakePHP Contact Form Need Please
This is the view; VIEW: views/contacts/index.ctp Contacts: create('Contact', array('url'=>'/contacts'));?> input('nome', array('error' => array( 'required' => 'specifica il tuo nome') ) ); echo $form->input('cognome', array('error' => array( 'required' => 'specifica il tuo cognome') ) ); echo $form->input('e-mail', array('error' => array( 'required' => 'specifica la tua e-mail', 'validEmail' => 'inserisci un e-mail valida' ) ) ); echo $form->input('oggetto', array('error' => array( 'required' => 'specifica l \'oggetto') ) ); echo $form->input('messaggio', array('error' => array('required' => 'inserisci il messaggio'), 'type'=>'textarea', 'cols'=>30)); ?> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: adding "duplicate" to scaffolding
Thats not a very open source-y answer. I was thinking it would be a generally usefu feature for the scaffolding paradigm. On Jul 27, 10:27 am, "Pablo Viojo" <[EMAIL PROTECTED]> wrote: > If not an scaffolding functionality, it's time to start to write code...I > think no one would like to help wit h this. > > -- > Pablo Viojo > [EMAIL PROTECTED]://pviojo.net > > On 7/27/07, bingomanatee <[EMAIL PROTECTED]> wrote: > > > > > I want to add "duplicate" to the scaffolding of my site; while I can > > of course envision a wholly seperate action for duplicate, I have to > > think that someone with more familiarity with Cake could help me > > "Tweak" the existing views to repurpose them for inserting a duplicate > > record with the same values as an existing record (except ID of > > course). > > > Any suggestions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Need: CakePHP Contact Form Need Please
Here we go with a contact form for last 1.2.0.5427alpha: CONTROLLER: contacts_controller.php set('title_for_layout', 'Contatti'); if(isset($this->data)) { if($this->Contact->create($this->data) && $this->Contact- >validates()){ //send e-mail $this->_sendMail(); } else{ $this->Session->setFlash('correggi gli errori sottostanti'); //$this->redirect('/contacts'); } } } function _sendMail() { $senderEmail = $this->data['Contact']['e-mail']; $this->Email->layout = 'email'; $this->Email->to = '[EMAIL PROTECTED]'; $this->Email->subject = $this->data['Contact']['oggetto']; $this->Email->from = $senderEmail; $this->Email->template = 'text'; //Send as 'html', 'text' or 'both' (default is 'text') $this->Email->sendAs = 'text'; //Set view variables as normal $this->set('nome', ucfirst($this->data['Contact']['nome'])); $this->set('cognome', ucfirst($this->data['Contact'] ['cognome'])); $this->set('email', $senderEmail); $this->set('oggetto', $this->data['Contact']['oggetto']); $this->set('messaggio', $this->data['Contact']['messaggio']); //Do not pass any args to send() if ( $this->Email->send() ) { $this->Session->setFlash('La tua e-mail è stata spedita con successo'); $this->redirect('/'); exit; } else { $this->Session->setFlash("Ci sono stati dei problemi nell'inviare l'e-mail. Ti invitiamo a riprovare"); $this->redirect('/contacts/index/'); exit; } } } ?> MODEL: contact.php array('required' => VALID_NOT_EMPTY), 'cognome' => array('required' => VALID_NOT_EMPTY), 'e-mail' => array('required' => VALID_NOT_EMPTY, 'validEmail'=>VALID_EMAIL), 'oggetto' => array('required' => VALID_NOT_EMPTY), 'messaggio' => array('required' => VALID_NOT_EMPTY), ); } ?> --- E_MAIL TEMPLATE: views/layouts/email/text/email.ctp --- --- EMAIL FROM IntellighenziaProject.it --- FROM : E-MAIL : SUBJECT: --- MESSAGE: --- --- Hope this helps. Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Need: CakePHP Contact Form Need Please
On 7/27/07, Baz <[EMAIL PROTECTED]> wrote: > Now was that really necessary? When you don't explain WHY you need something, that's a very typical result around here. > > Should I just scrap 1.1? Is 1.2 suitable for a production site? In my opinion, 1.2 is suitable for a production site but like all non-stable software you take your chances that when an update is done that it doesn't break something you've already written. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need: CakePHP Contact Form Need Please
Now was that really necessary? Don't get me wrong here, I'm not trying to be lazy as you seem to be implying. But isn't the Bakery supposed to be a code repository? All I meant was that a contact form seems like something that someone would have already done. Isn't that the point of Cake? To stop reinventing the wheel? Again, I'm sorry, I'm new here. I'll elaborate. I'm trying to build a Contact Form: Simple page where a user enters Name, Subject, Body and it emails it to an address of my choosing. I'm having a number of problems doing this: - I need a Model without a Table to handle the data passing. I can't figure out how I would populate the $this->data without having a table. - When I get databack, how do I actually send the email using the phpMailer component? I got lost when they created this views in app/views/your_controller/email/. default_html.thtml and default_text.thtml What's supposed to be in them? Also I don't understand what goes in this: app/views/layouts/email.thtml Note that I'm using the Stable release with the PHPMailer component from the link below. Should I just scrap 1.1? Is 1.2 suitable for a production site? Any help would be appreciated. -- Baz L Day In The Life of Baz http://www.LifeOfBaz.com/ On 7/27/07, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > > On 7/27/07, codecowboy <[EMAIL PROTECTED]> wrote: > > > > Can you please elaborate. You did not ask a question. > > Oh no, I think he was quite clear. He wants someone else to do his > work for him and give him all the code needed for a contact form > within a CakePHP application. > > -- > Chris Hartjes > Senior Developer > Cake Development Corporation > > My motto for 2007: "Just build it, damnit!" > > @TheBallpark - http://www.littlehart.net/attheballpark > @TheKeyboard - http://www.littlehart.net/atthekeyboard > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Newbie Introduction Book ... reviews anyone?
I'm working on a Newbie's Introduction to CakePHP book and would like to invite anyone who would like to review it for errors or considerations I may have overlooked. Let me know, and I'll send you a PDF copy of the current edition. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Mambo to use CakePHP for V5
I've been a Drupal user for about 6 Months now. I picked Drupal because it was mentioned a few times that it was one of the most flexible. I had no intention of switching. However, the Mambo foundation's decision to move to CakePHP will more than likely make myself (and possible many other bakers like me) make the switch at the drop of a hat. I think it's a great way to attract more bakers to Mambo and more PHP developers to CakePHP. I can see the enthusiasm of the bakers causing a flood of contributions to Mambo. I'm very excited. May I join my fellow bakers in extending my welcome. Mambake on! Sonic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Are Model classes supposed to be singletons?
That is useful to know -- it is not a complete answer to the larger question: if you create a new model() and save it in the ClassRepository, use it in one context, then use it in another (or with nested methods use it back and forth between two different contexts) are there any predictable/unwanted side efffects? I do like limiting object instantiation, but was wondering if I could be going too far. Asked another way, which types of objects was the ClassRepository designed to make global? On Jul 27, 1:59 am, grigri <[EMAIL PROTECTED]> wrote: > I'm not sure if it was me doing something wrong, but I found an > annoying side-effect of this. > If you want to dynamically bind associations, binding occurs on the > entire model - which is shared. > So if you have: > > class Company extends AppModel { > var $hasOne = array( > 'Logo' => array('className' => 'Image', 'foreignKey' => > 'owner_id', 'conditions' => 'Logo.type=\'logo\' AND Logo.owner_type= > \'company\''), > 'Map' => array('className' => 'Image', 'foreignKey' => 'owner_id', > 'conditions' => 'Map.type=\'map\' AND Map.owner_type=\'company\''), > ) > > } > > then inside companies_controller you do: > > $this->Company->Logo->bindModel(array('belongsTo' => array(...))); > > This affects both $this->Company->Logo and $this->Company->Map, since > they are the same model. > > Still, this really wasn't thought out and might be down to my bad > design in the first place - I was only experimenting. > > On 26 Jul, 20:09, bingomanatee <[EMAIL PROTECTED]> wrote: > > > The opportunity for caching model objects as singletons in the > > ClasssRepository exists; is there any reason why this should NOT be > > done? Can this create any conflicts that might sabotage your code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: adding "duplicate" to scaffolding
If not an scaffolding functionality, it's time to start to write code...I think no one would like to help wit h this. -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On 7/27/07, bingomanatee <[EMAIL PROTECTED]> wrote: > > > I want to add "duplicate" to the scaffolding of my site; while I can > of course envision a wholly seperate action for duplicate, I have to > think that someone with more familiarity with Cake could help me > "Tweak" the existing views to repurpose them for inserting a duplicate > record with the same values as an existing record (except ID of > course). > > Any suggestions? > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Need: CakePHP Contact Form Need Please
I'm really having a solution for your problems here. You can contact me for conditions ($$$) Smiles... -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On 7/27/07, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > > On 7/27/07, codecowboy <[EMAIL PROTECTED]> wrote: > > > > Can you please elaborate. You did not ask a question. > > Oh no, I think he was quite clear. He wants someone else to do his > work for him and give him all the code needed for a contact form > within a CakePHP application. > > -- > Chris Hartjes > Senior Developer > Cake Development Corporation > > My motto for 2007: "Just build it, damnit!" > > @TheBallpark - http://www.littlehart.net/attheballpark > @TheKeyboard - http://www.littlehart.net/atthekeyboard > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Scaffold not working for belongsTo join with underscore in name
I found the error myself -- a bad "name" value in the ItemType model class. sorry... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
adding "duplicate" to scaffolding
I want to add "duplicate" to the scaffolding of my site; while I can of course envision a wholly seperate action for duplicate, I have to think that someone with more familiarity with Cake could help me "Tweak" the existing views to repurpose them for inserting a duplicate record with the same values as an existing record (except ID of course). Any suggestions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
paginator helper: how to use it without a model?
I was just wondering whether it is possible to use the paginator helper without a model. In particular you can find yourself with a controller getting data in form of arrays from a webservice (youtube, flickr etc.). Should I build a behavihour and a model for the controller that retrieves the webservice data, and then use: $data = $this->paginate(); Am I on the worng path?!?! Cheers Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: IRC log mirroring to GG?
On Jul 24, 7:25 pm, "Christian \"Jippi\" Winther" <[EMAIL PROTECTED]> wrote: > Why should the IRC logs be spammed onto GG ? I don't see the point in that > :) I'm sorry for the late follow-up. I'm not suggesting to replace your version. But, since GG is already free, it is better to use it as a archive platform--which is again fast. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Apply behavior only for certain model methods?
Many thanks to Andy and Tarique for the helpful follow-up. I'll check your suggestions sometimes later. Thanks again. -- Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Cake with Zend Session or Cake without any Sessions?
On 7/27/07, Freight <[EMAIL PROTECTED]> wrote: > > Can I use Cake without any Session, even without Zend-Session? > Did you read the section in the manual about the Session Component? http://manual.cakephp.org/chapter/session I suggest you try this experiment: 1) go into config/core.php and comment out the line that defines what session handler you want to use 2) try running your app All will be revealed... -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cakephp Installation
On 7/27/07, Freight <[EMAIL PROTECTED]> wrote: > > > Where is the problem exactly? Between the ears. T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Fetching data from model not binded
Depending on your model recursion level, you should get Project information associated with each Project item returned from a Category Find request. You can use pr($this->Category->find("Category.id=2")); to see the array of data returned by that function. If you're not seeing any Project information, set the recursion level in the category model to 2: $this->Category->recursive = 2; before you call the find function. Once you get all the data you need you can sort it as you see fit in your controller. On Jul 26, 4:33 am, lgarcia <[EMAIL PROTECTED]> wrote: > I need an urgent solution. > > I have all my products associated to a category and owned by a > project. The association between this three models is: > > * Project.id = Product.project_id > * product and category ==> HABTM (products_categories) > > So, products and projects are related, but categories and projects are > not... how can i show products related to a certain project in the > Category->show action? > > Now i'm doing... > function show(id) { > $this->Category->find("Category.id = 2"); > > } > > I'm quite lost 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: Using Cake with Zend Session or Cake without any Sessions?
Can I use Cake without any Session, even without Zend-Session? On 26 Jul., 22:10, gwoo <[EMAIL PROTECTED]> wrote: > Add Zend to your vendors directory. Write your own SessionComponent. > use vendor('Zend/Session', 'Zend/Auth'); or whatever the path to the > libs are. Create the methods you need like read, write, destroy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 Installation
Where is the problem exactly? On 27 Jul., 15:07, saritha <[EMAIL PROTECTED]> wrote: > Hi all, > > Iam unable to configure cakephp.I get confused.I have gone thru the > manual also.pl help me in this manner.pl give your suggestions to > configure cakephp to develope the application.And the steps needed to > do it. > > Thanks, > Saritha. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: need help with linking models
On 7/27/07, rtanz <[EMAIL PROTECTED]> wrote: > im not sure if this is the correct way to do things however and given > that this is the first time i am using cake i would like to make sure > that everything is set up well > before i bake and continue modifying the system. > No, no, NO, NO! Just build it! You will figure it out once you have some working code in front of you. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need: CakePHP Contact Form Need Please
On 7/27/07, codecowboy <[EMAIL PROTECTED]> wrote: > > Can you please elaborate. You did not ask a question. Oh no, I think he was quite clear. He wants someone else to do his work for him and give him all the code needed for a contact form within a CakePHP application. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Need: CakePHP Contact Form Need Please
Can you please elaborate. You did not ask a question. On Jul 27, 8:39 am, Baz L <[EMAIL PROTECTED]> wrote: > I'm really having problems here. > > I'm guessing someone has already developed something like this. > > I looked at this in the > bakery:http://bakery.cakephp.org/articles/view/sending-email-with-phpmailer > > But it seems a bit incomplete. > > I started with Cake about a month ago. Anyway, anyone who can offer > some help, I'd greatly appreciate it: > > -- > Baz L > Day In The Life of Bazhttp://www.LifeOfBaz.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need help with linking models
ok some more progress in getting this right, i uploaded my current db table design at www.jpgalea.com/design.jpg and also my erm diagram at www.jpgalea.com/erm.jpg here are my model associations at the moment: Listing var $belongsTo = array('Module','Task'); Membership var $belongsTo = array('Module','Role','User'); Module var $hasOne = array('Review' ) var $hasMany = array('Membership','Listing'); Review var $belongsTo = array('Module'); Role var $hasMany = array('Task','Membership'); Task var $hasMany = array('Listing'); var $belongsTo = array('Role'); User var $hasMany = array('Membership','Listing'); im not sure if this is the correct way to do things however and given that this is the first time i am using cake i would like to make sure that everything is set up well before i bake and continue modifying the system. a description of what i am trying to achieve can be found at www.jpgalea.com/system.doc Basically apart from being unsure if this is a correct way to associate models (which however seems to work pretty well) the only problem i have is that I would like the task listing to be displayed when a user is viewed, because every user has a number of tasks in one or more module to perform, so the idea is to have a task list. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Announcing Selling Made Simple - Open Source e-Commerce
Basically what happens is you have a hierarchial content system. Unlimited subcategories, and products under these subcategories. When you create/edit a product you will specify a price, name, and description. (A name and description for each language if you have more than one turned on). In your product template you can decide how to layout the price, description, and product images. All products have the field template_id, so it is possible to in fact have multiple product templates. Not all sites will require this functionality, but it will definitely be handy for some. On Jul 27, 9:44 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 7/27/07, savagekabbage <[EMAIL PROTECTED]> wrote: > > > > > The reason I wanted to go with database storage instead of flat file > > is because of the user who may want to have 20 different product > > templates for a large site. This just seemed easier to handle if the > > templates were stored in the database. > > I think you are mixing product details with templates here... or am i > missing something > > T > > -- > = > Cheesecake-Photoblog:http://cheesecake-photoblog.org > PHP for E-Biz:http://sanisoft.com > = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Announcing Selling Made Simple - Open Source e-Commerce
I've developed a website that uses a highly modified version of CubeCart shopping cart software, while using Cake to develop a major loan underwriting system for another job. Let me tell you that I'm very excited to hear of this project as I'd love to be able to combine the goodness of Cake into a shopping cart application that I can easily extend at will. Although I'm pretty comfortable now with how CubeCart works and have been able to modify (sometimes, probably "hack" is the better term) the system to get the results I need, I'm never really sure how many unused features I broke while doing so. And when the time comes to use those features, I'm always crossing my fingers hoping it all works. I've been waiting anxiously for the next major release of CubeCart since the beginning of the year, as it's supposed to have various features built in that I've implemented myself in the previous version. It's supposed to be a major upgrade so I've been putting off new feature requests until I can upgrade, otherwise, the more heavily modded prior version will become more difficult to upgrade. Having Cake to enforce a good MVC design with a good plugin structure should work very well for this type of project (and should eliminate "hacks"!) . I'm looking forward to using 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 -~--~~~~--~~--~--~---
Scaffold not working for belongsTo join with underscore in name
I have two tables, "Items" and "Item Types". The Scaffolding for the "edit" view is not displaying item type options. I have traced the error into the fieldTypes() method: the key for the option cluster is not matching the key output by the findAll method. >>> It seems to expect the data to have the camel cased version of the table name, where it's getting the underscored version. << Why is this? Output from my "traced" controller's generateFieldNames() method: looking for PK id, display field name key = item_type ttm = ItemType pass: Array ( [item_type] => Array ( [id] => 2 [name] => armor [notes] => ) ) looking for PK id, display field name key = item_type ttm = ItemType pass: Array ( [item_type] => Array ( [id] => 3 [name] => container [notes] => ) ) Excerpt from modified controller's generateFieldNames() method c. line 755 {$model}- >tableToModel[$fieldNames[$tabl['name']]['table']]; echo 'pass: ', print_r($pass, 1), 'looking for PK ', $otherModel->primaryKey, ', display field ', $otherDisplayField, ''; foreach ($pass as $key => $value) { echo 'key = ', $key , 'ttm = ', $ttm , ''; if ($key == $ttm && isset($value[$otherModel->primaryKey]) && isset($value[$otherDisplayField])) { $fieldNames[$tabl['name']]['options'][$value[$otherModel- >primaryKey]] = $value[$otherDisplayField]; } } } .. ?> My Model Classes: array( 'className' => 'Item', 'foreign_key' => 'item_type_id' ) ); } ?> array( 'foreignKey' => 'skill_id', 'className' => 'Skill' ), 'Power' => array( 'foreignKey' => 'power_id', 'className' => 'Aspect' ), 'Effect' => array( 'foreignKey' => 'effect_id', 'className' => 'Effect' ) ); } ?> SQL: CREATE TABLE `items` ( `id` int(11) NOT NULL auto_increment, `name` varchar(40) collate utf8_bin NOT NULL, `item_type_id` int(11) NOT NULL, `notes` text collate utf8_bin NOT NULL, `skill_id` int(11) NOT NULL, `power_id` int(11) NOT NULL, `effect_id` int(11) NOT NULL, `factor` float NOT NULL, `offset` int(11) NOT NULL, `price` float NOT NULL, `weight` int(11) NOT NULL, `weight_unit` enum('lbs','tons','g','kg') collate utf8_bin default 'kg', `size` int(11) NOT NULL, `size_unit` enum('in','ft','yds','cm','m') collate utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ; CREATE TABLE `item_types` ( `id` int(11) NOT NULL auto_increment, `name` varchar(40) collate utf8_bin NOT NULL, `notes` text collate utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=6 ; -- -- Dumping data for table `item_types` -- INSERT INTO `item_types` VALUES (1, 'weapon', ''); INSERT INTO `item_types` VALUES (2, 'armor', ''); INSERT INTO `item_types` VALUES (3, 'container', ''); INSERT INTO `item_types` VALUES (4, 'clothing', ''); INSERT INTO `item_types` VALUES (5, 'tool', ''); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 Installation
You could start from this the cakephp.org site. Have a look at this http://manual.cakephp.org/appendix/blog_tutorial http://manual.cakephp.org/appendix/blog_tutorial saritha wrote: > Hi all, > > Iam unable to configure cakephp.I get confused.I have gone thru the > manual also.pl help me in this manner.pl give your suggestions to > configure cakephp to develope the application.And the steps needed to > do it. > > Thanks, > Saritha. > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 Installation
Hi all, Iam unable to configure cakephp.I get confused.I have gone thru the manual also.pl help me in this manner.pl give your suggestions to configure cakephp to develope the application.And the steps needed to do it. Thanks, Saritha. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Announcing Selling Made Simple - Open Source e-Commerce
On 7/27/07, savagekabbage <[EMAIL PROTECTED]> wrote: > > > > The reason I wanted to go with database storage instead of flat file > is because of the user who may want to have 20 different product > templates for a large site. This just seemed easier to handle if the > templates were stored in the database. I think you are mixing product details with templates here... or am i missing something T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Announcing Selling Made Simple - Open Source e-Commerce
Hey guys, thanks for the feedback! I'm still not 100% sure i"m going to go database stored templates. Consider this: Right now there are three main 'content types': - Static Pages - Category Views - Product Views This means there will be a minimum of 4 templates if you include one for the outer 'shell' of the site. The reason I wanted to go with database storage instead of flat file is because of the user who may want to have 20 different product templates for a large site. This just seemed easier to handle if the templates were stored in the database. Speed shouldn't really be an issue as long as the templates area caching correctly. But yes, Dr. Tarique Sani, it will definitely make things more complicated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Need: CakePHP Contact Form Need Please
I'm really having problems here. I'm guessing someone has already developed something like this. I looked at this in the bakery: http://bakery.cakephp.org/articles/view/sending-email-with-phpmailer But it seems a bit incomplete. I started with Cake about a month ago. Anyway, anyone who can offer some help, I'd greatly appreciate it: -- Baz L Day In The Life of Baz http://www.LifeOfBaz.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake + Drupal
>From within Drake, you can call any drupal api function. I believe you may even be able to use "global $USER;" to get user information (I have not tried this -- we use a small modification to Drake that stores pertinent user information in the session before activating the Cake dispatcher). enkara wrote: Ok.. I've explained very bad what I was looking for. I've already installed drupal, cakephp and drake. I suppose it works, I don't know because I don't know where to start from. My question is: how drupal and cake interact? Is drake simply to show a cake application inside of drupal or can I modify drupal modules by using cakephp functions? On 26 jul, 21:22, Joshua Benner <[EMAIL PROTECTED]> wrote: http://drupal.org/project/drake enkara wrote:Hi, I want to use Cake and Drupal for my site but I can't find any tutorial that teaches me in how to do this. I just don't know how start and if I can use cake only in separate way or I can use cake inside of drupal files like page.tpl.php (inside a theme). If you could tell me a page where this is explained... It seems very strange tom e that there isn't this kind of information. I would be happy if there where an example to follow. Thank you for your help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model.php can't save data due to beforeSave
Maybe your behavior test doesn't return at all? I made that mistake once. Void is not true. On 27 Juli, 06:10, Grant Cox <[EMAIL PROTECTED]> wrote: > It runs the beforeSave() function, which your model can implement if > you want to check what is about to be saved, and either modify the > data before saving, deny the save completely, or of course allow the > save to continue. By default there is a stub implementation in your / > cake/libs/model/model.php, which always returns true (so every save > can continue). You must have a beforeSave() defined either in your > app/app_model.php, in your actual model class in app/models, or in a > behaviour that your model implements that is returning false, stopping > the save. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Creating views
I'm not a CakePHP superuser but I try to stay clear of using PagesController. What happens if you create the views manually? On a sidenote, when I have more than one Model that use Categories I altered my Categories model like this: CREATE TABLE `categories` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(45) NOT NULL, `description` text NOT NULL, `model` varchar(45) NOT NULL, PRIMARY KEY (`id`) ); Note the model field. And then in the $belongsTo array in the models you add the 'condition' => "Category.model=".$this->name Keeps the number of tables down. ;) Just an idea I had. On 27 Juli, 06:14, Grant Cox <[EMAIL PROTECTED]> wrote: > The only thing I can see wrong is that you have a model called Page, > and a controller PagesController. Cake already has an inbuilt > PagesController which is used for displaying static pages. I would > have guessed that it wouldn't be a problem for you to define your own > (instead of the default one), but perhaps that is part of the issue. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: need help with linking models
that makes sense however it does not really solve my problem, cause i still need to display other task information such days_allowed, task_order, task_complete, created, modified. These are still left out with the model you provided. They are related to a particular user within a particular module and a particular role --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Announcing Selling Made Simple - Open Source e-Commerce
> > > If you really want web based editing - take the approach which some > > > popular > > > CMSs take - read and write to files... > > > > is it really so bad? why not save to the database, then use cake built > > in cache to speed things up? > > > > I ask as I have a project that requires similar functionality and that > > was how I was intending to do it. > > Using cache to mitigate the cost/need to read views/templates from the > db, which are only there so that you can 'easily' edit them seems like > a weird circular dependency to me. > > It would be a lot simpler to edit the view/template file via a form > (did that for myself before for small changes when without ftp > access). Choosing a (user defined?) layout file based on some logic/ > user preferences, rather than retrieving a layout from the db would > simply be "simpler". > > If you go the db route, I hope some defensive coding is used so the > "problem connecting to db" & "problem with layouts/views table" error > messages still display ;) good points well made :) As only admins can CRUD templates, it will be fine for them to add view files. I was just writing loads of stuff about multiple domains and how that affects things, but then realised it doesn't affect anything at all! jb -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth component + Cake 1.2
After digging quite a bit in the AuthComponent source, I think I've found the problem. There are still some things I don't understand, so please feel free to correct me where I might be wrong. For example, identify() gets called twice in a login, but I can't figure where does the second call come from and why the passed data is different in each call: first the POST data, then username/password fields as part of a User array. This second call is the one logging the user even if no username/password information was given on the login form, see code bellow. On a side note for my previous code, it is not necessary to call $this->Auth->login() passing it $this->data. It will use $_POST data if nothing is specified. The identify() function of AuthComponent (auth.php 5437 2007-07-10 16:25:23Z gwoo) will use an empty array as a condition for a model- >find() call if any of the login fields are empty, thus finding the first result in the database: in my case, user with id=1: the administrator. The problematic code commented: /* Initialize the array we are going to use as a find condition as empty */ $find = array(); /* If *both* username and password are provided as a user object */ if (isset($user[$this->fields['username']]) && !empty($user[$this- >fields['username']]) && !empty($user[$this->fields['password']])) { if (trim($user[$this->fields['username']]) == '=' || trim($user[$this- >fields['password']]) == '=') { return false; } /* Set find conditions */ $find = array( $this->fields['username'] => $user[$this->fields['username']], $this->fields['password'] => $user[$this->fields['password']] ); /* Else, if username is provided in POST */ } elseif (isset($user[$this->userModel . '.' . $this- >fields['username']]) && !empty($user[$this->userModel . '.' . $this- >fields['username']])) { /* If both are empty (why '='?) this should return a login failure, but the misterious (for me!) second call will ruin the login failure */ if (trim($user[$this->userModel . '.' . $this->fields['username']]) == '=' || trim($user[$this->userModel . '.' . $this- >fields['password']]) == '=') { return false; } /* Set find conditions */ $find = array( $this->fields['username'] => $user[$this->userModel . '.' . $this- >fields['username']], $this->fields['password'] => $user[$this->userModel . '.' . $this- >fields['password']] ); } /* At this point, if we were working with the user array and *any* but not both of the fields were empty, find = array( ) */ $model =& $this->getModel(); /* $model->find(am(array(), $this->userScope), null, null, -1) will seek: If $this->userScope == array() the first user record, unconditionally. Else, the first user record that matches filtering conditions, but ommiting the identifying information: username/password */ $data = $model->find(am($find, $this->userScope), null, null, -1); /* If there are any users on the DB, $data won't be empty, thus login is authorized and user is acknowledged to be the first matching the prior conditions. In my case, user with id=1: administrator. */ if (empty($data) || empty($data[$this->userModel])) { return null; } Now the questions are: Q1. What is this second call to identify and where does it come from? Q2. Is this a bug and should be reported to trac or am I doing something deadly wrong? On 27 jul, 12:10, Gorka <[EMAIL PROTECTED]> wrote: > I thought AuthComponent handled user login and logout on its own, > validating username/password pairs and thus I saw no reason to use a > validLogin function on the model as you did. > > But: AuthComponent won't log me in with an invalid password for a > given username, but what is freaking me out is that it logs me in with > any username/password combination (even both blanks) that are not in > the database... incidentally, it logs me in with a user id of '1', > which means I turn into admin without even specifying a name or > password. > > So, I'm damn sure I'm missing some very crucial information on how > AuthComponent is supposed to be used. Could anyone tell what am I > doing wrong? > > My users controller: > > > class UsuariosController extends AppController { > > var $name = 'Usuarios'; > > function login() { > > $user_id = $this->Auth->user('id'); > if (!empty($user_id) && $this->Session->valid()) { > $this->Session->setFlash(__('Already logged in', > true), 'message', array('class' => 'error')); > $this->redirect('/'); > exit(); > } > > if (!empty($this->data)) { > if (!$this->Auth->login($this->data)) { > $this->Session->setFlash(__('Login failed', true), > 'message', array('class' => 'error')); > } else
Re: Announcing Selling Made Simple - Open Source e-Commerce
I would tend to agree with AD and Tarique. Storing template in a database which would then be cached as files, does seem crazy. However, I would also point out that allowing public editing of views (stored in a database, or a file system) seems to be asking for trouble. I would put some pretty heavy sanitization on it, given the flexibility of, say, an eval command in a posted template. Of course you could get around this problem by just storing template parameters in a database (eg. colour of headline) and then having one fixed view which included all these as parameters. Is this what you mean by templates in the database? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Announcing Selling Made Simple - Open Source e-Commerce
On Jul 27, 12:10 pm, "Jon Bennett" <[EMAIL PROTECTED]> wrote: > > > SMS's main audience will not necessarily be CakePHP developers as all > > > of the templates will be database stored. > > > I don't get the connection between the two - if you are storing the > > templates in database just so that they can be easily editable by users I > > would say please think again... the added complexity is not worth the > > feature added, also it makes it difficult for the theme designers to work on > > templates (i do presume you will have themes?) > > > If you really want web based editing - take the approach which some popular > > CMSs take - read and write to files... > > is it really so bad? why not save to the database, then use cake built > in cache to speed things up? > > I ask as I have a project that requires similar functionality and that > was how I was intending to do it. Using cache to mitigate the cost/need to read views/templates from the db, which are only there so that you can 'easily' edit them seems like a weird circular dependency to me. It would be a lot simpler to edit the view/template file via a form (did that for myself before for small changes when without ftp access). Choosing a (user defined?) layout file based on some logic/ user preferences, rather than retrieving a layout from the db would simply be "simpler". If you go the db route, I hope some defensive coding is used so the "problem connecting to db" & "problem with layouts/views table" error messages still display ;) my 2p. AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Announcing Selling Made Simple - Open Source e-Commerce
On 7/27/07, Jon Bennett <[EMAIL PROTECTED]> wrote: > > > is it really so bad? why not save to the database, then use cake built > in cache to speed things up? Why do you need to use a database to you cache? Besides I am not saying storing templates in database will slow down things - just make it more complex than needed. Tarique -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth component + Cake 1.2
I thought AuthComponent handled user login and logout on its own, validating username/password pairs and thus I saw no reason to use a validLogin function on the model as you did. But: AuthComponent won't log me in with an invalid password for a given username, but what is freaking me out is that it logs me in with any username/password combination (even both blanks) that are not in the database... incidentally, it logs me in with a user id of '1', which means I turn into admin without even specifying a name or password. So, I'm damn sure I'm missing some very crucial information on how AuthComponent is supposed to be used. Could anyone tell what am I doing wrong? My users controller: Auth->user('id'); if (!empty($user_id) && $this->Session->valid()) { $this->Session->setFlash(__('Already logged in', true), 'message', array('class' => 'error')); $this->redirect('/'); exit(); } if (!empty($this->data)) { if (!$this->Auth->login($this->data)) { $this->Session->setFlash(__('Login failed', true), 'message', array('class' => 'error')); } else { $this->flashRedirect(__('Welcome', true), '/'); } } } function logout() { $this->Auth->logout(); $this->flashRedirect(__('Logged out', true), '/'); } } And App Controller: Auth)) { $this->Auth->fields = array('username' => 'email', 'password' => 'password'); $this->Auth->userModel = 'Usuario'; $this->Auth->loginAction = array('controller'=>'usuarios', 'action'=>'login'); $this->Auth->loginRedirect = array('controller'=>'usuarios', 'action'=>'index'); } parent::beforeFilter(); } function flashRedirect($message, $url = array(), $class = 'info') { $this->Session->setFlash($message, 'message', array('class' => $class)); $this->redirect($url); exit(); } } The user login view: create('Usuario', array('action'=>'login'))?> input('Usuario.email')?> input('Usuario.password', array('type'=>'password', 'value'=>''))?> submit('Entrar')?> end()?> On 21 jun, 10:24, danfreak <[EMAIL PROTECTED]> wrote: > Dunno why but I can't post in the original thread. > > original thread=> " new auth component in cake 1.2 > "http://groups.google.com/group/cake-php/browse_frm/thread/f2d0143c2e5... > > My 2 cents about the new Auth component (Cake 1.2.0.5146alpha) > > It stores encrypted passwords in the DB when you add/edit a new user. > > Let's start with the users controller: > > -- > users_controller.php > -- > class UsersController extends AppController { > > var $name = 'Users'; > var $helpers = array('Html', 'Form', 'Session'); > var $components = array('Auth', 'Session'); > > function beforeFilter() > { > //actions we allow without authentication, you can also put > them in the app_controller.php >$this->Auth->allow('index', 'register', 'login', 'logout'); > } > > function login() > { > //user already logged in? > //checking if session has been written > $user_id = $this->Auth->user('id'); > if (!empty($user_id) && $this->Session->valid()) > { > $this->Session->setFlash('You are already logged in'); > $this->redirect(array('action'=>''), null, true); > } > else > { > if(!empty($this->data)) > { > //calling login validation validLogin() in model > if($this->User->validLogin($this->data)) > { > if($this->Auth->login($this->User->user)) > { > $this->Session->setFlash('You have > successfully logged in'); > $this->redirect(array('action'=>''), null, > true); > } > else > { > $this->set('password', null); > $this->set('auth_msg', 'Please try again'); > } > > } > } > else > { > $this->set('auth_msg', 'Please enter your username and > password'); > } > } > > } > > function logout() > { > $this->Session->destroy('user'); > $this->Session->setFlash('You\'ve successfully logged out.'); > $this->redirect(array('action'=>'login'), null, true); > } > > -- > MODEL-> user.php > the model has just
Re: Announcing Selling Made Simple - Open Source e-Commerce
> > SMS's main audience will not necessarily be CakePHP developers as all > > of the templates will be database stored. > > I don't get the connection between the two - if you are storing the > templates in database just so that they can be easily editable by users I > would say please think again... the added complexity is not worth the > feature added, also it makes it difficult for the theme designers to work on > templates (i do presume you will have themes?) > > If you really want web based editing - take the approach which some popular > CMSs take - read and write to files... is it really so bad? why not save to the database, then use cake built in cache to speed things up? I ask as I have a project that requires similar functionality and that was how I was intending to do it. jb -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake + Drupal
I've been reading up about drake, looks good. But im wondering if there is a way to get login information from drupal in a secure way, you mentioned on March 8, 2007 2:30 pm that you might be adding "new Drake callables so you can get information such as: current user log in, etc.". Has this happened? Many thanks, Alex On Jul 26, 8:26 pm, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > http://dev.sypad.com/projects/drake > > The magic of Google! > > -MI > > --- > > 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 enkara > Enviado el: Jueves, 26 de Julio de 2007 04:03 p.m. > Para: Cake PHP > Asunto: Cake + Drupal > > Hi, I want to use Cake and Drupal for my site but I can't find any > tutorial that teaches me in how to do this. I just don't know how > start and if I can use cake only in separate way or I can use cake > inside of drupal files like page.tpl.php (inside a theme). > > If you could tell me a page where this is explained... It seems very > strange tom e that there isn't this kind of information. I would be > happy if there where an example to follow. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 Model classes supposed to be singletons?
I'm not sure if it was me doing something wrong, but I found an annoying side-effect of this. If you want to dynamically bind associations, binding occurs on the entire model - which is shared. So if you have: class Company extends AppModel { var $hasOne = array( 'Logo' => array('className' => 'Image', 'foreignKey' => 'owner_id', 'conditions' => 'Logo.type=\'logo\' AND Logo.owner_type= \'company\''), 'Map' => array('className' => 'Image', 'foreignKey' => 'owner_id', 'conditions' => 'Map.type=\'map\' AND Map.owner_type=\'company\''), ) } then inside companies_controller you do: $this->Company->Logo->bindModel(array('belongsTo' => array(...))); This affects both $this->Company->Logo and $this->Company->Map, since they are the same model. Still, this really wasn't thought out and might be down to my bad design in the first place - I was only experimenting. On 26 Jul, 20:09, bingomanatee <[EMAIL PROTECTED]> wrote: > The opportunity for caching model objects as singletons in the > ClasssRepository exists; is there any reason why this should NOT be > done? Can this create any conflicts that might sabotage your code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Apply behavior only for certain model methods?
On 7/27/07, AD7six <[EMAIL PROTECTED]> wrote: > > > Damn. I misunderstood what you meant slightly. But I still don't like > copying cake's logic into the app to achieve it ;). Ah! I misunderstood you as well may be future code will have a better way T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Apply behavior only for certain model methods?
On 7/27/07, AD7six <[EMAIL PROTECTED]> wrote: > On Jul 27, 9:11 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > > On 7/27/07, AD7six <[EMAIL PROTECTED]> wrote: > > > > > That's a lot of code ;), do you have an example of when you would want > > > to attach a 'new' behavior to a model as opposed to turn a behavior > > > that the model has on and off? > > > > Yes - conditional post processing of uploaded image files depending on > > method chosen(GD, IM, NetPBM) and image file type > > > > :) > > I read the post ;) If you are referring to Amit's statement of "Why not..." then I would say that we do write *not useful now* code at times when we feel like it I don't see nowActsAs used in cheesecakes source. It has not been used as yet... > I hope cake's behavior processing doesn't change too much ;)). For > example the code does not unset the behavior instances in dontActsAs > so the 'state' of the model will not be the same compared to not > having the behavior declared in the model. May be we will add the code for that - but right now it works as advertised > Anyway, hope you don't mind the discussion. Not at all - you are helping me advertise my shameless plug ;) Cheers Tarique -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Apply behavior only for certain model methods?
On Jul 27, 9:11 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 7/27/07, AD7six <[EMAIL PROTECTED]> wrote: > > > That's a lot of code ;), do you have an example of when you would want > > to attach a 'new' behavior to a model as opposed to turn a behavior > > that the model has on and off? > > Yes - conditional post processing of uploaded image files depending on > method chosen(GD, IM, NetPBM) and image file type Damn. I misunderstood what you meant slightly. But I still don't like copying cake's logic into the app to achieve it ;). AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Apply behavior only for certain model methods?
On Jul 27, 9:11 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 7/27/07, AD7six <[EMAIL PROTECTED]> wrote: > > > That's a lot of code ;), do you have an example of when you would want > > to attach a 'new' behavior to a model as opposed to turn a behavior > > that the model has on and off? > > Yes - conditional post processing of uploaded image files depending on > method chosen(GD, IM, NetPBM) and image file type > > :) I read the post ;) I don't see nowActsAs used in cheesecakes source. Conditional upload accounts for disabling a behavior (maybe, shouldn't it only act if appropriate data is present/absent? E.g. There is an assumption in the file behavior that every save contains a file) but not adding a new behavior. I hope cake's behavior processing doesn't change too much ;)). For example the code does not unset the behavior instances in dontActsAs so the 'state' of the model will not be the same compared to not having the behavior declared in the model. Anyway, hope you don't mind the discussion. Cheers, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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: Apply behavior only for certain model methods?
On 7/27/07, AD7six <[EMAIL PROTECTED]> wrote: > That's a lot of code ;), do you have an example of when you would want > to attach a 'new' behavior to a model as opposed to turn a behavior > that the model has on and off? Yes - conditional post processing of uploaded image files depending on method chosen(GD, IM, NetPBM) and image file type :) T -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Apply behavior only for certain model methods?
On Jul 27, 8:54 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 7/27/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote: > > > > > Say, if Model has two methods, Model::add() and Model::save() and a > > "foo" behavior is added to the "Model". Currently the foo behavior is > > getting triggered for every Model access. Is there anyway to limit the > > trigger--say, only for Model::add()? > > Tryhttp://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-ru... That's a lot of code ;), do you have an example of when you would want to attach a 'new' behavior to a model as opposed to turn a behavior that the model has on and off? Cheers, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---