[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comments on the new architecture
From: |
Klaus Weiss |
Subject: |
Re: Comments on the new architecture |
Date: |
Mon, 07 May 2007 18:09:47 +0200 |
Next update!
It is now possible to validate user input in an easy manner. Here is a
short example:
Every controller can access the variable $this->data, which is an
special data array. It can has the following structure:
Array
{
['GET'] => Array
{
['lang'] => 'en_EN',
['foo'] => 'bar'
...
}
['User'] => Array
{
['email'] => 'address@hidden',
['password'] => '0xdeadbeef',
...
}
...
}
The former entry comes obviously from HTTP GET. The latter is more
interesting here. 'User' is actually a model which is described in a
model file inside /site/model/.
The User model contains the following array:
public $validate = array('email' => VALID_EMAIL,
'password' => VALID_NOT_EMPTY);
It is pretty straightforward what that means. If a validation fails on a
specific field the entry in the $this->data array is changed to false.
In addition a error trigger is called if someone is found.
To see how forms are build and error triggers created look at the
default.html.
- Comments on the new architecture, Davi Leal, 2007/05/06
- Re: Comments on the new architecture, Klaus Weiss, 2007/05/06
- Re: taking a break, Davi Leal, 2007/05/06
- Re: Comments -- With or without Microsoft server support, Davi Leal, 2007/05/06
- Re: Comments -- flexibility vs complexity, Davi Leal, 2007/05/06
- Re: Comments -- Copyright policy, Davi Leal, 2007/05/07
- Re: Comments on the new architecture,
Klaus Weiss <=
- Re: Comments on the new architecture, Klaus Weiss, 2007/05/07
- Re: Comments -- UML 2.x (XMI format), Davi Leal, 2007/05/07
- Re: Comments -- Smarty, Davi Leal, 2007/05/07
- Re: Comments -- Persistence Framework, Davi Leal, 2007/05/07
- Re: Comments on the new architecture, Davi Leal, 2007/05/08
- Re: Comments -- The format of the License and Copyright text, Davi Leal, 2007/05/08
- Re: Comments -- Indentation, Davi Leal, 2007/05/08
- Re: Comments -- Indentation, Antenore Gatta, 2007/05/08
- Re: Comments -- Indentation = TAB characters, Davi Leal, 2007/05/08
- Re: Indentation for emacs, Davi Leal, 2007/05/09