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.
		
		
		
		
			
				
					92 lines
				
				2.0 KiB
			
		
		
			
		
	
	
					92 lines
				
				2.0 KiB
			| 
											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;
 | ||
|  | 
 | ||
| 
											12 years ago
										 | use Yii;
 | ||
| 
											13 years ago
										 | use yii\base\Component;
 | ||
|  | 
 | ||
|  | /**
 | ||
| 
											12 years ago
										 |  * Panel is a base class for debugger panel classes. It defines how data should be collected,
 | ||
|  |  * what should be displayed at debug toolbar and on debugger details view.
 | ||
| 
											12 years ago
										 |  *
 | ||
| 
											12 years ago
										 |  * @property string $detail Content that is displayed in debugger detail view. This property is read-only.
 | ||
|  |  * @property string $name Name of the panel. This property is read-only.
 | ||
|  |  * @property string $summary Content that is displayed at debug toolbar. This property is read-only.
 | ||
|  |  * @property string $url URL pointing to panel detail view. This property is read-only.
 | ||
| 
											12 years ago
										 |  *
 | ||
| 
											13 years ago
										 |  * @author Qiang Xue <qiang.xue@gmail.com>
 | ||
|  |  * @since 2.0
 | ||
|  |  */
 | ||
|  | class Panel extends Component
 | ||
|  | {
 | ||
| 
											12 years ago
										 | 	public $id;
 | ||
|  | 	public $tag;
 | ||
| 
											12 years ago
										 | 	/**
 | ||
|  | 	 * @var Module
 | ||
|  | 	 */
 | ||
|  | 	public $module;
 | ||
| 
											13 years ago
										 | 	public $data;
 | ||
| 
											12 years ago
										 | 	/**
 | ||
|  | 	 * @var array array of actions to add to the debug modules default controller.
 | ||
|  | 	 * This array will be merged with all other panels actions property.
 | ||
|  | 	 * See [[yii\base\Controller::actions()]] for the format.
 | ||
|  | 	 */
 | ||
|  | 	public $actions = [];
 | ||
| 
											13 years ago
										 | 
 | ||
| 
											12 years ago
										 | 	/**
 | ||
|  | 	 * @return string name of the panel
 | ||
|  | 	 */
 | ||
| 
											13 years ago
										 | 	public function getName()
 | ||
|  | 	{
 | ||
|  | 		return '';
 | ||
|  | 	}
 | ||
|  | 
 | ||
| 
											12 years ago
										 | 	/**
 | ||
|  | 	 * @return string content that is displayed at debug toolbar
 | ||
|  | 	 */
 | ||
| 
											13 years ago
										 | 	public function getSummary()
 | ||
|  | 	{
 | ||
|  | 		return '';
 | ||
|  | 	}
 | ||
|  | 
 | ||
| 
											12 years ago
										 | 	/**
 | ||
|  | 	 * @return string content that is displayed in debugger detail view
 | ||
|  | 	 */
 | ||
| 
											13 years ago
										 | 	public function getDetail()
 | ||
|  | 	{
 | ||
|  | 		return '';
 | ||
|  | 	}
 | ||
|  | 
 | ||
| 
											12 years ago
										 | 	/**
 | ||
|  | 	 * Saves data to be later used in debugger detail view.
 | ||
|  | 	 * This method is called on every page where debugger is enabled.
 | ||
|  | 	 *
 | ||
|  | 	 * @return mixed data to be saved
 | ||
|  | 	 */
 | ||
| 
											13 years ago
										 | 	public function save()
 | ||
|  | 	{
 | ||
|  | 		return null;
 | ||
|  | 	}
 | ||
|  | 
 | ||
|  | 	public function load($data)
 | ||
|  | 	{
 | ||
|  | 		$this->data = $data;
 | ||
|  | 	}
 | ||
| 
											12 years ago
										 | 
 | ||
| 
											12 years ago
										 | 	/**
 | ||
|  | 	 * @return string URL pointing to panel detail view
 | ||
|  | 	 */
 | ||
| 
											12 years ago
										 | 	public function getUrl()
 | ||
|  | 	{
 | ||
| 
											12 years ago
										 | 		return Yii::$app->getUrlManager()->createUrl($this->module->id . '/default/view', [
 | ||
| 
											12 years ago
										 | 			'panel' => $this->id,
 | ||
|  | 			'tag' => $this->tag,
 | ||
| 
											12 years ago
										 | 		]);
 | ||
| 
											12 years ago
										 | 	}
 | ||
| 
											13 years ago
										 | }
 |