mysql - Php and Controller: Browser don't find Base Controller -


i'm doing app , i'm using base controller create others ones. when launch controller see error:

fatal error: class 'basecontroller' not found in c:\xampp\htdocs\sfitness\api\1-dev\controllers\peoplecontroller.php on line 3 

the problem in same folder i've basecontroller.php

following send peoplecontroller.php:

<?php  class peoplecontroller extends basecontroller {      public function processgetrequest($request) {         $result = null;         $result = $this->_model->getallathletes();            return $result;      } }  ?> 

following basecontroller.php

<?php  abstract class basecontroller {      public $_model;      public function __construct() {         $this->_model = new model();     }  } ?> 

how can resolve problem? what's problem?

thanks much

you should import other file php can see it; in peoplecontroller, following:

 <?php require_once "basecontroller.php";  class peoplecontroller extends basecontroller  {      public function processgetrequest($request)      {          $result = null;          $result = $this->_model->getallathletes();             return $result;      } }  ?> 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -