本文整理匯總了PHP中ezcInputForm::getRequiredProperties方法的典型用法代碼示例。如果您正苦於以下問題:PHP ezcInputForm::getRequiredProperties方法的具體用法?PHP ezcInputForm::getRequiredProperties怎麽用?PHP ezcInputForm::getRequiredProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ezcInputForm
的用法示例。
在下文中一共展示了ezcInputForm::getRequiredProperties方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
echo "isValid:\n";
var_dump(true);
echo "Values:\n";
var_dump(3.14);
var_dump(2.72);
?>
</td>
<td>
<pre>
<?php
$def = array('test1' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'float'), 'test2' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'float'));
$form = new ezcInputForm(INPUT_POST, $def);
echo "Valid properties:\n";
var_dump($form->getValidProperties());
echo "Required properties:\n";
var_dump($form->getRequiredProperties());
echo "Optional properties:\n";
var_dump($form->getOptionalProperties());
echo "isValid:\n";
var_dump($form->isValid());
echo "Values:\n";
var_dump($form->test1);
var_dump($form->test2);
?>
</td>
</tr>
</table>
</body>
</html>
<?php
} else {
示例2: testOptionalProperties
public function testOptionalProperties()
{
$def = array('test2' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int'), 'test3' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int'));
$obj = new ezcInputForm(INPUT_GET, $def);
$expectedArray = array('test2', 'test3');
self::assertEquals($expectedArray, $obj->getOptionalProperties());
self::assertEquals(array(), $obj->getRequiredProperties());
}