Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (32 sloc) 1.07 KB
* Page class
class page_core_form extends Page
public $title='Basic Form Usage';
function init()
$this->add('View_Info')->setHTML('This example is created to clarify <a href="">'.
'this StackOverflow post</a>, which illustrates how a good framework can make your code very intuitive and easy to read. '.
'<a href="">See Source</a>');
$form = $this->add('Form');
$form->setModel('Employee', ['name','salary']);
if ($form['salary'] < 100) {
return $form->displayError('salary', 'Too little');
return 'Employee added';
class Model_Employee extends Model {
function init(){
$this->addField('name')->caption('Full Name');