Im assuming its not the first time you are using yii’s UrlManager
To set up, download the file attached, put it in your components folder or any other folder imported in your initial configuration
and then in your configuration options (configs/main.php probably) add the following line
'urlManager'=>array(
'class'=>'VerbUrlManager',//this line
//or 'class'=>'application.extensions.verburlmanager.VerbUrlManager'
how to use :
'rules'=>array(
//rules applied to all kind of requests if a specific verbs/method rule does not match/trigger first
'<_c:\w*>/<_a:\w+>/<id:\d+>'=>'<_c>/<_a>',
//rules for post requests
'@post'=>array(
'<_c:\w+>'=>'<_c>/create',
'<_c:\w+>/<id:\d+>'=>'<_c>/update',
),
//rules for put requests
'@put'=>array(
'<_c:\w+>'=>'<_c>/create',
'<_c:\w+>/<id:\d+>'=>'<_c>/update',
),
'@get'=>array(
'<_c:\w+>'=>'<_c>/list',
'<_c:\w+>/<id:\d+>'=>'<_c>/details',
'<_c:\w+>/<_a:\w+>/<q:\w+>'=>'<_c>/search',
),
//case insensitive
'@DELETE'=>array(
'<_c:\w+>'=>'error/400',
'<_c:\w+>/<id:\d+>'=>'<_c>/delete',
),
//rule is a string, which means that all requests go to a fixed route
'@HEAd'=>'error/501'
)
It would be right to create another post for your question
Anyway, this is how I would do it
the rules you use as described in the extension link or above, which is basically define routes for the different method’s type , for example if its a post and the url is /controller/3 route it to controller/update and $_GET[‘id’] would be 3
Create a class to parse the xml the way that fits your service better
in the actions in your controller do something like :
if(ispost()){
$xml=MyXmlParser::parsePost($_POST);
//do something here with the xml, like update your tables
//return the correct response here
}
Obs.: The function ispost() does not exist by default, I always create it as a shortcut for
[center][size="3"]Note: Starting from Yii 1.1.7 this functionality is included in the core framework and should be considered obsolete.[/size][/center]