jasonyii 2016-01-14 12:07:20 2525次浏览 2条回复 0 0 0

如下面的打印代码:

public 'language' => string 'zh-CN' (length=5)
public 'sourceLanguage' => string 'en-US' (length=5)
public 'layout' => string 'main' (length=4)
public 'requestedRoute' => string '' (length=0)
public 'requestedAction' => 
object(yii\base\InlineAction)[53]
  public 'actionMethod' => string 'actionIndex' (length=11)
  public 'id' => string 'index' (length=5)
  public 'controller' => 
	object(frontend\controllers\SiteController)[54]
	  public 'enableCsrfValidation' => boolean true
	  public 'actionParams' => 
		array (size=0)
		  empty
	  public 'id' => string 'site' (length=4)
	  public 'module' => 
		&object(yii\web\Application)[3]
	  public 'defaultAction' => string 'index' (length=5)
	  public 'layout' => null
	  public 'action' => 
		&object(yii\base\InlineAction)[53]
	  private '_view' (yii\base\Controller) => 
		object(yii\web\View)[49]
		  public 'assetBundles' => 
			array (size=5)
			  'frontend\assets\AppAsset' => 
				object(frontend\assets\AppAsset)[68]
				  public 'basePath' => string 'D:/www/yii/a/cms/frontend/web' (length=32)
				  public 'baseUrl' => string '/yii/a/cms/frontend/web/statics/cms' (length=41)

language 可以这样输出:Yii::$app->language 但是

object(frontend\assets\AppAsset)[68]
                      public 'basePath' => string 'D:/www/yii/a/cms/frontend/web' (length=32)
                      public 'baseUrl' => string '/yii/a/cms/frontend/web/statics/cms' (length=41)

那basePath怎么可以输出来? 谢谢。

  • 回复于 2016-01-14 12:25 举报

    var_dump(basaPath)

  • 回复于 2016-01-14 15:04 举报

    在 frontend\views\layouts\main.php ,用var_dump(basaPath) 出错。
    提示:
    Use of undefined constant basaPath - assumed 'basaPath'

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