当前位置: 首页>>代码示例>>PHP>>正文


PHP FormElement::setAttribute方法代码示例

本文整理汇总了PHP中FormElement::setAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP FormElement::setAttribute方法的具体用法?PHP FormElement::setAttribute怎么用?PHP FormElement::setAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormElement的用法示例。


在下文中一共展示了FormElement::setAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: confirmDelete

 public function confirmDelete($label)
 {
     $group = new GroupObject();
     if ($group->load_by_label($label)) {
         if (isset($_POST['delete'])) {
             $group = new GroupObject();
             $group->load_by_label($label);
             $group->delete();
             header("Location:" . Page::url("/admin/groups"));
         }
         $theme = new Theme();
         $form = new Form("POST", Page::url("/admin/groups/confirm/{$label}"));
         $link = new FormElement("a", null, t("Retourner à la liste des groupes"), "", "");
         $link->setAttribute("href", Page::url("/admin/groups/"));
         $form->addElement($link);
         $form->addElement(new InputElement("delete", "", t("supprimer le groupe"), "submit"));
         $theme->add_to_body($theme->forming($form));
         $theme->set_title("Confirmer la suppression du groupe {$label}");
         $theme->process_theme(Theme::STRUCT_ADMIN);
     } else {
         header("Location:" . Page::url("/admin/groups?err=notexists"));
     }
 }
开发者ID:decima,项目名称:M2-platine,代码行数:23,代码来源:GroupPage.php

示例2: forming

 public static function forming()
 {
     $form = new Form("POST", Page::url("/forms"));
     $input = new InputElement("login", "Identifiant :", "Pierre");
     $form->addElement($input);
     $form->addElement(new ClosedElement("br"));
     // Balise, Name, Label, Value
     $input = new FormElement("select", "age", "Age :", 10);
     $input->addElement(new FormElement("option", "", "0-10", 0));
     $input->addElement(new FormElement("option", "", "10-20", 10));
     $input->addElement(new FormElement("option", "", "20-30", 20));
     $input->addElement(new FormElement("option", "", "30-40", 30));
     $input->addElement(new FormElement("option", "", "40-50", 40));
     $form->addElement($input);
     $form->addElement(new ClosedElement("br"));
     $input = new FormElement("label", null, "Age : ");
     $input->addClasses("label_input_checkbox_radio");
     $form->addElement($input);
     $input = new InputElement("mabox1", "0-10", 0, "checkbox", "mabox1");
     $input->setAttribute("checked", "checked");
     $form->addElement($input);
     $input = new InputElement("mabox2", "10-20", 10, "checkbox", "mabox2");
     $input->setAttribute("checked", "checked");
     $form->addElement($input);
     $input = new InputElement("mabox3", "20-30", 20, "checkbox", "mabox3");
     $form->addElement($input);
     $input = new InputElement("mabox4", "30-40", 30, "checkbox", "mabox4");
     $input->setAttribute("checked", "checked");
     $input->setAttribute("disabled", "disabled");
     $form->addElement($input);
     $input = new InputElement("mabox5", "40-50", 40, "checkbox", "mabox5");
     $input->setAttribute("disabled", "disabled");
     $form->addElement($input);
     $input = new FormElement("label", null, "Age : ");
     $input->addClasses("label_input_checkbox_radio");
     $form->addElement($input);
     $input = new InputElement("monradio", "0-10", 0, "radio", "monradio1");
     $input->setAttribute("checked", "checked");
     $form->addElement($input);
     $input = new InputElement("monradio", "10-20", 10, "radio", "monradio2");
     $form->addElement($input);
     $input = new InputElement("monradio", "20-30", 20, "radio", "monradio3");
     $form->addElement($input);
     $input = new InputElement("monradio", "30-40", 30, "radio", "monradio4");
     $form->addElement($input);
     $input = new InputElement("monradio", "40-50", 40, "radio", "monradio5");
     $form->addElement($input);
     $input = new FormElement("textarea", "description", t("Description : "), "Test");
     $input->setAttribute("row", 6);
     $input->setAttribute("col", 18);
     $input->addClasses("actualite_area_text");
     $form->addElement($input);
     $form->addElement(new ClosedElement("br"));
     $input = new InputElement("monbutton", null, "Test JS", "button");
     $input->setAttribute("onclick", "alert('Test JS OK');");
     $form->addElement($input);
     $theme = new Theme();
     $theme->process_form($form);
     $theme->process_theme();
 }
开发者ID:decima,项目名称:M2-platine,代码行数:60,代码来源:module.php


注:本文中的FormElement::setAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。