本文整理匯總了PHP中sfWidgetFormSchema::render方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfWidgetFormSchema::render方法的具體用法?PHP sfWidgetFormSchema::render怎麽用?PHP sfWidgetFormSchema::render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sfWidgetFormSchema
的用法示例。
在下文中一共展示了sfWidgetFormSchema::render方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sfWidgetFormSchema
$expected = <<<EOF
<tr>
<th>W4</th>
<td>
<table>
<tr>
<th><label for="w4_w3">W3</label></th>
<td><input type="text" name="w4[w3]" id="w4_w3" /></td>
</tr>
</table>
<input type="hidden" name="w1" id="w1" />
</td>
</tr>
EOF;
$t->is(str_replace("\n", '', preg_replace('/^ +/m', '', $w->render(null))), str_replace("\n", '', preg_replace('/^ +/m', '', fix_linebreaks($expected))), '->render() is able to render widget schema that only contains hidden fields when the last field is a form');
// __clone()
$t->diag('__clone()');
$w = new sfWidgetFormSchema(array('w1' => $w1, 'w2' => $w2));
$w1->setParent($w);
$w2->setParent($w);
$format1 = new sfWidgetFormSchemaFormatterList($w);
$format1->setTranslationCatalogue('english');
$w->addFormFormatter('testFormatter', $format1);
$w1 = clone $w;
$f1 = $w1->getFields();
$f = $w->getFields();
$t->is(array_keys($f1), array_keys($f), '__clone() clones embedded widgets');
foreach ($f1 as $name => $widget) {
$t->ok($widget !== $f[$name], '__clone() clones embedded widgets');
$t->ok($widget->getParent() === $w1, 'The parents hafe been changed');