Why remove the "class" attribute of hidden inputs

2010-04-03 Thread Jimmy Bourassa
Why does the FormHelper automatically removes the "class" attribute for hidden input? At first I thought it was a bug but looking in the core is quite explicit, the 'class' attribute is being excluded from allowed tags : $this->_parseAttributes($options, array('name', 'class'), '', ' ') The cl

Re: updateAll problem in 1.3RC1

2010-03-10 Thread Jimmy Bourassa
Yes, it is documented in 1.2. "The $fields array accepts SQL expressions. Literal values should be quoted manually." from http://book.cakephp.org/view/75/Saving-Your-Data On 10 mar, 10:34, Ernesto wrote: > Hello > > $this->Order->updateAll(array("date_purchase" => date("Y-m-d H:i:s")), > array("

Re: Checking RequestHandler::isPost() vs Controller's data

2010-03-10 Thread Jimmy Bourassa
andler, but it has been buggy sometimes. > > On Mar 9, 6:10 pm, Jimmy Bourassa wrote: > > > Hello, > > > I realized that everyone seems to do an empty() call on $this->data in > > controllers in order to check if data has been posted or not. > > > Is it

Checking RequestHandler::isPost() vs Controller's data

2010-03-09 Thread Jimmy Bourassa
Hello, I realized that everyone seems to do an empty() call on $this->data in controllers in order to check if data has been posted or not. Is it just me or RequestHandler::isPost yields better results? This would allow to pre-fill Controller::$data in various situations. Thanks, Check out the

Re: German characters problem using UTF-8 encoding.

2009-10-17 Thread Jimmy Bourassa
Hello CapeTownGuy, If you're seeing question marks you probably aren't setting the proper HTML charset. Either change the charset or use $html->charset() in your layout. Also, make sure your pages (the ctp files in app/views/pages) are properly encoded; set the file encoding to what you want to

Re: One database scheme running multiple web applications

2009-06-18 Thread Jimmy Bourassa
original bootstrap.php for instructions. On 18 juin, 12:58, Jimmy Bourassa wrote: > Hello, > > I am building a web application that will share data with another > CakePHP app (MySQL database). More specifically, I would like to share > some Models and maybe behaviors/helpers/components

Re: confused on the controller set method

2009-06-18 Thread Jimmy Bourassa
You cannot use $this->set in this situation because your are redirecting the user; all data that you 'set' through your controller will be lost. You would have to use the session or the URL in order to pass this information. On 18 juin, 12:26, gfs wrote: > Being new to CakePHP I am stuck on som

One database scheme running multiple web applications

2009-06-18 Thread Jimmy Bourassa
Hello, I am building a web application that will share data with another CakePHP app (MySQL database). More specifically, I would like to share some Models and maybe behaviors/helpers/components. Since the two app has entierly different logic, I would like to create different controllers and view

Missing Http::Controller when accessing through a proxy.

2009-04-07 Thread Jimmy Bourassa
Hello, I have been testing my application through a proxy because I do some IP based stuff. I got the following error on my home page : Missing Controller Error: Http:Controller could not be found. Error: Create the class Http:Controller below in file: app/controllers/ http:controller.php I

Re: beginning Ajax with cakephp 1.2

2009-04-03 Thread Jimmy Bourassa
Krish, I have not used it really myself so far, but since you asked for starting points I might as well feed you with some links. Teknoid wrote some a couple articles on using jQuery with CakePHP : http://teknoid.wordpress.com/2009/01/19/jquery-in-the-cakephp-world-part-1/ http://teknoid.wordpres

Re: Add to result array in controller

2009-04-02 Thread Jimmy Bourassa
Of course, it works. But that's not very MVC like in my opinion, the color of the status only has to do with the way you'll view things, it is in no way related to your data manipulations. You're also loading extra stuff in memory by adding that css class value for every item of your find - not t

Re: Add to result array in controller

2009-04-01 Thread Jimmy Bourassa
Your color really should be a CSS class. Since you only need the color in your views, I'd put that bit of logic in a view, where it truly belongs. You could just extend your app view with your getStatusColour function and call this function in whatever kind of loop you'll use in your views. I ho

Re: Disable cache for particular process in controller

2009-03-26 Thread Jimmy Bourassa
the site's action, which has a view with the > requestAction call (and there I need that model) > > Does anybody have any idea, how to solve this? Why when I unbind a > model from one action it gots unbinded in another too? Is it because > of the requestAction? > > On Mar 26

Re: Disable cache for particular process in controller

2009-03-26 Thread Jimmy Bourassa
Did you end up solving your problem? If so, what did you do? You made me realize the views counter we wrote in one of our app does not work, :( I'm not a fan of the requestAction thingy, doesnt it load a full instance of CakePHP just for one extra request? On 24 mar, 05:35, depi wrote: >  Hi C

Re: Validate multiple record without saving

2009-03-19 Thread Jimmy Bourassa
Wow, thanks a million. To answer your question, I'm using a wizard (Wizard Component to be specific) for an "add" action. Since the data is stored on every step but only "saved" in the last step of the wizard, I want to validate on every step for obvious reasons. Thanks again :) On 19 mar, 22:0

Validate multiple record without saving

2009-03-19 Thread Jimmy Bourassa
Hello, I'm trying to validate multiple records from one single form (using $form->input('Model.X.Field'), but I don't want the records to be saved if the validation success. So far, I was using Model::validates to validate my fields, but this method only returns invalid fields for one record. I

Re: Why we cann't use Auth component in AppController?

2009-03-04 Thread Jimmy Bourassa
Well, the short answer is that you can. There must be something wrong in your code, because I use the Auth in both appController and other controllers quite often. You should show us some of your code so we can help. On 4 mar, 10:01, Joshua wrote: > It seems that if I use Auth component in AppC

Re: Should I have session operation in the view file or in the controller file?

2009-02-23 Thread Jimmy Bourassa
While I agree with AD7six that a this question can only be answered in context, I think that most of the time you should try to limit your session manipulations to the controller when it comes down to logic. If you're only trying to output something from the session (a connected user's username fo

Re: example of paginate with search form(type=>post)

2009-02-15 Thread Jimmy Bourassa
I didn't read all of the code, but basically I like Mile J's way better (and that's the way I have been doing it myself). The problem with saving stuff in the session is that a) You can't bookmark (but just like you said, oh well ;)) b) You can't have multiple search running in multiple tabs/wind

Re: Problem with "multiple display fields" behavior, trying to use Joins

2009-01-07 Thread Jimmy Bourassa
gt;Autorisation->Evaluation->Utilisateur, or $this->Evaluation- > >Utilisateur > > On Dec 26 2008, 2:05 pm, Jimmy Bourassa wrote: > > > Hello, > > > I'm trying to get the multiple display fields behavior to work using > > Cosmin Cimpoi's versio

Re: Problem with "multiple display fields" behavior, trying to use Joins

2009-01-06 Thread Jimmy Bourassa
Bump? :( On 26 déc 2008, 17:05, Jimmy Bourassa wrote: > Hello, > > I'm trying to get the multiple display fields behavior to work using > Cosmin Cimpoi's version (comment #7 from the bakery > :http://bakery.cakephp.org/articles/view/multiple-display-field-3#comm...).

Problem with "multiple display fields" behavior, trying to use Joins

2008-12-26 Thread Jimmy Bourassa
Hello, I'm trying to get the multiple display fields behavior to work using Cosmin Cimpoi's version (comment #7 from the bakery : http://bakery.cakephp.org/articles/view/multiple-display-field-3#comment-3114). Everything works fine if I'm not trying to fetch data from belongsTo associations. But

Re: One controller for multiple models - Or any better design?

2008-10-11 Thread Jimmy Bourassa
/view/creating-reusable-elements-wi... > > However, many people advise against using (abusing?) requestAction as > it executes a whole new page request. > > If you cache the output however, it can be a good technique. > > Cheers, > Adam > > On Oct 1, 9:59 am, Jimmy Bourass

One controller for multiple models - Or any better design?

2008-09-30 Thread Jimmy Bourassa
I've been thinking about how to do this cakelike and so far I haven't found anything that is not messy (and mostly because I am fairly new to cake should I say) Heres what I would like to do. I have Games and Events. On my homepage, I want a "Coming up" section to show, let's say, the next five e