october-form-controller

OctoberCMS - Update a field in a related table when inserting

和自甴很熟 提交于 2021-02-11 13:23:29
问题 In OctoberCMS, I have three tables: Students, Courses and Subscriptions (studentID, courseID, active) When student subscribes to a course, it's not activated until the admin activate it. That is logical. But When admin opens a course form from backend, he can select students to subscribe in this course, then they are added to subscriptions table. Here I would like to update the field: active automatically. How can I dot that? I wrote this code, but it didn't work: public function afterSave()

relationship between user and category OctoberCMS

半腔热情 提交于 2020-01-06 07:52:48
问题 how to establish a relationship between the user and the category? A category has more than one user, and a user belongs to a category I add category_id in the user table on the frontend I display the list of users with the plugin builder but I also want to display the category of the user I use the RainLab user plugin Help me please, thank you in advance 回答1: it seems you need to extend user model and add category relation runtime You need to add this code to your plugin's boot method public

OctoberCMS call another plugin's data in current plugin's dropdown

China☆狼群 提交于 2019-12-04 06:43:24
问题 I am new to OctoberCMS and i love the way it works. Currently i have created two plugins called as Products and Product Categories . I have created these plugins using Builder Plugin which is also a very good plugin to create another plugins with ease. Now the thing is, In my Products Categories plugin, i simply have a single field called as Product Category and user will add as many categories as he/she wants and this plugin works fine. And in my Products plugin, i have a field called as