Homepage
Main navigation
Main content
Additional information
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Winter CMS resources and help articles
Simple and to the point. Optimized by the community.
×
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Edit trick
Changes will be published after manual review
Title
Give your trick a describing title. Do
not
start with «How to...».
Your trick
Keep it short and concise! Markdown is supported.
If you have `datepicker` field in your form, as shown below: ```yaml fields: startDate: label: Start Date type: datepicker mode: datetime dependsOn: mode dateMode: type: dropdown options: date: Date Only Mode datetime: Date And Time Mode ``` And you need to change it dynamically based on the `dateMode` field for example, do this in your `Plugins.php` file: ```php public function boot() { YourModel::extend(function ($model) { $model->bindEvent('model.form.filterFields', function ($form, $fields, $context) { if (isset($fields->dateMode)) { $mode = $fields->dateMode->value; $form->getFormWidget('startDate')->mode = $mode; } }); }); } ```
References
Add additional online resources to your trick
+ Add reference
Topics
If your trick fits more than one topic select multiple. Select at least one.
Backend
Plugin Development
CMS
Twig
Themes
Deployment
Tags
You can use existing tags or create new ones. Add at least one.
Submit for review
Cancel
We use cookies to measure the performance of this website. Do you want to accept these cookies?
Accept
Decline