(Yaf >=2.3.0)
Yaf_Route_Simple::assemble — 锟斤拷锟絬rl
$info
[, array $query
] ) : string锟斤拷锟斤拷指锟斤拷锟斤拷锟斤拷锟斤拷锟皆讹拷锟斤拷锟斤拷锟斤拷锟絪imple锟斤拷锟絩oute锟斤拷铣锟揭伙拷锟絬rl
info
锟斤拷要锟斤拷锟斤拷一锟斤拷锟斤拷锟介,锟斤拷锟斤拷锟斤拷每锟斤拷key锟斤拷为:m锟斤拷:c锟斤拷:a锟斤拷:m锟斤拷锟斤拷module锟斤拷:c锟斤拷锟斤拷controller, :a锟斤拷锟斤拷action
query
锟矫伙拷锟皆讹拷锟斤拷锟絨uery string锟斤拷锟斤拷锟斤拷锟捷达拷路锟缴癸拷锟斤拷拼锟斤拷锟斤拷url锟斤拷
Example #1 Yaf_Route_Simple::assemble()example
<?php
$router = new Yaf_Router();
$route = new Yaf_Route_Simple('m', 'c', 'a');
$router->addRoute("simple", $route);
var_dump($router->getRoute('simple')->assemble(
array(
':a' => 'yafaction',
'tkey' => 'tval',
':c' => 'yafcontroller',
':m' => 'yafmodule'
),
array(
'tkey1' => 'tval1',
'tkey2' => 'tval2'
)
));
锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�
string(64) "?m=yafmodule&c=yafcontroller&a=yafaction&tkey1=tval1&tkey2=tval2"