Quantcast
Channel: Posts/rss
Browsing all 34 articles
Browse latest View live

Comment from Brian Katzung

Regarding templating vs PHP tags (from June 26, 2006): I came to PHP from Perl, so it was natural for me to think in terms of heredocs: echo <<<HTML<title>$title</title> HTML;...

View Article



Comment from Norm

Say if you want to use $validates but not worry about every field in the $validates array being required. Do something along these lines in your model: function beforeValidate(){...

View Article

Comment from Jonathan Snook

If you don't have anything in $this->data, are you sure the form is set up correctly? It's hard to say but if you haven't already, check out the Google group and post your question there. You'll...

View Article

Comment from Harro

I seem to have a problem accessing $this->data[] in the model. Do you know what this issue could be? Thanks, great work your doing here.

View Article

Comment from Jonathan Snook

@Marko: likely with the next alpha release of 1.2 you should be able to do custom messages with custom validation. It should be sweet.

View Article


Comment from Marko Samuli Kirves

Invalidation from the controller did not work in 1.2. Saving the model clears fields in validationErrors array. I solved this by setting new validation rules that fail with custom messages if I found...

View Article

Comment from Jim Zaghini

Thanks mate, You have saved my feeble brain. It will not be exploding today :)

View Article

Comment from Chris Hoeppner

I have written a custom validates routine that checks for any declared "validateFieldName()" functions and runs them, passing any error messages into an array called (doh!) $errorMessages. After all...

View Article


Comment from Jonathan Snook

Nick: those issues may be resolved in recent builds but wasn't when this article was posted. That's where I "got the idea".

View Article


Comment from Nick Busey

I don't know where you got the idea that you can't declare more than one requirement per field. The following is perfectly valid: class Profile extends AppModel { var $name = 'Profile'; var $validate =...

View Article

Comment from Jonathan Snook

Tobi: when using Modelname->save($data), it'll do an INSERT if it doesn't have a model ID and an UPDATE if it does. If you don't want the user to have to enter in the password you can either (A)...

View Article

Comment from Tobi

What I am asking myself is, how does cake handle the difference between an INSERT and an UPDATE? For example: I defined the password has to be filled, but by editing the form I don't want the user to...

View Article

Comment from Emil

Ok, I'm sorry - never really tried RoR. Just got amazed over Shopify when it was in beta. Larry & Jonathan: I'v started develop my own personal homepage/blog and I will do it without any template...

View Article


Comment from Dan

"RoR has liquid" Emil, RoR is using eRuby for views, which is ruby embedded in html. Liquid (which is a ruby port of the django templating) can be used as a plugin, and is basically only used when...

View Article

Comment from Jonathan Snook

Larry, re:short tags: agreed. The app I'm developing won't be for distribution. :)

View Article


Comment from Larry E. Masters

@Emil, One thing you will notice in cake is I have wrote the view class to allow an easy way to extend it. While I have no plans to add a templating system to cake itself, since PHP is a templating...

View Article

Comment from Jonathan Snook

I agree with your example, which is why I use the short form of <?=$title?>. Much more succinct.

View Article


Comment from Emil

Jonathan: Do you really think its no difference? I'v done 3-4 projects with template systems and I can't go back, the view code is much easier to read, especially when you have large view blocks. From...

View Article

Comment from Jonathan Snook

Emil: there really isn't a template system beyond what's part of the view system. However, you are certainly free to use another template system like Smarty along with CakePHP. There's a tutorial on...

View Article

Comment from Emil

Yesterday I downloaded cakephp, it seemed to be a nice framework (based on articles here at snook). The only problem I found was that they haven't included a template system. My current framwork is...

View Article
Browsing all 34 articles
Browse latest View live




Latest Images