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

Use View template explicitly in controllers. Add templates to options #80

Open
visto9259 opened this issue Jun 14, 2024 · 0 comments
Open
Labels
enhancement New feature or request V4 To be implemented in version 4
Milestone

Comments

@visto9259
Copy link
Member

visto9259 commented Jun 14, 2024

Currently, LmcUser uses a template stack in the View Manager configuration to map controller actions to templates.
Most users will replace the provided templates to suit their UI needs. To overwrite the default templates, the use will overwrite the template map to have the View Manager use their templates.

For example, to overwrite the login template, the use will overwrite the lmc-user/user/login to point to their template file.

To make customization easier, the controller action should use named template and the named template should be in the Module Options.

For example, the login template to use should be defined by:

  'lmcuser => [
     'templates' => [
          'login' => 'lmc-user/user/login',
          /* ... */
      ],
  ],

Then, in the login action, the controller will retrieve the login template from the Module Options and set the template for the View Model instead of relying on the View Manager to inject the template.

  • Add template options to LmcUser/Options/ModuleOptions with defaults refering the template map
  • Modify the View Manager module configuration to define a template map.
  • Modify the controller actions to use the templates from the ModuleOptions and explicitly set the template in the return View Model
  • Update test cases
  • Update documentation
@visto9259 visto9259 added enhancement New feature or request V4 To be implemented in version 4 labels Jun 14, 2024
@visto9259 visto9259 added this to the 4.0.0 milestone Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request V4 To be implemented in version 4
Projects
Status: 🏗 In progress
Development

No branches or pull requests

1 participant