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


PHP User::createUrl方法代码示例

本文整理汇总了PHP中humhub\modules\user\models\User::createUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP User::createUrl方法的具体用法?PHP User::createUrl怎么用?PHP User::createUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在humhub\modules\user\models\User的用法示例。


在下文中一共展示了User::createUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->addItemGroup(array('id' => 'profile', 'label' => Yii::t('UserModule.widgets_ProfileMenuWidget', '<strong>Profile</strong> menu'), 'sortOrder' => 100));
     $this->addItem(array('label' => Yii::t('UserModule.widgets_ProfileMenuWidget', 'Stream'), 'group' => 'profile', 'url' => $this->user->createUrl('//user/profile/home'), 'sortOrder' => 200, 'isActive' => Yii::$app->controller->id == "profile" && (Yii::$app->controller->action->id == "index" || Yii::$app->controller->action->id == "home")));
     if ($this->user->permissionManager->can(new \humhub\modules\user\permissions\ViewAboutPage())) {
         $this->addItem(array('label' => Yii::t('UserModule.widgets_ProfileMenuWidget', 'About'), 'group' => 'profile', 'url' => $this->user->createUrl('//user/profile/about'), 'sortOrder' => 300, 'isActive' => Yii::$app->controller->id == "profile" && Yii::$app->controller->action->id == "about"));
     }
     parent::init();
 }
开发者ID:VasileGabriel,项目名称:humhub,代码行数:12,代码来源:ProfileMenu.php

示例2: run

 /**
  * @inheritdoc
  */
 public function run()
 {
     if ($this->user->isCurrentUser() || \Yii::$app->user->isGuest) {
         return;
     }
     if (Yii::$app->getModule('friendship')->getIsEnabled()) {
         // Don't show follow button, when friends
         if (Friendship::getFriendsQuery($this->user)->one() !== null) {
             return;
         }
     }
     // Add class for javascript handling
     $this->followOptions['class'] .= ' followButton';
     $this->unfollowOptions['class'] .= ' unfollowButton';
     // Hide inactive button
     if ($this->user->isFollowedByUser()) {
         $this->followOptions['style'] .= ' display:none;';
     } else {
         $this->unfollowOptions['style'] .= ' display:none;';
     }
     // Add UserId Buttons
     $this->followOptions['data-userid'] = $this->user->id;
     $this->unfollowOptions['data-userid'] = $this->user->id;
     $this->view->registerJsFile('@web/resources/user/followButton.js');
     return Html::a($this->unfollowLabel, $this->user->createUrl('/user/profile/unfollow'), $this->unfollowOptions) . Html::a($this->followLabel, $this->user->createUrl('/user/profile/follow'), $this->followOptions);
 }
开发者ID:VasileGabriel,项目名称:humhub,代码行数:29,代码来源:UserFollowButton.php

示例3: run

 /**
  * @inheritdoc
  */
 public function run()
 {
     if ($this->user->isCurrentUser() || \Yii::$app->user->isGuest) {
         return;
     }
     // Add class for javascript handling
     $this->followOptions['class'] .= ' followButton';
     $this->unfollowOptions['class'] .= ' unfollowButton';
     // Hide inactive button
     if ($this->user->isFollowedByUser()) {
         $this->followOptions['style'] .= ' display:none;';
     } else {
         $this->unfollowOptions['style'] .= ' display:none;';
     }
     // Add UserId Buttons
     $this->followOptions['data-userid'] = $this->user->id;
     $this->unfollowOptions['data-userid'] = $this->user->id;
     $this->view->registerJsFile('@web/resources/user/followButton.js');
     return Html::a($this->unfollowLabel, $this->user->createUrl('/user/profile/unfollow'), $this->unfollowOptions) . Html::a($this->followLabel, $this->user->createUrl('/user/profile/follow'), $this->followOptions);
 }
开发者ID:gautamkrishnar,项目名称:humhub-openshift-quickstart,代码行数:23,代码来源:UserFollowButton.php


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