{"id":15880803,"url":"https://github.com/tvaliasek/yabsform","last_synced_at":"2026-05-09T04:32:56.536Z","repository":{"id":45125823,"uuid":"186064822","full_name":"tvaliasek/yabsform","owner":"tvaliasek","description":"Bootstrap4 form rendering and  custom elements for nette forms.","archived":false,"fork":false,"pushed_at":"2025-06-03T17:29:35.000Z","size":695,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T02:26:42.620Z","etag":null,"topics":["bootstrap","forms","nette","renderer"],"latest_commit_sha":null,"homepage":"","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/tvaliasek.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":"2019-05-10T23:08:38.000Z","updated_at":"2025-06-03T17:29:07.000Z","dependencies_parsed_at":"2022-08-25T23:00:52.836Z","dependency_job_id":null,"html_url":"https://github.com/tvaliasek/yabsform","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tvaliasek/yabsform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvaliasek%2Fyabsform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvaliasek%2Fyabsform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvaliasek%2Fyabsform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvaliasek%2Fyabsform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tvaliasek","download_url":"https://codeload.github.com/tvaliasek/yabsform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvaliasek%2Fyabsform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bootstrap","forms","nette","renderer"],"created_at":"2024-10-06T03:21:57.671Z","updated_at":"2026-05-09T04:32:56.504Z","avatar_url":"https://github.com/tvaliasek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"YABSForm - Nette 3 Bootstrap form renderer with custom controls support\n=================\n\nYet another Bootstrap 4 form renderer and custom form components for [Nette framework](https://nette.org).\nInspired by [contributte/forms](https://github.com/contributte/forms), [nextras/forms](https://github.com/nextras/forms) and [Kdyby/BootstrapFormRenderer](https://github.com/Kdyby/BootstrapFormRenderer).\n\nTodo: \n - write tests\n \nRequirements\n------------\n\n- PHP 7.3\n\nInstallation\n------------\nInstall with composer:\n\n\tcomposer require tvaliasek/yabsform\n\t\nRegister extensions in your *.neon config.\n\n    extensions:\n        yabsform.controls: YABSForm\\DI\\FormControlsExtension\n        yabsform.formFactory: YABSForm\\DI\\FormFactoryExtension\n        yabsform.formMacros: YABSForm\\DI\\FormMacrosExtension\n        \nUsage\n----------------\n\nThe simplest way is to use provided form factory, which creates \nForm instance and sets renderer to BootstrapFormRenderer.\n\n\t/* example in presenter */\n\t\n\t/**\n    * @inject\n    * @var \\YABSForm\\Factories\\BootstrapFormFactory\n    */\n    public $formFactory;\n    \n    protected function createComponentExampleForm(): Form\n    {\n        $form = $this-\u003eformFactory-\u003ecreate();\n        /* ... add controls, callbacks etc. */\n        return $form;\n    }\n    \n    /* example in component or service */\n  \n    /**\n    * @var \\YABSForm\\Factories\\BootstrapFormFactory\n    */\n    private $formFactory;\n    \n    public function __construct(\\YABSForm\\Factories\\BootstrapFormFactory $formFactory)\n    {\n        $this-\u003eformFactory = $formFactory\n    }\n\n### Custom methods in renderer ###\n\nRenderer provide few methods whose allow common modifications of rendered output.\n\n    $renderer = $form-\u003egetRenderer();\n    \n    // Sets default css class names for submit inputs\n    $renderer-\u003esetSubmitButtonClassnames('btn-lg btn-primary');\n    \n    // Sets default css class names for buttons other than submit inputs\n    $renderer-\u003esetButtonClassnames('btn-secondary');\n    \n    // Disables dismissibility of form errors presented as bootstrap alerts\n    $renderer-\u003edisableDismissibleFormErrors()\n    \n    // Set globally size of controls\n    $renderer-\u003esetControlSize('lg')\n\n    // Set globally columns for labels and for controls (in vertical render mode)\n    $renderer-\u003esetLabelColumns(12, null, null, 4, null)\n    $renderer-\u003esetControlColumns(12, null, null, 8, null)\n\n    \n### Custom form macros ###\n\nThis package also provides few custom macros for more control over form layout.\nAll of them are unpaired and does not accept more parameters.\n\n    {* in latte template *}\n    {form exampleForm}\n        {* renders form errors *}\n        {bsErrors}\n        {* renders form own errors *}\n        {bsOwnErrors}\n        \n        {* renders whole form-group with input, feedback and label *}\n        {bsPair exampleInput}\n        \n        {* renders only label*}\n        {bsLabel exampleInput}\n        \n        {* renders only input *}\n        {bsInput exampleInput}\n    {/form}\n    \n### Custom Bootstrap form elements ###\n\nAvailable is:\n - CustomCheckbox - renderable also as switch\n - CustomCheckboxList - renderable also as switches\n - CustomMultiSelect\n - CustomRadioList\n - CustomRange\n - CustomSelect\n - CustomUpload - see [bootstrap docs](https://getbootstrap.com/docs/4.3/components/forms/#file-browser) for displaying names of selected files\n - DatePicker and DateTimePicker is in separated repo here [Nextras Forms Fork](https://github.com/tvaliasek/nextras-forms-fork)\n \nFor properly displayed invalid feedback message, you should include this additional style:\n    \n    \u003cstyle\u003e\n        .__yabsform-is-invalid ~ .invalid-feedback,\n        .custom-range.is-invalid ~ .invalid-feedback,\n        .custom-file.is-invalid ~ .invalid-feedback,\n        .custom-control.is-invalid ~ .invalid-feedback{\n            display: block;\n        }\n    \u003c/style\u003e\n    \nExample of usage in form:\n\n    $form-\u003eaddCustomCheckbox('switch', 'Custom checkbox switch')\n        -\u003erenderAsSwitch(true);\n    $form-\u003eaddCustomCheckbox('custom', 'Custom checkbox');\n    \n    $form-\u003eaddCustomCheckboxList('customList', 'Custom checkbox list', [\n        'first' =\u003e 'first item',\n        'second' =\u003e 'second item',\n        'third' =\u003e 'third item'\n    ]);\n    $form-\u003eaddCustomCheckboxList('customSwitchesList', 'Custom switches checkbox list', [\n        'first' =\u003e 'first item',\n        'second' =\u003e 'second item',\n        'third' =\u003e 'third item'\n    ])-\u003erenderAsSwitches(true);\n    \n    $form-\u003eaddCustomRadioList('customRadioList', 'Custom radio list', [\n        'first' =\u003e 'first item',\n        'second' =\u003e 'second item',\n        'third' =\u003e 'third item'\n    ]);\n    \n    $form-\u003eaddCustomSelect('customSelect', 'Custom select', [\n        'first' =\u003e 'first item',\n        'second' =\u003e 'second item',\n        'third' =\u003e 'third item'\n    ]);\n    \n    $form-\u003eaddCustomMultiSelect('customMultiselect', 'Custom multiselect', [\n        'first' =\u003e 'first item',\n        'second' =\u003e 'second item',\n        'third' =\u003e 'third item'\n    ]);\n    \n    $form-\u003eaddCustomUpload('customUpload', 'Custom upload')\n        -\u003esetBrowseCaption('Procházet');\n    \n    $form-\u003eaddCustomRange('customRange', 'Custom range', 0, 2, .5)\n        -\u003esetRequired(true);\n        \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvaliasek%2Fyabsform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftvaliasek%2Fyabsform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvaliasek%2Fyabsform/lists"}