{"id":15307044,"url":"https://github.com/kenjis/ci4-validation-tutorial","last_synced_at":"2025-04-15T00:54:23.771Z","repository":{"id":142580906,"uuid":"525644746","full_name":"kenjis/ci4-validation-tutorial","owner":"kenjis","description":"CodeIgniter 4 Validation Tutorial","archived":false,"fork":false,"pushed_at":"2023-12-14T12:36:19.000Z","size":572,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T00:54:15.733Z","etag":null,"topics":["codeigniter","codeigniter4","tutorial","validation"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenjis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-08-17T04:56:25.000Z","updated_at":"2025-02-06T03:13:12.000Z","dependencies_parsed_at":"2023-12-14T13:44:03.678Z","dependency_job_id":"74a60ef6-b31e-4435-99ea-76518b07b0c4","html_url":"https://github.com/kenjis/ci4-validation-tutorial","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/kenjis%2Fci4-validation-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-validation-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-validation-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-validation-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjis","download_url":"https://codeload.github.com/kenjis/ci4-validation-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986279,"owners_count":21194025,"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":["codeigniter","codeigniter4","tutorial","validation"],"created_at":"2024-10-01T08:08:54.017Z","updated_at":"2025-04-15T00:54:23.752Z","avatar_url":"https://github.com/kenjis.png","language":"PHP","readme":"# CodeIgniter 4 Validation Tutorial\n\nSince v4.3.0, new Form helper functions\n[validation_errors()](https://codeigniter.com/user_guide/helpers/form_helper.html#validation_errors),\n[validation_list_errors()](https://codeigniter.com/user_guide/helpers/form_helper.html#validation_list_errors)\nand [validation_show_error()](https://codeigniter.com/user_guide/helpers/form_helper.html#validation_show_error)\nto display Validation Errors are added.\n\nYou can use the same View form file for a simple form and a form with redirect.\n\n## Requirement\n\n- PHP 7.4 or later\n- CodeIgniter 4.4\n\n## Setup\n\n```console\n$ git clone https://github.com/kenjis/ci4-validation-tutorial.git\n$ cd ci4-validation-tutorial/\n$ composer install\n```\n\n```console\n$ php spark serve\n```\n\n## Forms\n\n### [Form1](https://github.com/kenjis/ci4-validation-tutorial/blob/0db0bda900d2f28cdff9ef21d7c9dcaad6705927/app/Controllers/Form.php#L14)\n\nThis is a simple form:\n\n- Navigate to http://localhost:8080/form1 (`GET /form1`)\n  - Display the [form1](https://github.com/kenjis/ci4-validation-tutorial/blob/main/app/Views/form1.php)\n- Submit (`POST /form1`)\n  - Validation passes → Display [success](https://github.com/kenjis/ci4-validation-tutorial/blob/main/app/Views/success.php)\n  - Validation fails → Display [form1](https://github.com/kenjis/ci4-validation-tutorial/blob/main/app/Views/form1.php) with Errors\n\n### [Form2](https://github.com/kenjis/ci4-validation-tutorial/blob/0db0bda900d2f28cdff9ef21d7c9dcaad6705927/app/Controllers/Form.php#L50)\n\nThis form is using redirect and withInput():\n\n- Navigate to http://localhost:8080/form2 (`GET /form2`)\n  - Display the [form2](https://github.com/kenjis/ci4-validation-tutorial/blob/main/app/Views/form2.php)\n- Submit (`POST /form2`)\n  - Validation passes → Display [success](https://github.com/kenjis/ci4-validation-tutorial/blob/main/app/Views/success.php)\n  - Validation fails → Redirect back → (`GET /form2`) Display [form2](https://github.com/kenjis/ci4-validation-tutorial/blob/main/app/Views/form2.php) with Errors\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjis%2Fci4-validation-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjis%2Fci4-validation-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjis%2Fci4-validation-tutorial/lists"}