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


PHP CMS::user方法代碼示例

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


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

示例1: getOptions

 /**
  * @param string $key
  * @param mixed  $value
  *
  * @return mixed
  */
 public function getOptions($key, $value)
 {
     return \CMS::user()->lists($this->valueField, $this->keyField)->all();
 }
開發者ID:KodiComponents,項目名稱:module-core,代碼行數:10,代碼來源:UserField.php

示例2: getUpdatedBy

 /**
  * @return User
  */
 public function getUpdatedBy()
 {
     if (is_null($this->updated_by)) {
         $this->updated_by = \CMS::user()->findOrNew($this->created_by);
     }
     return $this->updated_by;
 }
開發者ID:KodiComponents,項目名稱:module-pages,代碼行數:10,代碼來源:FrontendPage.php

示例3: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     foreach (\CMS::user()->all() as $user) {
         DB::table('user_meta')->insert([['user_id' => $user->id, 'key' => WidgetManagerDashboard::WIDGET_SETTINGS_KEY, 'value' => '{"5756f21098fd0":{"id":"5756f21098fd0","type":"profiler","settings":[],"parameters":[],"size":{"x":5,"y":2,"max_size":[6,2],"min_size":[3,2]},"multiple":false,"packages":[],"updateSettingsPage":false},"5756f21263692":{"id":"5756f21263692","type":"kodicms_rss","settings":[],"parameters":[],"size":{"x":5,"y":2,"max_size":[5,10],"min_size":[3,2]},"multiple":false,"packages":[],"updateSettingsPage":false},"5756f218acc7f":{"id":"5756f218acc7f","type":"mini_calendar","settings":[],"parameters":[],"size":{"x":3,"y":1,"max_size":[5,1],"min_size":[3,1]},"multiple":false,"packages":[],"updateSettingsPage":false},"5756f21be3040":{"id":"5756f21be3040","type":"cache_button","settings":[],"parameters":[],"size":{"x":2,"y":1,"max_size":[2,1],"min_size":[2,1]},"multiple":false,"packages":[],"updateSettingsPage":false}}'], ['user_id' => $user->id, 'key' => WidgetManagerDashboard::WIDGET_BLOCKS_KEY, 'value' => '[{"col":1,"row":2,"x":5,"y":2,"max-size":[6,2],"min-size":[3,2],"id":"5756f21098fd0"},{"col":1,"row":4,"x":5,"y":2,"max-size":[5,10],"min-size":[3,2],"id":"5756f21263692"},{"col":1,"row":1,"x":3,"y":1,"max-size":[5,1],"min-size":[3,1],"id":"5756f218acc7f"},{"col":4,"row":1,"x":2,"y":1,"max-size":[2,1],"min-size":[2,1],"id":"5756f21be3040"}]']]);
     }
 }
開發者ID:KodiComponents,項目名稱:module-dashboard,代碼行數:11,代碼來源:DashboardTableSeeder.php


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