You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can add validation rules to require modeling elements in certain situations.
One example which is already included: as soon as the model contains at least one join relation, validation ensures that the controller layer has an ajax controller (for handling the auto completion requests during editing).
Possible feature
We could do this also for other things. Possible examples:
if there are upload fields: require a filepath modvar for defining the base path
if there are modvars: require a custom action named config
if there is a view action: require an integer modvar for defining the page size
Benefits
Generator templates would become easier. For example creating the config function would need less separate template logic in addition to other actions. The generator would not have to "guess" some things (like for example which controller contains the config action) as they are explicitely modeled.
Disadvantages
A little more effort during modeling.
Also this does not push convention over configuration.
Your feedback
Any opinions about that?
The text was updated successfully, but these errors were encountered:
I like the idea to have some automatic fields or validation. This would make it much easier for a non programmer to create modules with variables.
For example: If you add as a default value a #my_default_value,90# entry, automatically a variable with the name my_default_value with the default of "90" will be created and used inside the template. see #308 and #264
The better way is that required elements are automatically added as part of the generator workflow. A so-called model-to-model transformation is already doing that for many things, like the workflow state field, several module vars for images etc.
This approach avoids modeling efforts and also keeps the generator templates clean.
Rescheduled for 0.7.1 to review remaining validation rules which require things which could be done automatically instead. One example is that several string fields with certain flags (like language, locale, country, and so on) require activating the nospace flag, too. Replace such requirements by automatic model enhancement.
Context
We can add validation rules to require modeling elements in certain situations.
One example which is already included: as soon as the model contains at least one join relation, validation ensures that the controller layer has an ajax controller (for handling the auto completion requests during editing).
Possible feature
We could do this also for other things. Possible examples:
Benefits
Generator templates would become easier. For example creating the config function would need less separate template logic in addition to other actions. The generator would not have to "guess" some things (like for example which controller contains the config action) as they are explicitely modeled.
Disadvantages
A little more effort during modeling.
Also this does not push
convention over configuration
.Your feedback
Any opinions about that?
The text was updated successfully, but these errors were encountered: