/** * 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); }
<?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. *
<?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]+$'; }