Create url in Yii with C # element name

I need to create URLs in Yii by specifying a div on the page to focus when I click ... I know that I need to put the div name c # in the url, but how to specify that in the createUrl function of Yii ...

The createUrl() function provides parameters for parameters, not for elements ... according to my knowledge.

+7
source share
1 answer

If you check createUrl :

additional GET parameters (value name =>). Both the name and value will be encoded in the URL. If the name is "#", the corresponding value will be considered as a binding and will be added at the end of the URL.

You can add it like this:

  echo $this->createUrl('controller/action',array('#'=>'name')); 
+7
source

All Articles