本文整理汇总了PHP中Form_Group::createDirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Form_Group::createDirect方法的具体用法?PHP Form_Group::createDirect怎么用?PHP Form_Group::createDirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form_Group
的用法示例。
在下文中一共展示了Form_Group::createDirect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreatingForm
function testCreatingForm()
{
$forms = array(Form_Group::createDirect(), Form_Group::createFromConfig());
foreach ($forms as $form) {
$this->assertTrue($form->existsElement('userinfo'), '$form->existsElement(\'userinfo\')');
$this->assertTrue($form->existsElement('userinfo/username'), '$form->existsElement(\'userinfo/username\')');
$this->assertTrue($form->existsElement('profile/address'), '$form->existsElement(\'profile/address\')');
$this->assertTrue(isset($form['userinfo']), 'isset($form[\'userinfo\'])');
$this->assertTrue(isset($form['userinfo']['username']), 'isset($form[\'userinfo\'][\'username\'])');
$this->assertTrue(isset($form['profile']['address']), 'isset($form[\'profile\'][\'address\'])');
$username = $form->element('userinfo/username');
$this->assertType('QForm_Element', $username);
$this->assertEquals('username', $username->id);
$username = $form['userinfo']['username'];
$this->assertType('QForm_Element', $username);
$this->assertEquals('username', $username->id);
$this->assertSame($form, $form['userinfo']->owner());
$this->assertSame($form['userinfo'], $form['userinfo']['username']->owner());
}
}