• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP lmb_i18n函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中lmb_i18n函数的典型用法代码示例。如果您正苦于以下问题:PHP lmb_i18n函数的具体用法?PHP lmb_i18n怎么用?PHP lmb_i18n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: testRequiredRuleFailure

 function testRequiredRuleFailure()
 {
     $rule = new lmbRequiredRule('testfield');
     $dataspace = new lmbSet();
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} is required', 'validation'), array('Field' => 'testfield'), array()));
     $rule->validate($dataspace, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:7,代码来源:lmbRequiredRuleTest.class.php


示例2: testLocaleDateRuleError

 function testLocaleDateRuleError()
 {
     $rule = new lmbLocaleDateRule('test', new lmbLocale('en', new lmbIni(dirname(__FILE__) . '/en.ini')));
     $data = new lmbSet(array('test' => '02jjklklak/sdsdskj34-sdsdsjkjkj78'));
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} must have a valid date format', 'validation'), array('Field' => 'test'), array()));
     $rule->validate($data, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:7,代码来源:lmbLocaleDateRuleTest.class.php


示例3: testSizeRangeRuleTooSmall

 function testSizeRangeRuleTooSmall()
 {
     $rule = new lmbI18NSizeRangeRule('testfield', 30, 100);
     $data = new lmbSet(array('testfield' => 'тест'));
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} must be greater than {min} and less than {max} characters.', 'validation'), array('Field' => 'testfield'), array('min' => 30, 'max' => 100)));
     $rule->validate($data, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:7,代码来源:lmbI18NSizeRangeTest.class.php


示例4: _generateErrorMessage

 protected function _generateErrorMessage()
 {
     for ($i = 0; $i < count($this->field_names); $i++) {
         $fields[] = '{' . $i . '}';
     }
     return lmb_i18n('Atleast one field required among: {fields}', array('{fields}' => implode(', ', $fields)), 'validation');
 }
开发者ID:knevcher,项目名称:limb,代码行数:7,代码来源:lmbAtleastOneFieldRequiredRule.class.php


示例5: testInvalidAndMoreFields

 function testInvalidAndMoreFields()
 {
     $dataspace = new lmbSet();
     $rule = new lmbAtleastOneFieldRequiredRule(array('field1', 'field2', 'field3'));
     $this->error_list->expectOnce('addError', array(lmb_i18n('Atleast one field required among: {fields}', array('{fields}' => '{0}, {1}, {2}'), 'validation'), array('field1', 'field2', 'field3'), array()));
     $rule->validate($dataspace, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:7,代码来源:lmbAtleastOneFieldRequiredRuleTest.class.php


示例6: testNotValidWithClassRestriction

 function testNotValidWithClassRestriction()
 {
     $rule = new lmbRequiredObjectRule('testfield', 'Foo');
     $dataspace = new lmbSet();
     $dataspace->set('testfield', new TestObjectForThisRule());
     $this->error_list->expectOnce('addError', array(lmb_i18n('Object {Field} is required', 'validation'), array('Field' => 'testfield'), array()));
     $rule->validate($dataspace, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbRequiredObjectRuleTest.class.php


示例7: testEmailRuleInvalidDomain

 function testEmailRuleInvalidDomain()
 {
     $rule = new lmbEmailRule('testfield');
     $dataspace = new lmbSet();
     $dataspace->set('testfield', 'billgates@micro$oft.com');
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} must contain only letters, numbers, hyphens, and periods.', 'validation'), array('Field' => 'testfield'), array()));
     $rule->validate($dataspace, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbEmailRuleTest.class.php


示例8: testInArrayError

 function testInArrayError()
 {
     $rule = new lmbNotInArrayRule('testfield', array('www', 'ftp', 'smtp', 'mail'));
     $data = new lmbSet();
     $data->set('testfield', 'www');
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} has not allowed value.', 'validation'), array('Field' => 'testfield'), array()));
     $rule->validate($data, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbNotInArrayRuleTest.class.php


示例9: _doValidate

 /**
  * @see lmbBaseValidationRule :: _doValidate()
  */
 protected function _doValidate($datasource)
 {
     $value = $datasource->get($this->field_name);
     if (is_null($value) || is_string($value) && trim($value) === '') {
         $error = $this->custom_error ? $this->custom_error : lmb_i18n('{Field} is required', 'validation');
         $this->error($error, array('Field' => $this->field_name));
     }
 }
开发者ID:knevcher,项目名称:limb,代码行数:11,代码来源:lmbRequiredRule.class.php


示例10: testSizeRangeRuleTooSmall

 function testSizeRangeRuleTooSmall()
 {
     $rule = new lmbSizeRangeRule('testfield', 30, 100);
     $dataspace = new lmbSet();
     $dataspace->set('testfield', '12345678901234567890');
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} must be greater than {min} characters.', 'validation'), array('Field' => 'testfield'), array('min' => 30, 'max' => 100)));
     $rule->validate($dataspace, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbSizeRangeRuleTest.class.php


示例11: testUrlRuleDomain

 function testUrlRuleDomain()
 {
     $rule = new lmbUrlRule('testfield');
     $dataspace = new lmbSet();
     $dataspace->set('testfield', 'http://www.source--forge.net/');
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} may not contain double hyphens (--).', 'validation'), array('Field' => 'testfield'), array()));
     $rule->validate($dataspace, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbUrlRuleTest.class.php


示例12: testFieldNotValid2

 function testFieldNotValid2()
 {
     $rule = new lmbUniqueTableFieldRule('test', 'test_table', 'field1');
     $data = new lmbSet();
     $data->set('test', "001");
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} must have other value since {Value} already exists', 'web_app'), array('Field' => 'test'), array('Value' => '001')));
     $rule->validate($data, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbUniqueTableFieldRuleTest.class.php


示例13: testValidValueRule_Error_Int

 function testValidValueRule_Error_Int()
 {
     $rule = new lmbValidValueRule('testfield', 1);
     $data = new lmbSet();
     $data->set('testfield', 0);
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} value is wrong', 'validation'), array('Field' => 'testfield'), array()));
     $rule->validate($data, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbValidValueRuleTest.class.php


示例14: testNotValidContainsSlash

 function testNotValidContainsSlash()
 {
     $rule = new lmbIdentifierRule('test');
     $data = new lmbSet();
     $data->set('test', 'test/test');
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} must contain only letters and numbers', 'validation'), array('Field' => 'test'), array()));
     $rule->validate($data, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbIdentifierRuleTest.class.php


示例15: testPatternRuleFailed

 function testPatternRuleFailed()
 {
     $rule = new lmbPatternRule('testfield', '/^\\w+$/');
     $data = new lmbSet();
     $data->set('testfield', 'Simpletest is Cool!');
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} value is wrong', 'validation'), array('Field' => 'testfield'), array()));
     $rule->validate($data, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbPatternRuleTest.class.php


示例16: testNumericRuleTooManyDecimalDigits

 function testNumericRuleTooManyDecimalDigits()
 {
     $rule = new lmbNumericPrecisionRule('testfield', 3, 2);
     $dataspace = new lmbSet();
     $dataspace->set('testfield', '111.222');
     $this->error_list->expectOnce('addError', array(lmb_i18n('You have entered too many decimal digits ({digits}) in {Field} (max {maxdigits}).', 'validation'), array('Field' => 'testfield'), array('maxdigits' => 2, 'digits' => 3)));
     $rule->validate($dataspace, $this->error_list);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbNumericPrecisionRuleTest.class.php


示例17: testOnlyDigitsAllowedNumeric

 function testOnlyDigitsAllowedNumeric()
 {
     $rule = new lmbNumericValueRangeRule('testfield', 1, 4);
     $dataspace = new lmbSet();
     $dataspace->set('testfield', '4fdfasd');
     $this->error_list->expectOnce('addError', array(lmb_i18n('{Field} must be a valid number.', 'validation'), array('Field' => 'testfield'), array()));
     $rule->validate($dataspace, $this->error_list);
 }
开发者ID:knevcher,项目名称:limb,代码行数:8,代码来源:lmbNumericValueRangeRuleTest.class.php


示例18: check

 function check($value)
 {
     if (!is_null($this->min_length) && lmb_strlen($value) < $this->min_length) {
         $this->error(lmb_i18n('{Field} must be greater than {min} and less than {max} characters.', 'validation'), array('min' => $this->min_length, 'max' => $this->max_length));
     }
     if (lmb_strlen($value) > $this->max_length) {
         $this->error(lmb_i18n('{Field} must be less than {max} and greater than {min} characters.', 'validation'), array('min' => $this->min_length, 'max' => $this->max_length));
     }
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:9,代码来源:lmbI18NSizeRangeRule.class.php


示例19: _doValidate

 /**
  * @see lmbBaseValidationRule :: _doValidate()
  */
 protected function _doValidate($datasource)
 {
     $value1 = $datasource->get($this->field_name);
     $value2 = $datasource->get($this->reference_field);
     if (isset($value1) && isset($value2) && strcmp($value1, $value2)) {
         $error = $this->custom_error ? $this->custom_error : lmb_i18n('{Field} does not match {MatchField}.', 'validation');
         $this->error($error, array('Field' => $this->field_name, 'MatchField' => $this->reference_field));
     }
 }
开发者ID:r-kitaev,项目名称:limb,代码行数:12,代码来源:lmbMatchRule.class.php


示例20: _doValidate

 /**
  * @see lmbBaseValidationRule :: _doValidate()
  */
 protected function _doValidate($datasource)
 {
     $value = $datasource->get($this->field_name);
     if (!is_object($value) || $this->class && !$value instanceof $this->class) {
         $error = $this->custom_error ? $this->custom_error : lmb_i18n('Object {Field} is required', 'validation');
         $this->error($error, array('Field' => $this->field_name));
         return;
     }
 }
开发者ID:r-kitaev,项目名称:limb,代码行数:12,代码来源:lmbRequiredObjectRule.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mc4wp_get_api函数代码示例发布时间:2022-05-24
下一篇:
PHP linked_install_set_menu函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap