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


PHP l::get方法代码示例

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


在下文中一共展示了l::get方法的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::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。