Functions

2008-04-08 Thread stefanb
Where is one supposed to put generally applicable functions that should be available throughout the application, or better still; across several applications? What I would prefer is to have a class, or several classes, containing static functions, like: ?php class StringFunctions { public

Re: Modules?

2007-10-11 Thread stefanb
... and yet you took the time to answer my basic question. How will I then learn the lesson? ;) On Oct 11, 12:41 pm, Marcin Domanski aka kabturek [EMAIL PROTECTED] wrote: On Oct 10, 3:24 pm, stefanb [EMAIL PROTECTED] wrote: Thank you for the second half of your reply. The first half didn't

Re: Modules?

2007-10-11 Thread stefanb
So a plugin is not the same as a module? Now I'm confused. On Oct 11, 12:43 pm, dardosordi [EMAIL PROTECTED] wrote: Though the first half is the correct one. On Oct 10, 10:24 am, stefanb [EMAIL PROTECTED] wrote: Thank you for the second half of your reply. The first half didn't help me

Re: Modules?

2007-10-11 Thread stefanb
] On Behalf Of stefanb Sent: 11. oktober 2007 13:39 To: Cake PHP Subject: Re: Modules? So a plugin is not the same as a module? Now I'm confused. On Oct 11, 12:43 pm, dardosordi [EMAIL PROTECTED] wrote: Though the first half is the correct one. On Oct 10, 10:24 am, stefanb [EMAIL

Re: Modules?

2007-10-11 Thread stefanb
Thank you, finally a reasonable answer! :) On Oct 11, 3:32 pm, savagekabbage [EMAIL PROTECTED] wrote: You can consider plugins to be modules of CakePHP as they are built to be able to integrate with any Cake installation. On Oct 11, 7:39 am, stefanb [EMAIL PROTECTED] wrote: So a plugin

Re: Modules?

2007-10-11 Thread stefanb
true -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of stefanb Sent: 11. oktober 2007 13:39 To: Cake PHP Subject: Re: Modules? So a plugin is not the same as a module? Now I'm confused. On Oct 11, 12:43 pm, dardosordi [EMAIL PROTECTED

Re: Validation rules and error messages

2007-10-10 Thread stefanb
So you're saying I should put HTML and javascript code in my model too. All I need in my view is a variable sent from the model containing the display code, and echo that out... On Oct 10, 1:58 am, abba bryant [EMAIL PROTECTED] wrote: That isn't accurate either. The model can set any data it

Modules?

2007-10-10 Thread stefanb
Does Cake support the use of modules? www.example.com/module/controller/action/var1/val1/var2/val2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Modules?

2007-10-10 Thread stefanb
[mailto:[EMAIL PROTECTED] On Behalf Of stefanb Sent: 10. oktober 2007 10:36 To: Cake PHP Subject: Modules? Does Cake support the use of modules? www.example.com/module/controller/action/var1/val1/var2/val2 --~--~-~--~~~---~--~~ You received this message

Re: Validation rules and error messages

2007-10-10 Thread stefanb
said data and to format and mark it up how you would like. Abba stefanb-3 wrote: So you're saying I should put HTML and javascript code in my model too. All I need in my view is a variable sent from the model containing the display code, and echo that out... On Oct 10, 1:58 am, abba

Re: Validation rules and error messages

2007-10-09 Thread stefanb
So, I take it this is not possible in Cake? On Oct 7, 7:46 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Oct 6, 11:24 pm, stefanb [EMAIL PROTECTED] wrote: How can I fetch the validation parameters from my models? snip You may check related links inhttp://groups.google.com

Re: Validation rules and error messages

2007-10-09 Thread stefanb
Yes, but according to the MVC pattern, what the user sees (like error messages) really is supposed to go into the view, not the model... On Oct 9, 8:09 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 10/6/07, stefanb [EMAIL PROTECTED] wrote: In my view: $form-input('name', array('type

public function, but not action

2007-10-09 Thread stefanb
Hi, How can I specify that a public function in a controller should NOT be an action? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com

Re: public function, but not action

2007-10-09 Thread stefanb
... _functionName() {} On Oct 9, 12:43 pm, stefanb [EMAIL PROTECTED] wrote: Hi, How can I specify that a public function in a controller should NOT be an action? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Best/proper way to save HABTM?

2007-10-07 Thread stefanb
What is the proper/best way to save HABTM? This is what I have: Resources HABTM Categories I save the Resource like this: $this-Resource-save($this- data['Resource']); But how do I save the categories? --~--~-~--~~~---~--~~ You received this message because

Validation rules and error messages

2007-10-06 Thread stefanb
How can I fetch the validation parameters from my models? Example: I have a field with maxLength set to 20, and I want to display an error message like This field can only be 20 characters long. Now, if I update the validation rule in my model to allow max 30 chars, I need to update my view as

Checkboxes instead of multiple select

2007-10-06 Thread stefanb
Is it possible to use checkboxes instead of a multiple select to represent data in a many-to-many relation? I have a categories table connected to a resources table via a categories_resources table, and have set up the HABTM relations in the two models. Now, in my resource add/edit views, I

Re: Objects instead of arrays

2007-10-04 Thread stefanb
Still get the same error. I'll just wait for Cake 2 On Oct 3, 3:56 pm, gwoo [EMAIL PROTECTED] wrote: function beforeRender() { $this-data = Set::reverse($this-data); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Objects instead of arrays

2007-10-03 Thread stefanb
Hello, Is there a way to access data from my models as objects instead of arrays? // In my view: foreach ( $categories as $category ) { echo $category-name; // I want this echo $category['Category']['name']; // Instead of this } --~--~-~--~~~---~--~~ You

Re: Objects instead of arrays

2007-10-03 Thread stefanb
Yes, and I found this: http://groups.google.com/group/cake-php/browse_thread/thread/a1699f504009f873/439d3756be935f9c?lnk=gstq=objects+arraysrnum=6#439d3756be935f9c There is no such functionality available in CakePHP so you have to write it yourself. But that post was written in February, so I

Re: Objects instead of arrays

2007-10-03 Thread stefanb
Well, that didn't seem to work: Fatal error: Cannot use object of type stdClass as array in C:\xampp \htdocs\cake\cake\libs\view\helpers\form.php on line 136 Is there a way to set objectify = true in just one place, and have everything work just fine? Or will I have to write objectify=true /

Why are all properties public?

2007-10-01 Thread stefanb
Why are all properties public? Why doesn't Cake use private properties and public get/set methods so that encapsulation is achieved? Or did I miss something here? - stefanb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Why are all properties public?

2007-10-01 Thread stefanb
@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of stefanb Sent: 1. oktober 2007 09:19 To: Cake PHP Subject: Why are all properties public? Why are all properties public? Why doesn't Cake use private properties and public get/set methods so that encapsulation is achieved? Or did I miss something

Re: Why are all properties public?

2007-10-01 Thread stefanb
, stefanb [EMAIL PROTECTED] wrote: Yes, but couldn't set/get methods still have been implemented, so that Cake would be forward compatible? To what benefit (apart from bloat)? There is nothing stopping you from defining fields to be private, or writing get/set methods if you must. Cheers

Re: Why are all properties public?

2007-10-01 Thread stefanb
This is what I would like to do: private $validate = array(); public getValidate() { return $this-validate; } But I can't see how that would be possible (without modifying Cake itself, that is...) On 1 Okt, 16:17, AD7six [EMAIL PROTECTED] wrote: On Oct 1, 2:48 pm, stefanb [EMAIL PROTECTED

Re: Why are all properties public?

2007-10-01 Thread stefanb
Even if getters and setters really were evil (which I don't agree upon), wouldn't public properties have to be even more so? Anyway, seems to me that there is no way around this at the moment? On 1 Okt, 19:42, gwoo [EMAIL PROTECTED] wrote: a