php - Accessing CakePHP 3 Router Prefix -


i have problem. have installed cakephp 3 using ubuntu , want test router prefix

router::prefix('admin', function($routes) {   $routes->connect('/:controller/:action/*', [], ['routeclass' => 'cake\routing\route\inflectedroute']); }); 

i have followed steps in cookbook have appcontroller , userscontroller inside /src/controller/admin

src/controller/admin/appcontroller.php

<?php namespace app\controller\admin;  use cake\controller\controller;   class appcontroller extends controller{  public function initialize() {     parent::initialize();     $this->loadcomponent('flash'); }   }// end class  ?> 

src/controller/admin/userscontroller.php

<?php namespace app\controller\admin;  use cake\controller\controller;   class appcontroller extends controller{  public function initialize() {     parent::initialize();     $this->loadcomponent('flash'); }   }// end class  ?> 

http://i.stack.imgur.com/7rjkv.png

i have tried scenario using xampp in windows 8 , i've no problem. wonder if miss in configuration?

by way, followed steps on how utilize cakephp 3 in ubuntu (from proper installing of lamp, mbstring, intl, composer).

i appreciate answers. thanks!

you haven't followed steps described in cookbook exactly, subnamespace starts uppercase letter, exact, use camelcapsed version of prefix name, in case that's admin, in example.

if closely, that's error message tells you

error: create class userscontroller below in file: src/controller/admin/userscontroller.php

it works on windows because defaults filesystem case-insensitive.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -