PHP, Fatal error: Call to undefined method, why?

cassino

New Member
I have a simple php structures.class Ingredient and class Ingredients, i have this code:\[code\]class Ingredient{ public function objectIsValid() { return $validate[0]; }}class Ingredients{ public $ingObject; function __construct(){ $ingObject = new Ingredient(); } public function validateData() { if($this->ingObject->objectIsValid() /*** THE ERROR ***/) { echo "OK";} else { echo "NOT";} } }$Ingridients = new Ingredients();$Ingridients->validateData();\[/code\]I just can't understand why do i get the error..any help will be appreciated.thanks!
 
Back
Top