php - I am unable to initialize a property of a class in OPP -


very quick question. how initialize property in class.

i trying use property class; wish use in zend form keep error message;

notice: undefined property: ep_tableproductssample::$comments 

below context in attempted use property $comments

you note transferred table class zend form class , attempted access $comments variable.

i able access variable if property has value; however, run problems when property not have value.

i tried initializing class , property such:

 class ep3d_form_product_productsample extends ep3d_form_abstract { private $_samplesoure = '';  private $comments =''; 

i attempted use class such:

 ->setvalue($this->_samplesource->comments) 

i.e:

 $e = new zend_form_element_textarea('comments');   $e    ->setlabel('comments:')    ->setdecorators($this->_buttondecorators)    ->setattrib('rows', 3)    ->setvalue($this->_samplesource->comments)     ->setattrib('cols', 100);    $this->addelement($e); 


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -