You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					39 lines
				
				815 B
			
		
		
			
		
	
	
					39 lines
				
				815 B
			| 
											13 years ago
										 | <?php
 | ||
|  | /**
 | ||
|  |  * @link http://www.yiiframework.com/
 | ||
|  |  * @copyright Copyright (c) 2008 Yii Software LLC
 | ||
|  |  * @license http://www.yiiframework.com/license/
 | ||
|  |  */
 | ||
|  | 
 | ||
|  | namespace yii\debug;
 | ||
|  | 
 | ||
|  | use Yii;
 | ||
|  | use yii\base\Widget;
 | ||
|  | use yii\helpers\Html;
 | ||
|  | 
 | ||
|  | /**
 | ||
|  |  * @author Qiang Xue <qiang.xue@gmail.com>
 | ||
|  |  * @since 2.0
 | ||
|  |  */
 | ||
|  | class Toolbar extends Widget
 | ||
|  | {
 | ||
| 
											13 years ago
										 | 	public $debugAction = 'debug/default/toolbar';
 | ||
| 
											13 years ago
										 | 
 | ||
|  | 	public function run()
 | ||
|  | 	{
 | ||
| 
											13 years ago
										 | 		if (Yii::$app->hasModule('debug')) {
 | ||
| 
											13 years ago
										 | 			$id = 'yii-debug-toolbar';
 | ||
|  | 			$url = Yii::$app->getUrlManager()->createUrl($this->debugAction, array(
 | ||
|  | 				'tag' => Yii::getLogger()->tag,
 | ||
|  | 			));
 | ||
| 
											13 years ago
										 | 			$view = $this->getView();
 | ||
|  | 			$view->registerJs("yii.debug.load('$id', '$url');");
 | ||
|  | 			$view->registerAssetBundle('yii/debug');
 | ||
| 
											13 years ago
										 | 			echo Html::tag('div', '', array(
 | ||
|  | 				'id' => $id,
 | ||
|  | 				'style' => 'display: none',
 | ||
|  | 			));
 | ||
|  | 		}
 | ||
|  | 	}
 | ||
|  | }
 |