本文整理汇总了PHP中Forge::submit方法的典型用法代码示例。如果您正苦于以下问题:PHP Forge::submit方法的具体用法?PHP Forge::submit怎么用?PHP Forge::submit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forge
的用法示例。
在下文中一共展示了Forge::submit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login()
{
if (Auth::instance()->logged_in()) {
$this->template->title = 'User Logout';
$form = new Forge('auth_demo/logout');
$form->submit('Logout Now');
} else {
$this->template->title = 'User Login';
$form = new Forge();
$form->input('username')->label(TRUE)->rules('required|length[4,32]');
$form->password('password')->label(TRUE)->rules('required|length[5,40]');
$form->submit('Attempt Login');
if ($form->validate()) {
// Load the user
$user = ORM::factory('user', $form->username->value);
if (Auth::instance()->login($user, $form->password->value)) {
// Login successful, redirect
url::redirect('auth_demo/login');
} else {
$form->password->add_error('login_failed', 'Invalid username or password.');
}
}
}
// Display the form
$this->template->content = $form->render();
}
示例2: _get_admin_form
private function _get_admin_form()
{
$form = new Forge("admin/hide/save", "", "post", array("id" => "g-hide-admin-form"));
$form->dropdown("access_permissions")->label(t("Who can see hidden items?"))->options(hide::get_groups_as_dropdown_options())->selected(module::get_var("hide", "access_permissions"));
$form->submit("save")->value(t("Save"));
return $form;
}
示例3: _get_admin_form
private function _get_admin_form()
{
// Make a new Form.
$form = new Forge("admin/exif_gps/saveprefs", "", "post", array("id" => "g-exif-gps-adminForm"));
// Create group for global settings, like the Maps API Key
$gps_global_group = $form->group("Global")->label(t("Global Settings"));
$gps_global_group->input("google_api_key")->label(t("Google APIs Console key (optional):"))->value(module::get_var("exif_gps", "googlemap_api_key"));
$gps_global_group->input("max_auto_zoom_level")->label(t("Maximum Auto-Zoom Level:"))->value(module::get_var("exif_gps", "googlemap_max_autozoom"));
$gps_global_group->checkbox("toolbar_map_album")->label(t("Show \"Map this album\" icon?"))->checked(module::get_var("exif_gps", "toolbar_map_album", false));
$gps_global_group->checkbox("toolbar_map_user")->label(t("Show \"Map this user\" icon?"))->checked(module::get_var("exif_gps", "toolbar_map_user", false));
$gps_global_group->checkbox("restrict_maps")->label(t("Restrict maps to registered users?"))->checked(module::get_var("exif_gps", "restrict_maps", false));
// Create a group for marker cluster settings
$gps_markercluster = $form->group("markercluster")->label(t("Marker Cluster Settings"));
$gps_markercluster->input("markercluster_gridsize")->label(t("Grid Size"))->value(module::get_var("exif_gps", "markercluster_gridsize"))->rules("required");
$gps_markercluster->input("markercluster_maxzoom")->label(t("Max Zoom"))->value(module::get_var("exif_gps", "markercluster_maxzoom"))->rules("required");
// Create a group for sidebar settings
$gps_sidebar = $form->group("Sidebar")->label(t("Sidebar Settings"));
$gps_sidebar->input("sidebar_default_zoom")->label(t("Default Zoom Level"))->value(module::get_var("exif_gps", "sidebar_zoom"))->rules("required");
$gps_sidebar->dropdown("sidebar_mapformat")->label(t("Map Interface"))->options(array(t("Static"), t("Interactive")))->selected(module::get_var("exif_gps", "sidebar_mapformat"));
$gps_sidebar->dropdown("sidebar_maptype")->label(t("Default Map Type"))->options(array(t("Map"), t("Satellite"), t("Hybrid"), t("Terrain")))->selected(module::get_var("exif_gps", "sidebar_maptype"));
// Create a group for map album/user settings
$gps_large_map_group = $form->group("LargeMap")->label(t("Map Album/User Settings"));
$gps_large_map_group->dropdown("largemap_maptype")->label(t("Default Map Type"))->options(array(t("Map"), t("Satellite"), t("Hybrid"), t("Terrain")))->selected(module::get_var("exif_gps", "largemap_maptype"));
// Add a save button to the form.
$form->submit("SaveSettings")->value(t("Save"));
// Return the newly generated form.
return $form;
}
示例4: _get_admin_form
private function _get_admin_form()
{
$form = new Forge("admin/star/save", "", "post", array("id" => "g-star-admin-form"));
$form->dropdown("show")->label(t("Default to showing..."))->options(array(0 => "All", 1 => "Starred"))->selected(module::get_var("star", "show"));
$form->submit("save")->value(t("Save"));
return $form;
}
示例5: _get_form
private function _get_form()
{
$form = new Forge("admin/auto_date", "", "post", array("id" => "g-admin-auto_date-form"));
$group = $form->group("auto_date")->label(t("Default filename convention(php's <a href=\"http://php.net/manual/en/function.strptime.php\">strptime() format</a>)"));
$group->input("template")->id("template")->label(t("Template:"))->value(module::get_var("auto_date", "template"));
$form->submit("submit")->value(t("Save"));
return $form;
}
示例6: _get_form
private function _get_form()
{
$form = new Forge("admin/date_tag", "", "post", array("id" => "g-admin-date_tag-form"));
$group = $form->group("date_tag")->label(t("Default Tag (php's <a href=\"http://php.net/manual/en/function.date.php\">date() format</a>)"));
$group->input("template")->id("template")->label(t("Template:"))->value(module::get_var("date_tag", "template"));
$form->submit("submit")->value(t("Save"));
return $form;
}
示例7: _get_form
private function _get_form()
{
$form = new Forge("admin/photoannotation/handler", "", "post", array("id" => "g-admin-form"));
$group = $form->group("photoannotation")->label(t("Photo annotation settings"));
$group->checkbox("showfaces")->label(t("Show face annotation below photo."))->checked(module::get_var("photoannotation", "showfaces", false));
$group->checkbox("shownotes")->label(t("Show note annotations below photo."))->checked(module::get_var("photoannotation", "shownotes", false));
$form->submit("submit")->value(t("Save"));
return $form;
}
示例8: _get_form
private function _get_form()
{
$form = new Forge("admin/custom_header/handler", "", "post", array("id" => "g-admin-form"));
$group = $form->group("custom_header")->label(t("Custom header"));
$group->textarea("custom_header_code")->label(t('Enter custom header tags on the form [meta name:"name" content:"content"/] to render <meta name="name" content="content"/>.
Pure HTML cannot be used due to internal filtering.'))->value(module::get_var("custom_header", "code"));
$form->submit("submit")->value(t("Save"));
return $form;
}
示例9: _get_form
private function _get_form()
{
$form = new Forge("admin/default_sort", "", "post", array("id" => "g-admin-default_sort-form"));
$group = $form->group("sort_order")->label(t("Sort Order"));
$group->dropdown("sort_column")->id(t("sort_column"))->label(t("Sort by"))->options(array_merge(array("none" => t("None")), album::get_sort_order_options()))->selected(module::get_var("default_sort", "default_sort_column", "none"));
$group->dropdown("sort_direction")->id(t("sort_direction"))->label(t("Sort by"))->options(array("none" => t("None"), "ASC" => t("Ascending"), "DESC" => t("Descending")))->selected(module::get_var("default_sort", "default_sort_direction", "none"));
$form->submit("submit")->value(t("Save"));
return $form;
}
示例10: Forge
function no_group_test()
{
$form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form"));
$form->input("title")->label(t("Title"));
$form->textarea("description")->label(t("Text Area"));
$form->submit("")->value(t("Submit"));
$csrf = access::csrf_token();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " . "id=\"g-test-group-form\">\n" . "<input type=\"hidden\" name=\"csrf\" value=\"{$csrf}\" />" . " <ul>\n" . " <li>\n" . " <label for=\"title\" >Title</label>\n" . " <input type=\"text\" name=\"title\" value=\"\" " . "class=\"textbox\" />\n" . " </li>\n" . " <li>\n" . " <label for=\"description\" >Text Area</label>\n" . " <textarea name=\"description\" rows=\"\" cols=\"\" " . "class=\"textarea\" ></textarea>\n" . " </li>\n" . " <li>\n" . " <input type=\"submit\" value=\"Submit\" class=\"submit\" />\n" . " </li>\n" . " </ul>\n" . "</form>";
$this->assert_same($expected, (string) $form);
}
示例11: _get_form
private function _get_form()
{
$form = new Forge("admin/fittoscreen/save", "", "post", array("id" => "g-admin-form"));
$form->dropdown("width_unit")->label(t("Image width unit"))->options(array("px" => "pixel margin", "pr" => "max pourcentage"))->selected(module::get_var("fittoscreen", "width_unit"));
$form->input("width")->label(t('width'))->rules("required|valid_numeric|length[1,5]")->value(module::get_var("fittoscreen", "width"));
$form->dropdown("height_unit")->label(t("Image height unit"))->options(array("px" => "pixel margin", "pr" => "max pourcentage"))->selected(module::get_var("fittoscreen", "height_unit"));
$form->input("height")->label(t('height'))->rules("required|valid_numeric|length[1,5]")->value(module::get_var("fittoscreen", "height"));
$form->submit("submit")->value(t("Save"));
return $form;
}
示例12: _get_admin_form
private function _get_admin_form()
{
$form = new Forge("admin/movies/save", "", "post", array("id" => "g-movies-admin-form"));
$group = $form->group("settings")->label(t("Settings"));
$group->dropdown("allow_uploads")->label(t("Allow movie uploads into Gallery (does not affect existing movies)"))->options(array("autodetect" => t("only if FFmpeg is detected (default)"), "always" => t("always"), "never" => t("never")))->selected(module::get_var("gallery", "movie_allow_uploads", "autodetect"));
$group->checkbox("rebuild_thumbs")->label(t("Rebuild all movie thumbnails (once FFmpeg is installed, use this to update existing movie thumbnails)"))->checked(false);
// always set as false
$form->submit("save")->value(t("Save"));
return $form;
}
示例13: _get_admin_form
private function _get_admin_form()
{
$form = new Forge("admin/pdf/save", "", "post", array("id" => "g-pdf-admin-form"));
$group = $form->group("settings")->label(t("PDF settings"));
$group->checkbox("make_thumb")->label(t("Generate thumbnails (only if Ghostscript is found)"))->checked(module::get_var("pdf", "make_thumb", null));
$group->checkbox("movie_overlay_hide")->label(t("Hide overlay from \"movie_overlay\" module (tested with Movie Overlay v3)"))->checked(module::get_var("pdf", "movie_overlay_hide", null));
$group->checkbox("rebuild_thumbs")->label(t("Mark all existing PDFs for rebuild - afterward, go to Maintenace | Rebuild Images"))->checked(false);
// always set as false
$form->submit("")->value(t("Save"));
return $form;
}
示例14: _get_admin_form
private function _get_admin_form()
{
// Make a new Form.
$form = new Forge("admin/language_flags/saveprefs", "", "post", array("id" => "g-language-flags-adminForm"));
// Figure out what type of flags to display.
$group_flag_types = $form->group("flag_types");
$group_flag_types->dropdown('flag_shape')->label(t("Flag Shape:"))->options(array('rectangular' => 'Rectangular', 'round' => 'Round', 'square' => 'Square', 'custom' => 'Custom'))->selected(module::get_var("language_flags", "flag_shape"));
// Add a save button to the form.
$form->submit("SavePrefs")->value(t("Save"));
// Return the newly generated form.
return $form;
}
示例15: upload
public function upload()
{
$profiler = new Profiler();
$form = new Forge();
$form->input('hello')->label(TRUE);
$form->upload('file', TRUE)->label(TRUE)->rules('required|size[200KB]|allow[jpg,png,gif]');
$form->submit('upload')->value('Upload');
if ($form->validate()) {
echo Kohana::debug($form->as_array());
}
echo $form->render();
}