Exemplo n.º 1
0
 /**
  * Begins recording a block.
  * This method is a shortcut to beginning [[Block]]
  * @param string $id the block ID.
  * @param boolean $renderInPlace whether to render the block content in place.
  * Defaults to false, meaning the captured block will not be displayed.
  * @return Block the Block widget instance
  */
 public function beginBlock($id, $renderInPlace = false)
 {
     return Block::begin(['id' => $id, 'renderInPlace' => $renderInPlace, 'view' => $this]);
 }
Exemplo n.º 2
0
 /**
  * @param array|integer $config array or block position constant
  * @return void|static
  */
 static function begin($config = [])
 {
     $config = is_array($config) ? $config : ['position' => $config];
     parent::begin($config);
 }
Exemplo n.º 3
0
use yii\helpers\Html;
use yii\widgets\Block;
use kartik\widgets\SideNav;
/**
 * @var yii\web\View $this
 * @var frenzelgmbh\sblog\models\Post $model
 */
$this->title = 'Create Post';
$this->params['breadcrumbs'][] = ['label' => 'Posts', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="workbench">

<?php 
Block::begin(array('id' => 'sidebar'));
?>

  <?php 
$sideMenu = array();
$sideMenu[] = array('icon' => 'arrow-left', 'label' => Yii::t('app', 'Overview'), 'url' => Url::to(array('/posts/post/index')));
echo SideNav::widget(['type' => SideNav::TYPE_PRIMARY, 'heading' => 'Options', 'items' => $sideMenu]);
?>

<?php 
Block::end();
?>

	<h1><?php 
echo Html::encode($this->title);
?>
Exemplo n.º 4
0
<?php

use yii\widgets\Block;
?>

<?php 
Block::begin(['id' => 'sidebar']);
?>
<h1> Menu </h1>
<ul>
    <li>Home</li>
    <li>About</li>
    <li>Contact</li>
</ul>
<?php 
Block::end();
?>

<h1> Article </h1>
<p> Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. </p>