本文整理匯總了PHP中InputFilter::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP InputFilter::add方法的具體用法?PHP InputFilter::add怎麽用?PHP InputFilter::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InputFilter
的用法示例。
在下文中一共展示了InputFilter::add方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInputFilter
public function getInputFilter()
{
if (!$this->inputFilter) {
$inputFilter = new InputFilter();
$inputFilter->add(array('name' => 'id', 'required' => 'true', 'filters' => array(array('name' => 'Int'))));
$inputFilter->add(array('name' => 'jenis', 'required' => 'true', 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100)))));
$inputFilter->add(array('name' => 'inmission', 'required' => 'true'));
}
return $inputFilter;
}
示例2: getInputFilter
public function getInputFilter()
{
if (!$this->inputFilter) {
$inputFilter = new InputFilter();
$factory = new InputFactory();
$inputFilter->add($factory->createInput(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100))))));
$inputFilter->add($factory->createInput(array('name' => 'password', 'required' => true)));
$this->inputFilter = $inputFilter;
}
return $this->inputFilter;
}
示例3: getInputFilter
public function getInputFilter($data)
{
$inputFilter = new InputFilter();
$factory = new InputFactory();
$inputFilter->add($factory->createInput(array('name' => 'id', 'required' => false)));
$validator = new \DoctrineModule\Validator\NoObjectExists(array('object_repository' => $this->objectManager->getRepository($this->entityName), 'fields' => array('fullname')));
//use in check email exist when sign up
$filter = $validator->isValid(array('fullname' => $data['fullName']));
// dumps 'true' if an entity matches
return $filter;
}
示例4: getInputFilter
public function getInputFilter()
{
if (!$this->inputFilter) {
$inputFilter = new InputFilter();
$factory = new InputFactory();
$inputFilter->add($factory->createInput(array('name' => 'id', 'required' => false, 'filters' => array(array('name' => 'Int')))));
$inputFilter->add($factory->createInput(array('name' => 'rating', 'required' => false, 'filters' => array(array('name' => 'Int')))));
$inputFilter->add($factory->createInput(array('name' => 'name', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100))))));
$inputFilter->add($factory->createInput(array('name' => 'alias', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 1, 'max' => 100))))));
/*
$inputFilter->add ( $factory->createInput ( array (
'name' => 'availability',
'required' => true,
'filters' => array (
array (
'name' => 'Int'
)
)
) ) );
$inputFilter->add ( $factory->createInput ( array (
'name' => 'description',
'required' => false,
'filters' => array (
array (
'name' => 'StripTags'
),
array (
'name' => 'StringTrim'
)
),
'validators' => array (
array (
'name' => 'StringLength',
'options' => array (
'encoding' => 'UTF-8',
'min' => 1,
'max' => 100
)
)
)
) ) );
$inputFilter->add ( $factory->createInput ( array (
'name' => 'detail_product',
'required' => false,
'filters' => array (
array (
'name' => 'StripTags'
),
array (
'name' => 'StringTrim'
)
),
'validators' => array (
array (
'name' => 'StringLength',
'options' => array (
'encoding' => 'UTF-8',
'min' => 1,
'max' => 100
)
)
)
) ) );
$inputFilter->add ( $factory->createInput ( array (
'name' => 'promotions',
'required' => false,
'filters' => array (
array (
'name' => 'Int'
)
)
) ) );
$inputFilter->add ( $factory->createInput ( array (
'name' => 'about_price',
'required' => false,
'filters' => array (
array (
'name' => 'Int'
)
)
) ) );
$inputFilter->add ( $factory->createInput ( array (
'name' => 'new',
'required' => false,
'filters' => array (
array (
'name' => 'Int'
)
)
) ) );
$inputFilter->add ( $factory->createInput ( array (
//.........這裏部分代碼省略.........