Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for MakeFormCommand to generate a PageType as well #7

Open
axyr opened this issue Apr 17, 2016 · 0 comments
Open

Add option for MakeFormCommand to generate a PageType as well #7

axyr opened this issue Apr 17, 2016 · 0 comments

Comments

@axyr
Copy link
Owner

axyr commented Apr 17, 2016

Most of the time a Frontend Form is shown on a dedicated PageType.

To get started on a new frontend Form, right now you have to :

  1. Create a CustomForm class (or add a form on the controller, but I consider that bad practice)
  2. Create a new PageType/PageType_Controller
  3. Add the allowed actions for CustomForm and most of the time a result/thanks Action
  4. Create a new PageType.ss Layout template (and maybe even a CustomForm.ss template)
  5. Run dev/build?flush=all
  6. Go to the cms and create a dummy page

Better would be :

$ php supersake make:frontendform MyCustomForm --page=MyCustomFormPage --title=testform

And this would create :

  1. Form skeleton class
  2. MyCustomFormPage (or add the allowed_actions/methods if the class already exists)
  3. write a dummy page to the database
  4. optionally create a MyCustomForm.ss template from stub or framework template.

or :

$ php supersake make:frontendform MyCustomForm --page

That would create a MyCustomFormPage by naming convention {$FormName}Page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant