{"id":16609935,"url":"https://github.com/zwacky/codeigniter_form_builder","last_synced_at":"2025-05-12T17:16:25.370Z","repository":{"id":5805712,"uuid":"7020477","full_name":"zwacky/codeigniter_form_builder","owner":"zwacky","description":"CodeIgniter library to build uniform form elements with bootstrap styling","archived":false,"fork":false,"pushed_at":"2013-07-10T14:29:04.000Z","size":145,"stargazers_count":63,"open_issues_count":1,"forks_count":36,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-12T17:15:49.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zwacky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-05T16:19:21.000Z","updated_at":"2025-01-13T15:21:31.000Z","dependencies_parsed_at":"2022-07-07T07:01:46.544Z","dependency_job_id":null,"html_url":"https://github.com/zwacky/codeigniter_form_builder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwacky%2Fcodeigniter_form_builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwacky%2Fcodeigniter_form_builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwacky%2Fcodeigniter_form_builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwacky%2Fcodeigniter_form_builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zwacky","download_url":"https://codeload.github.com/zwacky/codeigniter_form_builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253785013,"owners_count":21963903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T01:29:22.014Z","updated_at":"2025-05-12T17:16:25.345Z","avatar_url":"https://github.com/zwacky.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"CodeIgniter Form Builder\r\n========================\r\n\r\nCodeIgniter library to build uniform form elements with bootstrap styling. It makes building form elements faster and easier.\r\nIt's structured in 4 sections:\r\n* Initialization\r\n* Elements\r\n* Utility\r\n* Multi Elements\r\n\r\n\r\nInitialization\r\n==============\r\nput form_builder.php into your `application/library` directory and you're ready to go. calling functions will output the html right away. best to be used inside templates.\r\n\r\nload inside controller:\r\n\r\n    $this-\u003eload-\u003elibrary('form_builder');\r\n    \r\nuse inside template:\r\n\r\n    $this-\u003eform_builder-\u003etext('id_something', 'ID');\r\n\r\nthe functions hold default parameters that repeat themselves. they are the following:\r\n* **default**: the default value\r\n* **class**: additional css class(es)\r\n* **placeholder**: the html5 placeholder tag\r\n\r\n\r\nElements\r\n========\r\n\r\nText\r\n----\r\n\r\n    text($id, $name, $default = '', $class = 'input-large', $placeholder = '', $prepend = '', $append = '')\r\n\r\nadditional parameters:\r\n* **prepend**: prepended input (before text)\r\n* **append**: appended input (after text)\r\n\r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/text.png)\r\n\r\n    $this-\u003eform_builder-\u003etext('per_month', 'per Monat', '1350', 'input-large', 'Betrag', '', 'CHF');\r\n    $this-\u003eform_builder-\u003etext('per_month', 'per Woche', '', 'input-large', 'Betrag', '', 'CHF');\r\n\r\nPassword\r\n--------\r\n\r\n    password($id, $name, $default = '', $class = 'input-large', $placeholder = '', $prepend = '', $append = '') \r\n\r\nadditional parameters:\r\n* **prepend**: prepended input (before text)\r\n* **append**: appended input (after text)\r\n\r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/password.png)\r\n\r\n    $this-\u003eform_builder-\u003epassword('password', 'Passwort', '12345');\r\n\r\nRadio\r\n-----\r\n\r\n    radio($id, $name, $values, $default = '')\r\n    \r\nThe passed object with the multiple properties for the radio elements must contain `id` and `name`. The passed default value will be selected according to the `id` value.\r\n    \r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/radio.png)\r\n\r\n    $genders = array(\r\n      (object) array('id' =\u003e 1, 'name' =\u003e 'Männlich'),\r\n      (object) array('id' =\u003e 2, 'name' =\u003e 'Weiblich'),\r\n    );\r\n    $this-\u003eform_builder-\u003eradio('gender', 'Geschlecht', $genders, 2);\r\n\r\nOption\r\n------\r\n\r\n    option($id, $name, $values, $default = '', $class = 'input-large')\r\n\r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/option.png)\r\n\r\n    $countries = array(\r\n      (object) array('id' =\u003e 1, 'name' =\u003e 'Schweiz'),\r\n      (object) array('id' =\u003e 2, 'name' =\u003e 'Deutschland'),\r\n      (object) array('id' =\u003e 3, 'name' =\u003e 'Österreich'),\r\n    );\r\n    $this-\u003eform_builder-\u003eoption('country', 'Land', $countries, 1);\r\n\r\nDate\r\n----\r\n\r\n    date($id, $name, $default = '', $class = 'input-large', $placeholder = 'TT.MM.JJJJ')\r\n\r\nThis element requires the javascript library of bootstrap.\r\n* jQuery implementation: https://github.com/eternicode/bootstrap-datepicker\r\n\r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/date.png)\r\n\r\n    $this-\u003eform_builder-\u003edate('birthdate', 'Geburtstag');\r\n    \r\nTextarea\r\n--------\r\n\r\n    textarea($id, $name, $default = '', $class = 'input-xlarge', $rows = 5)\r\n\r\nadditional parameters:\r\n* **rows**: amount of rows\r\n\r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/textarea.png)\r\n\r\n    $this-\u003eform_builder-\u003etextarea('payment_remark', 'Bemerkung', 'default');\r\n    \r\nCheckbox\r\n--------\r\n\r\n    checkbox($name, $id, $value = '', $default = '', $class = '')\r\n    \r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/checkbox.png)\r\n\r\n    checkbox('Inaktiv', 'inactive', '', 1);\r\n    checkbox('Eigenschaft', 'settings', 'Inaktiv', 0);\r\n\r\nCheckboxes\r\n----------\r\n\r\n    checkboxes($name, $id, $boxes, $default = '', $class = '')\r\n\r\nThe passed object with the multiple properties for the radio elements must contain `id` and `name`. The passed default value will be selected according to the `id` value.\r\nThe checked entries are determined by a string separated by a `,`.\r\n\r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/checkboxes.png)\r\n\r\n    $equipments = array(\r\n      (object) array('id' =\u003e 1, 'name' =\u003e 'TV'),\r\n      (object) array('id' =\u003e 2, 'name' =\u003e 'Mikrowelle'),\r\n      (object) array('id' =\u003e 3, 'name' =\u003e 'Kühlschrank'),\r\n    );\r\n    $this-\u003eform_builder-\u003echeckboxes('Ausstattung', 'equipment', $equipments, '1,3');\r\n\r\nSingle Button (submit)\r\n----------------------\r\n    \r\n    single_button($name, $id = '', $class = '', $icon = '')\r\n\r\nadditional parameters:\r\n* **icon**: the bootstrap icon class (http://twitter.github.com/bootstrap/base-css.html#icons)\r\n\r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/single_button.png)\r\n\r\n    $this-\u003eform_builder-\u003esingle_button('speichern', 'submit_id', 'btn-primary');\r\n\r\nButton\r\n------\r\n\r\n    button($id, $name, $class = '')\r\n    \r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/button.png)\r\n\r\n    $this-\u003eform_builder-\u003ebutton('apply', 'übernehmen', 'disabled');\r\n\r\nHidden\r\n------\r\n\r\n    hidden($id, $default = '')\r\n\r\n    $this-\u003eform_builder-\u003ebutton('contact_id', '55');\r\n\r\ntranslates into:\r\n\r\n    \u003cinput type=\"hidden\" id=\"contact_id\" value=\"55\" /\u003e\r\n\r\n\r\nUtility\r\n=======\r\n\r\nSeparation\r\n----------\r\n\r\n    add_separation();\r\n    \r\nThis will add a little gap between two following elements.\r\nAs seen in the example code, the add_separation must be called one element before the actual break happens.\r\n\r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/add_separation.png)\r\n\r\n    $this-\u003eform_builder-\u003etext('monthly', 'per Monat', 0, 'span6', '', '', 'CHF');\r\n    $this-\u003eform_builder-\u003etext('weekly', 'per Woche', 0, 'span6', '', '', 'CHF');\r\n    $this-\u003eform_builder-\u003eadd_separation();\r\n    $this-\u003eform_builder-\u003etext('daily', 'per Tag', 0, 'span6', '', '', 'CHF');\r\n    $this-\u003eform_builder-\u003etext('additional_cost', 'Sonstiges', 0, 'span6', '', '', 'CHF');\r\n    \r\nEditable\r\n--------\r\n\r\n  set_editable($value);\r\n  \r\nadditional parameters:\r\n* **value**: boolean\r\n\r\nThis makes the following form elements editable or non-editable.\r\n\r\n\r\nMulti Form Elements\r\n===================\r\n\r\nThis is rather powerful, that's why it has its own section.\r\nBasically it combines all the before listed parameters and put them together. You can have as many form elements in a row as you like, you just have to keep the array parameters appropriately.\r\n\r\n    multi($ids, $name, $types, $default = array(), $class = array(), $param = array(), $prepend = array(), $append = array())\r\n    \r\n![ScreenShot](https://github.com/zwacky/codeigniter_form_builder/raw/master/readme-data/multi.png)\r\n\r\n    $this-\u003eform_builder-\u003emulti(\r\n      array('phone_area', 'phone'), \r\n      'Vorwahl / Telefon', \r\n      array(Form_builder::$TYPES-\u003eTEXT, Form_builder::$TYPES-\u003eTEXT), \r\n      array('555', '123456'), \r\n      array('span3', 'span7')\r\n    );\r\n    \r\nTypes\r\n-----\r\n\r\n    Form_builder::$TYPES = (object) array(\r\n      'TEXT' =\u003e 1,\r\n      'OPTION' =\u003e 2,\r\n      'CHECKBOX' =\u003e 3,\r\n      'DATE' =\u003e 4,\r\n      'RADIO' =\u003e 5,\r\n      'BUTTON' =\u003e 6,\r\n      'PASSSWORD' =\u003e 7,\r\n    );\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwacky%2Fcodeigniter_form_builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzwacky%2Fcodeigniter_form_builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwacky%2Fcodeigniter_form_builder/lists"}