本文整理汇总了PHP中Forms::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP Forms::generate方法的具体用法?PHP Forms::generate怎么用?PHP Forms::generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forms
的用法示例。
在下文中一共展示了Forms::generate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
{
$tpl = '';
switch ($el) {
case 'inputbox':
$tpl = '<div class="form-field"><input type="text" name="${param}" value="${value}" ${attr}${required} /><span class="small">${desc}</span></div>';
break;
case 'delimer':
$tpl = '<h1>${desc}</h1>';
break;
}
return $tpl;
}
function setButtons($arr = array())
{
echo '<div class="buttons"><input type="button" value="Apply" /> <input type="button" value="Cancel" /></div>';
}
}
if ($mode == "install") {
echo "INSTALL";
# $res=cbsd_cmd('env NOCOLOR=1 /usr/local/bin/sudo /usr/local/bin/cbsd task owner=cbsdweb autoflush=2 mode=new env NOCOLOR=1 /usr/local/bin/cbsd imghelper module=$hlper jname=$jname inter=0');
$res = cbsd_cmd("env NOCOLOR=1 /usr/local/bin/sudo /usr/local/bin/cbsd task owner=cbsdweb mode=new env NOCOLOR=1 /usr/local/bin/cbsd imghelper module={$helper} jname={$jname} inter=0");
exit(0);
}
$jail_form = $workdir . "/jails-system/" . $jname . "/helpers/" . $helper . ".sqlite";
if (file_exists($jail_form)) {
$form = new Forms($helper);
$form->generate();
//$form->setButtons(array('apply','cancel'));
} else {
echo "Module not installed for {$jname}. Please <a href='/img_helper_cfg.php?jname={$jname}&mode=install&helper={$helper}'>install module</a>";
}
示例2: getHelper
function getHelper()
{
$arr = array();
$jail_form = $this->workdir . "/jails-system/jail" . $this->jailId . "/helpers/" . $this->helper . ".sqlite";
if (file_exists($jail_form)) {
$jname = 'jail' . $this->jailId;
$form = new Forms($jname, $this->helper);
$res = $form->generate();
$arr = array('error' => false, 'form' => $res['html'], 'defaults' => $res['defaults']);
} else {
$arr = array('error' => true, 'errorMsg' => '<p>' . get_translate('Module') . ' <strong>' . $this->helper . '</strong> ' . get_translate('are not installed') . '.</p><p>' . get_translate('You need to') . ' <span class="install helper-' . $this->helper . '">' . get_translate('install the module') . '</span>.</p>');
}
return $arr;
}