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


PHP Forge::checkbox方法代码示例

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


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

示例1: 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;
 }
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:34,代码来源:forge_demo.php

示例2: _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;
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:20,代码来源:admin_photoannotation.php


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