2

This the code in my /config/main.php

'packages'=>array(
                'jquery'=>array(
                    'baseUrl'=>'//ajax.googleapis.com/ajax/libs/jquery/2.1.0/',
                    'js'=>array('jquery.min.js'),
                ),
                'jquery.ui'=>array(
                    'baseUrl'=>'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/',
                    'js'=>array('jquery-ui.min.js'),
                )
            ),

and in my layout i have loaded jquery, jquery.ui using

<?php Yii::app()->clientScript->registerCoreScript('jquery');?>
    <?php Yii::app()->clientScript->registerCoreScript('jquery.ui');?>

I want to get the base url of jquer.ui (i.e//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/) is there any method that will return me the baseUrl of jquery.ui

1 Answer 1

4

You can use getPackageBaseUrl()

Also if you need to see the source then get it here

For egs you can get uri like,

<?php
    echo Yii::app()->clientScript->getPackageBaseUrl('jquery.ui');
?>

See this which will clear you more about package.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.