Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7635891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:32:24+00:00 2026-05-31T07:32:24+00:00

I have a package that requires Google Map library. And I implemented it like

  • 0

I have a package that requires Google Map library. And I implemented it like this in the view.

<?php Yii::app()->clientScript->registerScriptFile('http://maps.googleapis.com/maps/api/js?sensor=false&language=' . Yii::app()->language . '&region='.Yii::app()->language, CClientScript::POS_HEAD); ?>
<?php Yii::app()->clientScript->registerPackage('somelibrary'); ?>

(Note that the Google Map library needs a parameter Yii::app()->language).

But in the output, the package is always placed above the google maps.

<script type="text/javascript" src="/project/assets/74e60422/somelibrary.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;language=id&amp;region=id"></script>

Is there any solution to make the Google Maps library as the package dependency? Or, at least, how to place the somelibrary package right after (not far below) the google maps ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:32:26+00:00Added an answer on May 31, 2026 at 7:32 am

    You can make the google map script a package itself by configuring the packages property of CClientScript.
    Then you can add the googlemap to your packages dependencies by configuring ‘depends’ in the package configuration. This should then add the scripts in the correct order.

    To add a package you can do the following (didn’t try that, but should work):

    Yii::app()->clientScript->addPackage('googleMap', array(
        'baseUrl'=>'http://maps.googleapis.com/maps/api',
        'js'=>array('js?sensor=false&language=' . Yii::app()->language . '&region='.Yii::app()->language)
    ));
    

    Same 'googleMap'=>array(/*...*/) will work when you put it in your configuration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that requires Microsoft VC++ 2005 (SP1) Redistributable Package. I know
I have an SSIS package that queries data from a view using an SQL
I am building a web application on Google App Engine that requires users to
I have a mod_perl2 based web app that requires a connection to a mysql
I have modified my PHP web app to add events to a Google Calendar.
I'm developing an android honeycomb app that requires the use of the BouncyCastle library
I have a jqueryMobile app that uses google maps api and is working properly
I have a package that I just made and I have an old-mode that
I have a DTS package that drops a table then creates it and populates
I have an SSIS package that connects to a mysql server and attempts to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.