I want to set Dynamic Routing
for url in Cms pages in yii2.
When i add Cms page i will add page alias aboutus,faq,management etc , these alias will saved in db .
When i give URL rule static it will work ,[check code below]
'urlManager' => [
'showScriptName' => false,
'enablePrettyUrl' => true,
//'enableStrictParsing' => true,
'rules'=>array(
'aboutus'=>'cms/index/1',
'faq'=>'cms/index/2',
'termacondition'=>'cms/index/3',
'management'=>'cms/index/4',
),
],
But i want add url rule in dynamically .
I need add all dynamic page alias in config/main.php URL rule in yii2
Please help me.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…