Changeset 753

Show
Ignore:
Timestamp:
09/04/08 15:30:31 (3 months ago)
Author:
camper
Message:

Form: some properties made protected/FreeForm added along with Form_Field_Free/FreeForm template added

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/Form.php

    r748 r753  
    1010 */ 
    1111class Form extends AbstractView { 
    12     private $form_template = null; 
    13     private $form_tag = null; 
     12    protected $form_template = null; 
     13    protected $form_tag = null; 
    1414    public $errors=array(); 
    1515                            // Here we will have a list of errors occured in the form, when we tried to submit it. 
     
    1919                            // Those templates will be used when rendering form and fields 
    2020 
    21     private $data = array(); // This array holds list of values prepared for fields before their initialization. When fields 
     21    protected $data = array(); // This array holds list of values prepared for fields before their initialization. When fields 
    2222                            // are initialized they will look into this array to see if there are default value for them. 
    2323                            // Afterwards fields will link to $this->data, so changing $this->data['fld_name'] would actually 
  • trunk/lib/Form/Field.php

    r748 r753  
    242242        return "<$tag ".join(' ',$tmp).$postfix.">".($value?$value."</$tag>":""); 
    243243    } 
     244} 
     245 
     246 
     247class Form_Field_Free extends Form_Field{ 
     248        function init(){ 
     249                parent::init(); 
     250                // free field template is the whole content of its tag 
     251                //$this->content=$this->owner 
     252        } 
     253        function render(){ 
     254                $this->template->trySet('value',$this->get()); 
     255                $this->output($this->template->render()); 
     256        } 
    244257} 
    245258