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


PHP l類代碼示例

本文整理匯總了PHP中l的典型用法代碼示例。如果您正苦於以下問題:PHP l類的具體用法?PHP l怎麽用?PHP l使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: __construct

 public function __construct()
 {
     $this->type = 'text';
     $this->icon = 'user';
     $this->label = l::get('fields.user.label', 'User');
     $this->placeholder = l::get('fields.user.placeholder', 'Username…');
 }
開發者ID:kompuser,項目名稱:panel,代碼行數:7,代碼來源:user.php

示例2: __construct

 /**
  * @param array $event The fields of this event including the 'private'
  * fields which start with a <code>_</code> (e.g. <code>_begin_date</code>).
  */
 function __construct($event)
 {
     self::validate($event);
     $this->hasEnd = true;
     $this->hasBeginTime = (bool) a::get($event, self::beginTimeKey);
     $this->hasEndTime = (bool) a::get($event, self::endTimeKey);
     $this->beginTimestamp = self::getTimestamp(a::get($event, self::beginDateKey), a::get($event, self::beginTimeKey));
     $this->endTimestamp = self::getTimestamp(a::get($event, self::endDateKey), a::get($event, self::endTimeKey));
     // if there is no end date given, use the same as the beginning date
     if (!$this->endTimestamp) {
         $this->endTimestamp = self::getTimestamp(a::get($event, self::beginDateKey), a::get($event, self::endTimeKey));
         // if there also is no end time given, there is no end at all
         if (!$this->hasEndTime) {
             $this->hasEnd = false;
         }
     }
     // if there is no end time given, the event lasts until end of the day
     if (!$this->hasEndTime) {
         $this->endTimestamp = strtotime('tomorrow', $this->endTimestamp);
     }
     // only use the full format, if there were times given for this event
     $this->timeFormat = $this->hasBeginTime || $this->hasEndTime ? l::get('calendar-full-time-format') : l::get('calendar-time-format');
     // remove the 'private' fields
     $this->fields = self::filterFields($event);
 }
開發者ID:igorqr,項目名稱:kirby-extensions,代碼行數:29,代碼來源:Event.php

示例3: index

 public function index()
 {
     if (app::$site->users()->count() > 0) {
         go('panel/login');
     }
     if ($problems = installation::check()) {
         $content = view('installation/check', array('problems' => $problems));
     } else {
         $form = app::form('installation', array('language' => c::get('panel.language', 'en')));
         $form->cancel = false;
         $form->save = l::get('installation.signup.button');
         $form->centered = true;
         foreach (app::languages() as $lang) {
             $form->fields()->get('language')->options[$lang->code()] = $lang->title();
         }
         $form->on('submit', function ($form) {
             try {
                 app::$site->users()->create($form->serialize());
                 go('panel/login/welcome');
             } catch (Exception $e) {
                 $form->alert($e->getMessage());
             }
         });
         $content = view('installation/signup', array('form' => $form));
     }
     return layout('installation', array('meta' => new Snippet('meta'), 'content' => $content));
 }
開發者ID:kompuser,項目名稱:panel,代碼行數:27,代碼來源:installation.php

示例4: login

 public static function login($redirect = '/')
 {
     if (self::user()) {
         go(url($redirect));
     }
     self::kill();
     $password = get('password');
     $username = get('username');
     if (empty($username) || empty($password)) {
         return false;
     }
     // try to find the user
     $account = self::load($username);
     if (!$account) {
         return array('status' => 'error', 'msg' => l::get('auth.error', 'Invalid username or password'));
     }
     // check for matching usernames
     if (str::lower($account->username()) != str::lower($username)) {
         return array('status' => 'error', 'msg' => l::get('auth.error', 'Invalid username or password'));
     }
     // check for a matching password
     if (!self::checkPassword($account, $password)) {
         return array('status' => 'error', 'msg' => l::get('auth.error', 'Invalid username or password'));
     }
     // generate a random token
     $token = str::random();
     // add the username.
     $account->token = $token;
     // store the token in the cookie
     // and the user data in the session
     cookie::set('authFrontend', $token, 60 * 60 * 24);
     s::set('authFrontend.' . $token, $account->username());
     go(url($redirect));
 }
開發者ID:scheibome,項目名稱:kirbycms-extensions,代碼行數:34,代碼來源:auth.php

示例5: __construct

 public function __construct()
 {
     $this->type = 'url';
     $this->icon = 'chain';
     $this->label = l::get('fields.url.label', 'URL');
     $this->placeholder = 'http://';
 }
開發者ID:robinandersen,項目名稱:robin,代碼行數:7,代碼來源:url.php

示例6: login

 function login()
 {
     s::restart();
     $password = get('password');
     $username = get('username');
     if (empty($username) || empty($password)) {
         return array('status' => 'error', 'msg' => l::get('login.error'));
     }
     $account = self::load($username);
     if (!$account) {
         return array('status' => 'error', 'msg' => l::get('login.error'));
     }
     // check for matching usernames
     if (str::lower($account['username']) != str::lower($username)) {
         return array('status' => 'error', 'msg' => l::get('login.error'));
     }
     // check for a matching password
     if (!self::checkPassword($account, $password)) {
         return array('status' => 'error', 'msg' => l::get('login.error'));
     }
     // generate a random token
     $token = str::random();
     // add the username.
     // It's only the key of the array so far.
     $account['token'] = $token;
     // store the token in the cookie
     // and the user data in the session
     cookie::set('auth', $token, 60 * 60 * 24);
     s::set($token, $account);
     // assign the user data to this obj
     $this->_ = $account;
     return array('status' => 'success', 'msg' => l::get('login.success'));
 }
開發者ID:codecuts,項目名稱:lanningsmith-website,代碼行數:33,代碼來源:user.php

示例7: __construct

 public function __construct()
 {
     $this->type = 'text';
     $this->label = l::get('fields.title.label', 'Title');
     $this->icon = 'font';
     $this->required = true;
 }
開發者ID:LucasFyl,項目名稱:korakia,代碼行數:7,代碼來源:title.php

示例8: __construct

 public function __construct()
 {
     $this->label = l::get('fields.textarea.label', 'Text');
     $this->buttons = true;
     $this->min = 0;
     $this->max = false;
 }
開發者ID:robinandersen,項目名稱:robin,代碼行數:7,代碼來源:textarea.php

示例9: __construct

 public function __construct()
 {
     $this->type = 'text';
     $this->icon = 'map-marker';
     $this->label = l::get('fields.location.label', 'Location');
     $this->placeholder = l::get('fields.location.placeholder', 'Coordinates');
     $this->readonly = true;
 }
開發者ID:junglesta,項目名稱:freezer,代碼行數:8,代碼來源:geolocation.php

示例10: __construct

 public function __construct()
 {
     $this->icon = 'tag';
     $this->label = l::get('fields.tags.label', 'Tags');
     $this->index = 'siblings';
     $this->separator = ',';
     $this->lower = false;
 }
開發者ID:irenehilber,項目名稱:kirby-base,代碼行數:8,代碼來源:tags.php

示例11: __construct

 public function __construct()
 {
     $this->type = 'email';
     $this->icon = 'envelope';
     $this->label = l::get('fields.email.label', 'Email');
     $this->placeholder = l::get('fields.email.placeholder', 'mail@example.com');
     $this->autocomplete = true;
 }
開發者ID:aoimedia,項目名稱:kosmonautensofa,代碼行數:8,代碼來源:email.php

示例12: __construct

 public function __construct()
 {
     $this->type = 'number';
     $this->label = l::get('fields.number.label', 'Number');
     $this->placeholder = l::get('fields.number.placeholder', '#');
     $this->step = 1;
     $this->min = 0;
     $this->max = false;
 }
開發者ID:muten84,項目名稱:luigibifulco.it,代碼行數:9,代碼來源:number.php

示例13: testSet

 public function testSet()
 {
     l::set('anothervar', 'anothervalue');
     l::set('testvar', 'overwrittenvalue');
     $this->assertEquals('anothervalue', l::get('anothervar'));
     $this->assertEquals('overwrittenvalue', l::get('testvar'));
     l::set(array('var1' => 'value1', 'var2' => 'value2'));
     $this->assertEquals('value1', l::get('var1'));
     $this->assertEquals('value2', l::get('var2'));
 }
開發者ID:aoimedia,項目名稱:kosmonautensofa,代碼行數:10,代碼來源:LTest.php

示例14: __construct

 public function __construct()
 {
     $this->type = 'text';
     $this->icon = 'user';
     $this->label = l::get('fields.user.label', 'User');
     $this->options = array();
     foreach (kirby()->site()->users() as $user) {
         $this->options[$user->username()] = $user->username();
     }
 }
開發者ID:kristianhalte,項目名稱:super_organic,代碼行數:10,代碼來源:user.php

示例15: input

 public function input()
 {
     $input = parent::input();
     $input->removeAttr('name');
     $input->data(array('field' => 'date', 'format' => $this->format(), 'i18n' => html(json_encode(array('previousMonth' => '&lsaquo;', 'nextMonth' => '&rsaquo;', 'months' => l::get('fields.date.months'), 'weekdays' => l::get('fields.date.weekdays'), 'weekdaysShort' => l::get('fields.date.weekdays.short'))), false)));
     $hidden = new Brick('input', null);
     $hidden->type = 'hidden';
     $hidden->name = $this->name();
     $hidden->value = $this->value();
     return $input . $hidden;
 }
開發者ID:aoimedia,項目名稱:kosmonautensofa,代碼行數:11,代碼來源:date.php


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