jasonyii 2016-01-14 16:53:18 3131次浏览 2条回复 0 0 0

echo AppAsset::$basePath; 然后报错: Access to undeclared static property: frontend\assets\AppAsset::$basePath 提示$basePath不是静态变量。 那怎么才能调出$basePath?

  • 回复于 2016-01-18 23:25 举报
    $appAsset=new AppAsset;
    
    echo $appAsset->basePath;
    

    PHP类的基础知识

  • 回复于 2016-01-19 10:24 举报

    谢谢。原来要实例下。
    同时我有新的方法,我配置了theme
    以后在视图里,只要 $theme = $this->theme;
    再用<?=$theme->getUrl('js/jquery.min.js')?>

您需要登录后才可以回复。登录 | 立即注册