Hi I wanted to know the advantage of registering Asset Bundle following the process described in the docs like
public $js = [
One of the main reasons for using an Asset Bundle is that your assets' paths will always be correct. Consider:
will generate something like:
Which works great for non urlManager enabled urls, e.g.
http://localhost/yiiproject/index.php?r=user/update&id=8 because your browser looks for the js file at:
But if you enable urlManager, your url will look like
http://localhost/yiiproject/user/update/8, which means your browser will look for your js file at:
You could overcome this problem by using:
But the Asset Bundle basicly does that for you.