php - Yii Parsing Urlmanager Link Back To Array -


How can I access the array of parameters, to see the controller in action? The basic rules were applied to my links (simplified) before SEO links:

  foreach (....) {$ _GET ['filter'] = $ value; $ Link = $ this- & gt; CreateUrl ('Model / showModels', $ _GET); Echo CHtml :: link (Yii :: t ('main', $ value), $ link); }  

But the urlManager has cleared after implementing the $ _GET variable, and to ensure that such rules have stopped working.

I find that this is done in CLinkPager module with some "magic" method, but how can not understand

In Yii, you can get the ultimate from the following method:

  Yii :: app () - & gt; Request & gt; GetParam ('PARAM_NAME'); // getParam for example ('filter') // or Yii :: app () - & gt; Request-> GetQuery ('$ _GET key');  

To merge the parameter to $ _GET request:

  CMAP :: Merge ($ _GET, array ('filter' => Value '))  

To get all the parameters:

  Yii :: app () - & gt; Request-> GetQueryString ();  

In addition, there is a powerful way to get Yii to dump which I recommend you use it:

  CVarDumper :: dump ($ _GET, 34567, true);  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -