Hello,
I’m very new to yii and everything went smooth so far. I’m really satisfied with the learning-curve of this framework.
But now I stumbled upon a problem that I don’t understand.
I’ve created a subdirectory called “api” in the protected/controllers/ folder with an UserController in it.
It looks like:
protected/
--------- controllers/
-------------------- api/
------------------------ UserController.php
in config/main.php I’ve added that folder to the autoloader:
'import'=>array(
'application.models.*',
'application.components.*',
'application.controllers.api.*',
),
I’ve also setup two rules for it in the urlmanager:
'rules'=>array(
'api/<version:\d\.\d>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'api/<controller>/<action>',
'api/<version:\d\.\d>/<controller:\w+>/<action:\w+>'=>'api/<controller>/<action>',
),
When accessing the url /api/1.0/user/login yii tolds me that the action user can’t be found.
Any idea what’s happening? For me it looks like yii tries to access “api” as Controller and <controller> as action.