octobercms

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()

October CMS : Not able to create a Form Widget

僤鯓⒐⒋嵵緔 提交于 2021-02-07 17:24:24
问题 I'm new to October CMS and learning to create a Form Widget. But I'm getting the following error : The partial '_field_actorbox.htm' is not found. /opt/lampp/htdocs/octobermovies/modules/system/traits/ViewMaker.php line 65 My widget folder name is 'formwidgets' My partials file name inside partials folder is '_widget.htm' Content of my formwidgets > Actorbox.php namespace Watchlearn\Movies\FormWidgets; use Backend\Classes\FormWidgetBase; use Config; class ActorBox extends FormWidgetBase {

Show Dropdown value in listing search instead of dropdown key using builder plugin

南楼画角 提交于 2021-01-27 17:38:53
问题 I am using OctoberCMS and using one of its awesome plugins called as builder and so far so good. But, I am stuck at one stage and confused how to achieve this. This is my scenario below. I have created one new field called as "status" in my one of the plugins in which I have key values like (0=>Inactive, 1=>Active) .. this works fine as i am able to insert or update values based on my status selection.. But the thing is, when i go to listing page, i have selected a "status" field but its

Extracting October pages indentation in JSON for a Vue.js app

夙愿已清 提交于 2020-07-10 07:29:47
问题 For building a vue menu in October, I have a plugin that I want to extract the October pages structure in a JSON data keeping the pages and subpages indentation. Based on this post : How to get static page dropdown in OctoberCMS with get page tree? I used the following code : public function boot() { \RainLab\Pages\Classes\Page::extend(function($model) { $model->addDynamicMethod('getPageOptions', function() { $theme = \Cms\Classes\Theme::getEditTheme(); $pageList = new \RainLab\Pages\Classes

How to set value for additional column in pivot table in OctoberCMS?

筅森魡賤 提交于 2020-04-30 07:07:45
问题 I have doctor and specialization table, and have doctor_specialization_pivot table. In my pivot table I have the following columns: | doctor_id | additional_data | specialization_id | additional_data is from the doctor model along with the doctor_id . In my doctor model file, I have this relationship: public $belongsToMany = [ 'specialization' => [ 'path\to\specialization\model', 'table' => 'doctor_specialization_pivot', 'parentKey' => 'doctor_id', 'otherKey' => 'specialization_id', ] ]; Now

Relation Manager Not Showing Pivot Data

你离开我真会死。 提交于 2020-04-17 21:53:52
问题 So this question came about because of this other question I was looking into. So I have dabbled in this a bit working with backend forms and thought I knew how to tackle this. However I am not seeing the results that I thought I would. I have tried to do some research and haven't seen anyone bring this up in the issues on the github page or here in stackoverflow. Unless I missed it. How do you show the stored extra Pivot Data in the backend? Here is my model.php relationship: public

Relation Manager Not Showing Pivot Data

左心房为你撑大大i 提交于 2020-04-17 21:53:46
问题 So this question came about because of this other question I was looking into. So I have dabbled in this a bit working with backend forms and thought I knew how to tackle this. However I am not seeing the results that I thought I would. I have tried to do some research and haven't seen anyone bring this up in the issues on the github page or here in stackoverflow. Unless I missed it. How do you show the stored extra Pivot Data in the backend? Here is my model.php relationship: public