当前位置: 首页>>代码示例>>PHP>>正文


PHP Layout::addBlock方法代码示例

本文整理汇总了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)));
     }
 }
开发者ID:jayrulez,项目名称:kcconline,代码行数:7,代码来源:CourseController.php

示例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)));
 }
开发者ID:jayrulez,项目名称:kcconline,代码行数:8,代码来源:ReportsController.php

示例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');
     }
 }
开发者ID:jayrulez,项目名称:kcconline,代码行数:9,代码来源:SiteController.php

示例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)));
 }
开发者ID:jayrulez,项目名称:kcconline,代码行数:10,代码来源:GradedWorkController.php

示例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)));
开发者ID:jayrulez,项目名称:yiisns,代码行数:21,代码来源:index.php

示例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' => '&nbsp;'));
开发者ID:jayrulez,项目名称:yiisns,代码行数:20,代码来源:view.php

示例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)));
 }
开发者ID:jayrulez,项目名称:yiisns,代码行数:5,代码来源:EditprofileController.php

示例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');
 }
开发者ID:jayrulez,项目名称:kcconline,代码行数:5,代码来源:DefaultController.php

示例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)));
 }
开发者ID:jayrulez,项目名称:kcconline,代码行数:6,代码来源:CourseController.php


注:本文中的Layout::addBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。