本文整理汇总了PHP中Forge::dropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP Forge::dropdown方法的具体用法?PHP Forge::dropdown怎么用?PHP Forge::dropdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forge
的用法示例。
在下文中一共展示了Forge::dropdown方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Forge
static function get_sort_edit_form($item)
{
$sortPane = new Forge("organize/__FUNCTION__", "", "post", array("id" => "gEditSort", "ref" => "sort"));
$sortPane->hidden("item[]")->value($item->id);
$sortPane->dropdown("column", array("id" => "gAlbumSortColumn"))->label(t("Sort by"))->options(array("weight" => t("Order Added"), "captured" => t("Capture Date"), "created" => t("Creation Date"), "title" => t("Title"), "updated" => t("Updated Date"), "view_count" => t("Number of views"), "rand_key" => t("Random")))->selected($item->sort_column);
$sortPane->dropdown("direction", array("id" => "gAlbumSortDirection"))->label(t("Order"))->options(array("ASC" => t("Ascending"), "DESC" => t("Descending")))->selected($item->sort_order);
return $sortPane;
}
示例2: _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;
}
示例3: _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;
}
示例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: index
public function index()
{
$profiler = new Profiler();
$foods = array('tacos' => array('tacos', FALSE), 'burgers' => array('burgers', FALSE), 'spaghetti' => array('spaghetti (checked)', TRUE), 'cookies' => array('cookies (checked)', TRUE));
$form = new Forge(NULL, 'New User');
// Create each input, following this format:
//
// type($name)->attr(..)->attr(..);
//
$form->hidden('hideme')->value('hiddenz!');
$form->input('email')->label(TRUE)->rules('required|valid_email');
$form->input('username')->label(TRUE)->rules('required|length[5,32]');
$form->password('password')->label(TRUE)->rules('required|length[5,32]');
$form->password('confirm')->label(TRUE)->matches($form->password);
$form->checkbox('remember')->label('Remember Me');
$form->checklist('foods')->label('Favorite Foods')->options($foods)->rules('required');
$form->dropdown('state')->label('Home State')->options(locale_US::states())->rules('required');
$form->dateselect('birthday')->label(TRUE)->minutes(15)->years(1950, date('Y'));
$form->submit('save')->value('Save');
if ($form->validate()) {
echo Kohana::debug($form->as_array());
}
echo $form->render();
// Using a custom template:
// echo $form->render('custom_view', TRUE);
// Inside the view access the inputs using $input_id->render(), ->label() etc
//
// To get the errors use $input_id_errors.
// Set the error format with $form->error_format('<div>{message}</div>');
// Defaults to <p class="error">{message}</p>
//
// Examples:
// echo $username->render(); echo $password_errors;
}
示例6: _get_calenderprefs_form
private function _get_calenderprefs_form($display_year, $display_user)
{
// Generate a form to allow the visitor to select a year and a gallery photo owner.
$calendar_group = new Forge("calendarview/setprefs", "", "post", array("id" => "g-view-calendar-form"));
// Generate a list of all Gallery users who have uploaded photos.
$valid_users[-1] = "(All Users)";
$gallery_users = ORM::factory("user")->find_all();
foreach ($gallery_users as $one_user) {
$count = ORM::factory("item")->viewable()->where("owner_id", "=", $one_user->id)->where("type", "!=", "album")->where("captured", "!=", "")->find_all()->count();
if ($count > 0) {
$valid_users[$one_user->id] = $one_user->full_name;
}
}
// Generate a list of years, starting with the year the earliest photo was
// taken, and ending with the year of the most recent photo.
$valid_years = array();
$all_photos = ORM::factory("item")->viewable()->where("type", "!=", "album")->where("captured", "!=", "")->order_by("captured", "DESC")->find_all();
$counter = date('Y', $all_photos[count($all_photos) - 1]->captured);
while ($counter <= date('Y', $all_photos[0]->captured)) {
$valid_years[$counter] = $counter;
$counter++;
}
// Create the form.
$calendar_group->dropdown('cal_user')->label(t("Display Photos From User: "))->id('cal_user')->options($valid_users)->selected($display_user);
$calendar_group->dropdown('cal_year')->label(t("For Year: "))->id('cal_year')->options($valid_years)->selected($display_year);
// Add a save button to the form.
$calendar_group->submit("SaveSettings")->value(t("Go"))->id('cal_go');
// Return the newly generated form.
return $calendar_group;
}
示例7: _get_converter_form
private function _get_converter_form()
{
//get all tags
$tags = ORM::factory("tag")->order_by("name", "ASC")->find_all();
foreach ($tags as $tag) {
$tag_array[$tag->id] = $tag->name;
}
//get all users
$users = ORM::factory("user")->order_by("name", "ASC")->find_all();
foreach ($users as $user) {
$user_array[$user->id] = $user->display_name();
}
$form = new Forge("admin/photoannotation/converthandler", "", "post", array("id" => "g-admin-form"));
$form->dropdown("sourcetag")->label(t("Select tag"))->options($tag_array);
$form->dropdown("targetuser")->label(t("Select user"))->options($user_array);
$form->checkbox("deletetag")->label(t("Delete the tag after conversion."));
$form->checkbox("removetag")->label(t("Remove the tag from photos after conversion."));
$form->submit("submit")->value(t("Convert"));
return $form;
}