{"id":41731406,"url":"https://github.com/zimudec/oc-wizard-plugin","last_synced_at":"2026-01-24T23:34:17.133Z","repository":{"id":54610351,"uuid":"376098892","full_name":"zimudec/oc-wizard-plugin","owner":"zimudec","description":"Plugin for October CMS that allows you to easily implement and configure a wizard system of steps with forms and validations","archived":false,"fork":false,"pushed_at":"2021-06-15T15:52:21.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-19T00:49:41.858Z","etag":null,"topics":["cms","form","forms","october","octobercms","plugin","step","steps","validation","validations","wizard"],"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/zimudec.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}},"created_at":"2021-06-11T17:34:22.000Z","updated_at":"2022-10-01T14:30:35.000Z","dependencies_parsed_at":"2022-08-13T21:30:41.623Z","dependency_job_id":null,"html_url":"https://github.com/zimudec/oc-wizard-plugin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zimudec/oc-wizard-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimudec%2Foc-wizard-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimudec%2Foc-wizard-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimudec%2Foc-wizard-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimudec%2Foc-wizard-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimudec","download_url":"https://codeload.github.com/zimudec/oc-wizard-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimudec%2Foc-wizard-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28739006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cms","form","forms","october","octobercms","plugin","step","steps","validation","validations","wizard"],"created_at":"2026-01-24T23:34:16.573Z","updated_at":"2026-01-24T23:34:17.119Z","avatar_url":"https://github.com/zimudec.png","language":"PHP","readme":"# wizard plugin\n\nPlugin that allows you to easily implement and configure a wizard system of steps with forms and validations to [OctoberCMS](https://octobercms.com)\n\n![wizard_example](https://user-images.githubusercontent.com/491835/121744710-4b958d80-cad1-11eb-8490-1269c4e5d08c.png)\n\n## Installation\n\n```terminal\ncomposer require zimudec/oc-wizard-plugin\n```\n\n### Usage example\n\nCreate a new page and add the \"wizard\" component. You must configure the url to admit an optional parameter \"/:step?\", Configure the wizard steps, functions for ajax and the views of each step. Here is a complete example of a page with the implementation and explanatory comments. It can be used as a starting point:\n\n```\ntitle = \"Wizard Example\"\nurl = \"/wizard-example/:step?\"\nlayout = \"default\"\nis_hidden = 0\n\n[wizard]\n==\n\u003c?\nfunction onInit()\n{\n  // Register and configure list of steps that the wizard component will use\n  $this-\u003ewizard-\u003esteps = [\n\n    // Each of the steps allows you to configure a list of form validations.\n    // Once successfully validated, wizard will allow you to go to the next step.\n    // The validations will be called from the related ajax request.\n    ['step' =\u003e 'step1', 'name' =\u003e 'Step 1', 'forms' =\u003e [\n      'onStep1' =\u003e [\n        'validation' =\u003e ['field1' =\u003e 'required', 'field2' =\u003e 'required'],\n        'extra_validation' =\u003e function($validator, $fields, $prevValidationsData) {\n          // Extra validations\n          $errors = $validator-\u003eerrors();\n\n          // You can optionally avoid performing the extra validations, \n          // if the previous validations are not fulfilled\n          if(!$errors-\u003eany()){\n\n            // Extra validations that are complex to perform in native array of laravel validations\n            if($fields['field1'] != 'hello'){\n              $errors-\u003eadd('field1', 'The value of this field must be \"hello\"');\n            }\n\n            // Return data from here, allows you to use it in any subsequent step\n            // For example: this allows you to validate by consulting a data in the database,\n            // and reuse it in subsequent steps without having to consult it again\n            // This data remains in session during all the steps, until it is revalidated\n            return [\n              'user' =\u003e ['id' =\u003e 1, 'names' =\u003e 'User', 'lastname' =\u003e 'my lastnames'],\n            ];\n          }\n        }\n      ]\n    ]],\n    // By default, when entering a page, the wizard does not validate the previous steps.\n    // The \"validatePrevSteps\" field allows forcing the revalidation of all the previous steps.\n    // This is useful when you need to update the data obtained from extra validations.\n    ['step' =\u003e 'step2', 'name' =\u003e 'Step 2', 'validatePrevSteps' =\u003e true],\n    ['step' =\u003e 'step3', 'name' =\u003e 'Step 3', 'forms' =\u003e [\n      'onStep3' =\u003e [\n        'validation' =\u003e ['select' =\u003e 'required'],\n        'extra_validation' =\u003e function($validator, $fields, $prevValidationsData){\n        }\n      ]\n    ]],\n    ['step' =\u003e 'step4', 'name' =\u003e 'Step 4'],\n  ];\n  \n}\n\nfunction onEnd()\n{\n  // To include this script, add the tag {% put scripts%} {% endput%} after jquery\n  // This script shows and hides errors received from the server. Use bootstrap 4.x classes\n  $this-\u003eaddJs('/plugins/zimudec/wizard/assets/js/wizard.js');\n\n  $wizard = $this['wizard'];\n\n  if($wizard['stepCurrent'] == 'step1'){\n    // This only runs when opening the page. At this point, no validations are performed\n    $this['example_data'] = 'This is the step 1';\n  } \n  elseif( $wizard['stepCurrent'] == 'step2' ){\n    // You can get data received from the extra validations, and transfer it to the view\n    $this['user'] = $wizard['prevValidationsData']['user'];\n\n    // You can get the values of the fields that have been filled in previous steps\n    $this['field2'] = $wizard['fields']['field2'];\n    $this['field3'] = $wizard['fields']['field3'];\n  }\n  elseif( $wizard['stepCurrent'] == 'step3' ){\n    $this['selectData'] = [\n      ['id' =\u003e 1, 'name' =\u003e 'Name 1'],\n      ['id' =\u003e 2, 'name' =\u003e 'Name 2'],\n      ['id' =\u003e 3, 'name' =\u003e 'Name 3'],\n    ];\n  }\n}\n\nfunction onStep1()\n{\n  // When submitting the form in step1, this function will be executed and the extra validations and validations will be performed\n  $data = $this-\u003ewizard-\u003eformsValidate();\n\n  // Here you can perform any procedure before redirecting.\n  // This procedure will only be done 1 time when submitting the form.\n  // ...\n\n  // Here the rediction will be made to the next step\n  return redirect($data['stepNext']);\n}\n\nfunction onStep2()\n{\n  $data = $this-\u003ewizard-\u003eformsValidate();\n  return redirect($data['stepNext']);\n}\n\nfunction onStep3()\n{\n  // By default, only the fields of the current form are validated, and not the previous steps.\n  // When adding true as a parameter to the function,\n  // will force validation of all previous steps, in addition to the current one.\n  // This is useful for committing all the wizard data before doing something important, \n  // like inserting data into the database.\n  $data = $this-\u003ewizard-\u003eformsValidate(true);\n  return redirect($data['stepNext']);\n}\n?\u003e\n==\n\u003csection\u003e\n  {% partial '@nav_header.htm' title=(this.page.title) %}\n\n  {% if wizard.stepCurrent == 'step1' %}\n\n  \u003cdiv class=\"text-center\"\u003e{{ example_data }}\u003c/div\u003e\n  \u003cform class=\"mx-auto\" style=\"max-width: 400px;\" data-request=\"onStep1\" data-request-validate\u003e\n    {{ form_token() }}\n\n    {% partial '@input_text.htm' label=\"Field 1 *\" name=\"field1\" %}\n    {% partial '@input_text.htm' label=\"Field 2 *\" name=\"field2\" %}\n    {% partial '@input_text.htm' label=\"Field 3\" name=\"field3\" %}\n\n    {% partial '@nav_buttons.htm' %}\n  \u003c/form\u003e\n\n  {% elseif wizard.stepCurrent == 'step2' %}\n\n  {% partial '@header.htm' text=('Welcome ' ~ user.names) subtitle='This step does not require entering fields' %}\n  \u003cform class=\"mx-auto\" style=\"max-width: 400px;\" data-request=\"onStep2\" data-request-validate\u003e\n    {{ form_token() }}\n    {% partial '@input_text.htm' label=\"Field 2\" value=(field2) readonly=true %}\n    {% partial '@input_text.htm' label=\"Field 3\" value=(field3) readonly=true %}\n    {% partial '@nav_buttons.htm' %}\n  \u003c/form\u003e\n\n  {% elseif wizard.stepCurrent == 'step3' %}\n\n  {% partial '@header.htm' subtitle='This is the last step before finish the wizard' %}\n  \u003cform class=\"mx-auto\" style=\"max-width: 400px;\" data-request=\"onStep3\" data-request-validate\u003e\n    {{ form_token() }}\n\n    {% partial '@input_select.htm' label=\"Select *\" name=\"select\" items=(selectData)  %}\n    {% partial '@nav_buttons.htm' %}\n  \u003c/form\u003e\n\n  {% elseif wizard.stepCurrent == 'step4' %}\n\n  \u003cdiv class=\"mt-3 text-center\"\u003eWizard Finished. The wizard session was deleted. If you reload the page, it will go back to step1.\u003c/div\u003e\n  \u003chr \u003e\n  {% partial '@nav_buttons.htm' %}\n\n  {% endif %}\n\u003c/section\u003e\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimudec%2Foc-wizard-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimudec%2Foc-wizard-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimudec%2Foc-wizard-plugin/lists"}