本文整理匯總了PHP中JFormHelper::loadRuleClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP JFormHelper::loadRuleClass方法的具體用法?PHP JFormHelper::loadRuleClass怎麽用?PHP JFormHelper::loadRuleClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JFormHelper
的用法示例。
在下文中一共展示了JFormHelper::loadRuleClass方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadRuleClass
/**
* Helper wrapper method for loadRuleClass
*
* @param string $type Type of a rule whose class should be loaded.
*
* @return mixed Class name on success or false otherwise.
*
* @see JFormHelper::loadRuleClass()
* @since 3.4
*/
public function loadRuleClass($type)
{
return JFormHelper::loadRuleClass($type);
}
示例2: defined
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
JFormHelper::loadRuleClass('email');
/**
* JFormRule for com_contact to make sure the email address is not blocked.
*
* @since 1.6
*/
class JFormRuleContactEmail extends JFormRuleEmail
{
/**
* Method to test for banned email addresses
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object.
* @param mixed $value The form field value to validate.
* @param string $group The field name group control value. This acts as as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
* @param Registry $input An optional Registry object with the entire data set to validate against the entire form.
* @param JForm $form The form object for which the field is being tested.
*
示例3: defined
<?php
/**
* Created by JetBrains PhpStorm.
* User: Ngoc Nha
* Date: 4/14/13
* Time: 5:17 PM
* To change this template use File | Settings | File Templates.
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla formrule library
//jimport('joomla.form.rule');
JFormHelper::loadRuleClass('greeting');
/**
* Form Rule class for the Joomla Framework.
*/
class JFormRuleGreeting extends JFormRule
{
/**
* The regular expression.
*
* @access protected
* @var string
* @since 2.5
*/
protected $regex = '^[^0-9]+$';
}