芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal-back/vendor/yiisoft/yii2/widgets/Block.php
beginBlock('messages', true) ?> * Nothing. * endBlock() ?> * ``` * * And then overriding default in sub-views: * * ```php * beginBlock('username') ?> * Umm... hello? * endBlock() ?> * ``` * * Second parameter defines if block content should be outputted which is desired when rendering its content but isn't * desired when redefining it in subviews. * * @author Qiang Xue
* @since 2.0 */ class Block extends Widget { /** * @var bool whether to render the block content in place. Defaults to false, * meaning the captured block content will not be displayed. */ public $renderInPlace = false; /** * Starts recording a block. */ public function init() { parent::init(); ob_start(); ob_implicit_flush(false); } /** * Ends recording a block. * This method stops output buffering and saves the rendering result as a named block in the view. */ public function run() { $block = ob_get_clean(); if ($this->renderInPlace) { echo $block; } $this->view->blocks[$this->getId()] = $block; } }