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


PHP Validator::in方法代码示例

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


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

示例1: validateForm

 private function validateForm($data)
 {
     $l = Movim\i18n\Locale::start();
     if (Validator::in(array_keys($l->getList()))->validate($data['language']) && Validator::in(array('show', 'hide'))->validate($data['roster']) && ($data['cssurl'] == '' || Validator::url()->validate($data['cssurl']))) {
         return true;
     }
     return false;
 }
开发者ID:christine-ho-dev,项目名称:movim,代码行数:8,代码来源:Config.php

示例2: ajaxVcardSubmit

 function ajaxVcardSubmit($vcard)
 {
     # Format it ISO 8601:
     if ($vcard->year->value != -1 && $vcard->month->value != -1 && $vcard->day->value != -1) {
         $vcard->date->value = $vcard->year->value . '-' . $vcard->month->value . '-' . $vcard->day->value;
     }
     unset($vcard->year->value);
     unset($vcard->month->value);
     unset($vcard->day->value);
     $cd = new \Modl\ContactDAO();
     $c = $cd->get($this->user->getLogin());
     if ($c == null) {
         $c = new \Modl\Contact();
     }
     $c->jid = $this->user->getLogin();
     if (isset($vcard->date->value)) {
         $c->date = $vcard->date->value;
     }
     if (Validator::string()->length(0, 40)->validate($vcard->name->value)) {
         $c->name = $vcard->name->value;
     }
     if (Validator::string()->length(0, 40)->validate($vcard->fn->value)) {
         $c->fn = $vcard->fn->value;
     }
     if (Validator::url()->validate($vcard->url->value)) {
         $c->url = $vcard->url->value;
     }
     if (Validator::in(array_keys(getGender()))->validate($vcard->gender->value)) {
         $c->gender = $vcard->gender->value;
     }
     if (Validator::in(array_keys(getMarital()))->validate($vcard->marital->value)) {
         $c->marital = $vcard->marital->value;
     }
     $c->adrlocality = $vcard->locality->value;
     $c->adrcountry = $vcard->country->value;
     if (Validator::email()->validate($vcard->email->value)) {
         $c->email = $vcard->email->value;
     }
     $c->twitter = $vcard->twitter->value;
     $c->skype = $vcard->skype->value;
     $c->yahoo = $vcard->yahoo->value;
     if (Validator::string()->validate($vcard->desc->value)) {
         $c->description = trim($vcard->desc->value);
     }
     $cd = new \Modl\ContactDAO();
     $cd->set($c);
     $r = new Set();
     $r->setData($c)->request();
     $r = new Moxl\Xec\Action\Vcard\Set();
     $r->setData($vcard)->request();
 }
开发者ID:vijo,项目名称:movim,代码行数:51,代码来源:Vcard4.php

示例3: setIndicador

 /**
  * Indicador do código de segurança:
  *
  * 0 (não informado)
  * 1 (informado)
  * 2 (ilegível)
  * 9 (inexistente)
  *
  * @var integer
  * @return Cartao
  */
 public function setIndicador($indicador)
 {
     if (!v::in(array(0, 1, 2, 9), true)->validate($indicador)) {
         throw new InvalidArgumentException('Indicador de código de segurança inválido.');
     }
     $this->indicador = (int) $indicador;
     return $this;
 }
开发者ID:mrprompt,项目名称:cielo,代码行数:19,代码来源:Cartao.php

示例4: postValidator

 private function postValidator($post = array())
 {
     try {
         v::stringType()->notEmpty()->length(1, 20)->assert($post['name']);
         v::in(['Y', 'N'])->assert($post['enable']);
     } catch (vn $exception) {
         $this->MSG->showmsg(nl2br($exception->getFullMessage()));
     }
 }
开发者ID:slion0725,项目名称:admin_ci303,代码行数:9,代码来源:product.php

示例5: __construct

 public function __construct(Client $client)
 {
     $this->client = $client;
     $sortColumns = array_keys(Bookmark::select()->toAssoc());
     $this->supportedSettings = array('ff.limit' => array('desc' => 'Limit amount of results (> 0 or 0 for no limit)', 'validation' => array(v::int()->min(0, true)), 'default' => '0'), 'ff.sort' => array('desc' => 'Sort order of results (' . implode($sortColumns, ', ') . ')', 'validation' => array(v::in($sortColumns)->notEmpty()), 'default' => 'hit_count'), 'ff.interactive' => array('desc' => 'Ask for missing input interactively (0 never, 1 always)', 'validation' => array(v::in(array('0', '1'))), 'default' => '1'), 'ff.color' => array('desc' => 'Enable color output on supported systems (0/1)', 'validation' => array(v::in(array('0', '1'))), 'default' => '1'));
 }
开发者ID:natedrake,项目名称:fast-forward,代码行数:6,代码来源:Settings.php

示例6: role

 /**
  *
  * @param string $role
  * @return boolean
  */
 public function role($role) : bool
 {
     return V::in(['admin', 'moderator', 'user'])->validate($role);
 }
开发者ID:ignaszak,项目名称:cms,代码行数:9,代码来源:Validation.php

示例7: setDuplicateCheck

 /**
  * @param string $value
  */
 public function setDuplicateCheck($value)
 {
     $validator = Validator::in(['DUPLIST', 'DUPCAMP', 'DUPSYS', 'DUPTITLEALTPHONELIST', 'DUPTITLEALTPHONECAMP', 'DUPTITLEALTPHONESYS', 'DUPNAMEPHONELIST', 'DUPNAMEPHONECAMP', 'DUPNAMEPHONESYS']);
     if ($validator->validate($value)) {
         $this->setProperty('duplicate_check', $value);
     }
 }
开发者ID:derain,项目名称:primodialer-api-client,代码行数:10,代码来源:Lead.php


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