namespace app\models;
class User extends Model {
foo() { }
}
<?php
use app\models\User;
class ControllerComments extends Controller {
User::foo();
}
Class 'app\models\User' not found
namespace app\models;
class User extends Model {
public static function foo() { echo "I've called by a controller!"; }
}
use \app\models\User;
class ControllerComments extends Controller {
public function __construct() { User::foo(); }
}
$test = new ControllerComments();