本文整理汇总了PHP中Layout::addBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::addBlock方法的具体用法?PHP Layout::addBlock怎么用?PHP Layout::addBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::addBlock方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
if (!Yii::app()->getUser()->getIsGuest()) {
Layout::addBlock('sidebar.left', array('id' => 'profile_sidebar', 'content' => $this->widget('ProfileWidget', array('userModel' => Yii::app()->getUser()->getModel()), true)));
}
}
示例2: init
public function init()
{
parent::init();
if (!Yii::app()->user->hasRole('teacher')) {
$this->redirect(array('/site/index'));
}
Layout::addBlock('sidebar.left', array('id' => 'profile_sidebar', 'content' => $this->widget('ProfileWidget', array('userModel' => Yii::app()->getUser()->getModel()), true)));
}
示例3: actionIndex
public function actionIndex()
{
if (Yii::app()->getUser()->getIsGuest()) {
$this->redirect(Yii::app()->getUser()->loginUrl);
} else {
Layout::addBlock('sidebar.left', array('id' => 'profile_sidebar', 'content' => $this->widget('ProfileWidget', array('userModel' => Yii::app()->getUser()->getModel()), true)));
$this->render('index');
}
}
示例4: init
public function init()
{
parent::init();
if (Yii::app()->user->hasRole('teacher') || Yii::app()->user->hasRole('student')) {
} else {
$this->render('//misc/unavailable', array('messageTitle' => 'Page Not Found', 'message' => 'The requested page wast not found.'));
Yii::app()->end();
}
Layout::addBlock('sidebar.left', array('id' => 'profile_sidebar', 'content' => $this->widget('ProfileWidget', array('userModel' => Yii::app()->getUser()->getModel()), true)));
}
示例5: array
<?php
$this->pageTitle = Yii::t('application', 'All aspects');
?>
<div class="action" id="aspect-index">
<div class="action-content">
<!--post-form-->
<?php
$this->widget('PostFormWidget');
?>
<!--/post-form-->
<div class="stream" id="post-stream">
<?php
$this->widget('PostStreamWidget');
?>
</div>
</div>
</div>
<?php
Layout::addBlock('sidebar.right', array('id' => 'right_sidebar', 'content' => $this->renderPartial('/partial/aspect_index_right', array('aspects' => $user->aspects, 'controller' => $this), true)));
示例6: array
<?php
$this->pageTitle = $post->getShortenedContent();
?>
<div class="action" id="post-view">
<div class="action-content">
<div class="stream" id="post-stream">
<div class="stream-content">
<div class="stream-items">
<?php
Yii::app()->controller->widget('PostViewWidget', array('post' => $post));
?>
</div>
</div>
</div>
</div>
</div>
<?php
Layout::addBlock('sidebar.right', array('id' => 'right_sidebar', 'content' => ' '));
示例7: init
public function init()
{
parent::init();
Layout::addBlock('sidebar.right', array('id' => 'right_sidebar', 'content' => $this->renderPartial('/partial/editprofile_right', array('user' => Yii::app()->getUser()->getModel()), true)));
}
示例8: actionIndex
public function actionIndex()
{
Layout::addBlock('sidebar.left', array('id' => 'profile_sidebar', 'content' => $this->widget('ProfileWidget', array('userModel' => Yii::app()->getUser()->getModel()), true)));
$this->render('index');
}
示例9: init
public function init()
{
parent::init();
Layout::addBlock('sidebar.left', array('id' => 'course_menu', 'content' => $this->renderPartial('_admin_course', array(), true)));
Layout::addBlock('sidebar.left', array('id' => 'profile_sidebar', 'content' => $this->widget('ProfileWidget', array('userModel' => Yii::app()->getUser()->getModel()), true)));
}