Yii Framework Forum: Cgoogleapi And Registerscript Id - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cgoogleapi And Registerscript Id Rate Topic: -----

#1 User is offline   le_top 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 332
  • Joined: 08-June 10
  • Location:France

Posted 22 September 2012 - 08:20 PM

In the same web application, I need to change the google map api parameters where in some cases the 'drawing' library is to be included.

As I also enable the 'EScriptBoost' extension that compresses and caches javascript, the script id must be unique enough so that caching takes into account the difference in parameters.

I changed the CGoogleApi::register method slightly to modify the script id and to make it use the controller action id:
		$cs->registerScript(Yii::app()->getController()->getAction()->getId().'#'.$name,$js,CClientScript::POS_HEAD);

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users