Use of undefined constant ADMIN - assumed 'ADMIN'

bendlox

New Member
I'm getting the error \[code\]Use of undefined constant NORMAL - assumed 'NORMAL'\[/code\] when running my code, I can't find anything wrong with th code\[code\]var $type; const NORMAL=1; const ADMIN=2; public function getTypeOptions(){ return array( self::NORMAL=>'Normal', self::ADMIN=>'Administrator', ); } public function getTypeText(){ $options[NORMAL]; $options[ADMIN]; $options=$this->getTypeOptions(); return $options; } public function getTypeByText($type){ $options = $this->getTypeText(); if($type == 1){ return $options[1]; }else if($type == 2){ return $options[2]; } }\[/code\]I get this everytime I call the getTypeByText method the value of type = 2
 
Back
Top