Include CSS,javascript file in Yii Framework

前端 未结 18 1828
[愿得一人]
[愿得一人] 2020-11-29 15:46

How to include a Javascript or CSS file in Yii Framework?

I want to create a page on my site that has a little Javascript application running, so I want to include <

18条回答
  •  一向
    一向 (楼主)
    2020-11-29 15:55

    To include JS and CSS files in a specific view you can do it via controller by passing the parameters false, true, which will include the CSS and JS for, e.g.:

    $this->renderPartial(
        'yourviewname',
        array(
            'model' => $model,
            false,
            true
        )
    );
    

提交回复
热议问题