當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Fx::user方法代碼示例

本文整理匯總了PHP中Floxim\Floxim\System\Fx::user方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fx::user方法的具體用法?PHP Fx::user怎麽用?PHP Fx::user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Floxim\Floxim\System\Fx的用法示例。


在下文中一共展示了Fx::user方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: panelHtml

 public static function panelHtml()
 {
     $data = array('main_menu' => self::getMainMenu(), 'more_menu' => self::getMoreMenu(), 'modes' => array("view" => array("name" => fx::alang("mode_view"), "key" => "view"), "edit" => array("name" => fx::alang("mode_edit"), "key" => "edit")), 'profile' => array('logout' => array('name' => fx::alang('Sign out', 'system'), 'href' => fx::user()->getLogoutUrl())), 'is_front' => $_SERVER['REQUEST_URI'] !== fx::config('path.admin'));
     $res = fx::template('@admin:panel')->render($data);
     return $res;
 }
開發者ID:piarsonforked,項目名稱:floxim,代碼行數:6,代碼來源:Adminpanel.php

示例2: isAvailableForUser

 /**
  * Check if infoblock's scope.visibility allows the current user to see this block
  * @return bool Is the block available
  */
 public function isAvailableForUser()
 {
     $c_user = fx::user();
     $ib_visibility = isset($this['scope']['visibility']) ? $this['scope']['visibility'] : null;
     if (!$ib_visibility || $ib_visibility === 'all') {
         return true;
     }
     if ($ib_visibility === 'nobody') {
         return false;
     }
     if ($ib_visibility === 'admin' && !$c_user->isAdmin()) {
         return false;
     }
     if ($ib_visibility === 'user' && $c_user->isGuest()) {
         return false;
     }
     if ($ib_visibility === 'guest' && !$c_user->isGuest()) {
         return false;
     }
     return true;
 }
開發者ID:piarsonforked,項目名稱:floxim,代碼行數:25,代碼來源:Entity.php

示例3: doFormCreate

 public function doFormCreate()
 {
     $this->onFormReady(function ($e) {
         unset($e['form']['fields']['is_published']);
         unset($e['form']['fields']['avatar']);
         unset($e['form']['fields']['is_admin']);
         $e['form']['fields']['email']['required'] = true;
         $e['form']['fields']['name']['required'] = true;
     });
     if ($this->getParam('force_login') && fx::user()->isGuest()) {
         $this->onFormCompleted(function ($e) {
             $form = $e['form'];
             $user = $e['entity'];
             $user->login($form->email, $form->password, true);
         });
     }
     return parent::doFormCreate();
 }
開發者ID:floxim,項目名稱:module-user,代碼行數:18,代碼來源:Controller.php


注:本文中的Floxim\Floxim\System\Fx::user方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。