PHP: <?php namespace App\Controllers\Admin\Configuration; /* * Создан контроллер * * */ use System\Http\Controller\Controllers; class Demon extends Controllers { public function index () { $this->prepareData('Admin\Configuration\Demon->index', 'configuration'); $this->executeData('conf/demon', '/Admin'); } } Вот ошибка Код (Text): Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in /var/www/y-car.ru/App/Controllers/Admin/Configuration/Demon.php on line 2 В переводи говорит, что это нужно объявлять первым, а куда бл. ещё первее то! Не хера не пойму.
PHP: <?php /** * Created by PhpStorm. * User: askanim * Date: 12.08.2016 * Time: 11:03 */ namespace App\Controllers\Admin\Configuration; use System\Http\Controller\Controllers; class Demon extends Controllers { public function index() { $this->prepareData('Admin\Configuration\Demon->index', 'configuration'); $this->executeData('conf/demon', '/Admin'); } } Создал через phpstorm класс.... И в чём мать его отличие. Пойду ща открою файл в линуксе, может внатуре BOM спрятался --- Добавлено --- Вот жешь, с.ка. Внатуре, там <?php со второй строки начинается, а не с первой. А создал класс вот так. PHP: private function createController($direct, $classDirect, $class, $name_template) { $class = ucfirst($class); $classdir = $direct.$class.'.php'; if (file_exists($classDirect)) { unlink($classDirect); } $fp = fopen($classdir, 'w+'); chmod($classdir, 0777); chmod($classdir, 0666); fwrite($fp, '<?php namespace '.$classDirect.'; /* * Создан контроллер * * */ use System\Http\Controller\Controllers; class '.$class.' extends Controllers { public function index () { $this->prepareData(\'Admin\\Configuration\\'.$class.'->index\', \'configuration\'); $this->executeData(\'pages/page'."/".$name_template.'\', \'/Admin\'); } } '); }