Welcome Guest, Not a member yet? Register   Sign In
Parse error: syntax error, unexpected '::'
#1

Hello, 
I defined constants in Otobil_model.php
PHP Code:
class Otobil_model extends MY_Model
{

 
   const INDIVIDUAL_TYPE 'INDIVIDUAL';
 
   const CORPORATE_TYPE 'CORPORATE';


Then in Controller I am trying to access these constants:
PHP Code:
class Otobil extends Public_Controller
{
 
   function __construct()
 
   {
 
       parent::__construct();
 
       $this->load->model('otobil_model');
 
   }

 
   public function apply()
 
   {
 
       $type $this->otobil_model::CORPORATE_TYPE;     
 
   }


I am getting " Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in \application\controllers\Otobil.php on line 36"

Anybody has idea why I am getting this error? 
I already did this in my other projects, but now I am getting this error...
Reply


Messages In This Thread
Parse error: syntax error, unexpected '::' - by neuron - 02-18-2019, 07:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB