From 1be82dc0f5af1e22703bffd3350a3faf1e38accd Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Fri, 31 Oct 2014 16:52:26 +0300 Subject: [PATCH] Added phpdoc for Block --- framework/widgets/Block.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/framework/widgets/Block.php b/framework/widgets/Block.php index ea96619..998dd6c 100644 --- a/framework/widgets/Block.php +++ b/framework/widgets/Block.php @@ -10,6 +10,29 @@ namespace yii\widgets; use yii\base\Widget; /** + * Block records all output between [[begin()]] and [[end()]] calls and stores it in [[\yii\base\View::$blocks]]. + * for later use. + * + * [[\yii\base\View]] component contains two methods [[\yii\base\View::beginBlock()]] and [[\yii\base\View::endBlock()]]. + * The general idea is that you're defining block default in a view or layout: + * + * ```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 */