本文整理匯總了PHP中theme::t_form方法的典型用法代碼示例。如果您正苦於以下問題:PHP theme::t_form方法的具體用法?PHP theme::t_form怎麽用?PHP theme::t_form使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類theme
的用法示例。
在下文中一共展示了theme::t_form方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: form_content
public static function form_content($content_type, $nid = 0)
{
$content_type = content_database::load_node_type($content_type);
if ($nid != 0) {
} else {
page::title("add new %node", array("%node" => $content_type->name));
}
$form = array();
$form['action'] = page::url("node/adding/" . $content_type->type);
$form['fields'] = array();
if ($content_type->has_title) {
$form['fields']['title'] = array("type" => "input", "label" => "title");
}
if ($content_type->has_body) {
$form['fields']['body'] = array("type" => "text", "label" => "Body");
}
foreach ($content_type->fields as $field) {
$fname = $field['field_machine_name'];
$form["fields"][$fname] = array("label" => $field['field_name']);
switch ($field["field_type"]) {
case "TEXT" || "text":
$form["fields"][$fname]["type"] = "text";
break;
}
}
$form["fields"]["submit"] = array("type" => "submit", "value" => "save");
return theme::t_form($form);
}
示例2: login_block
public static function login_block()
{
return theme::t_form(self::login_form_ui(array()));
}