Hello friends
I used to use Yii 1.x in my projects some years, now I’m begining a new project and I want use Yii 2, I 'm read the tutorial, but I have some doubt.
I need to create a different layout, and I don’t want use the default main.php in views/layout, so I created this file:
views/layout/adm/default.php
views/layout/adm/menu.php
So in my controller I change the layout:
class SiteController extends Controller
{
public $layout='adm/default';
}
Thats ok.
I have some errors in my default.php, I need to use externals links (css, js, etc)
I created the directory with some js and css in "/" of my project, the directory libs to js and the directory css to some css.
When I use Yii 1.x I call the files using a line like this:
<link rel="stylesheet" type="text/css" href="<?=Yii::app()->request->baseUrl?>/css/main.css">
But in Yii 2 the command Yii::app() does not function. How can I call my external links? I need use my owner js in my default layout
Another line that don’t function in Yii 2 is :
<?php //$this->renderPartial(‘menu’) ?>
Whats Can I use renderPartil in Yii?
Another question, the BootStrap and JQuery are activated for default? I look in config.web.php and don’t find anything