1 | <?php |
||
20 | class View extends \yii\web\View |
||
21 | { |
||
22 | /** |
||
23 | * @var boolean If csrf validation is enabled in the request component, and autoRegisterCsrf is enabled, then |
||
24 | * all the meta informations will be auto added to meta tags. |
||
25 | */ |
||
26 | public $autoRegisterCsrf = true; |
||
27 | |||
28 | /** |
||
29 | * Init view object. Implements auto register csrf meta tokens. |
||
30 | * @see \yii\base\View::init() |
||
31 | */ |
||
32 | public function init() |
||
46 | |||
47 | /** |
||
48 | * Get the url source for an asset. |
||
49 | * |
||
50 | * When registering an asset `\app\assets\ResoucesAsset::register($this)` the $assetName |
||
51 | * is `app\assets\ResourcesAsset`. |
||
52 | * |
||
53 | * @param string $assetName The class name of the asset bundle (without the leading backslash) |
||
54 | * @return string The internal base path to the asset file. |
||
55 | * @throws Exception |
||
56 | */ |
||
57 | public function getAssetUrl($assetName) |
||
67 | |||
68 | /** |
||
69 | * Removes redundant whitespaces (>1) and new lines (>1). |
||
70 | * |
||
71 | * @param string $content input string |
||
72 | * @return string compressed string |
||
73 | */ |
||
74 | public function compress($content) |
||
78 | |||
79 | /** |
||
80 | * Return the relativ path to your public_html folder. |
||
81 | * |
||
82 | * This wrapper function is commonly used to get the path for images or other files inside your |
||
83 | * public_html directory. For instance you have put some images in our public folder `public_html/img/luya.png` |
||
84 | * then you can access the image file inside your view files with: |
||
85 | * |
||
86 | * ```php |
||
87 | * <img src="<?= $this->publicHtml; ?>/img/luya.png" /> |
||
88 | * ``` |
||
89 | * |
||
90 | * @return string The relative baseUrl to your public_html folder. |
||
91 | */ |
||
92 | public function getPublicHtml() |
||
96 | } |
||
97 |