added new custom 300 table
This commit is contained in:
@@ -1638,4 +1638,33 @@ class PreorderController extends mfBaseController {
|
||||
];
|
||||
}
|
||||
|
||||
public function custom300Action() {
|
||||
// Ensure PreorderModel is available or include it if necessary.
|
||||
// For this example, assuming PreorderModel exists and getAll300CustomPreorders is defined.
|
||||
$preorders = PreorderModel::getAll300CustomPreorders();
|
||||
|
||||
// Prepare JS variables to be sent to the frontend.
|
||||
// The data from getAll300CustomPreorders is already in a suitable format (objects with specific properties),
|
||||
// so we can pass it directly.
|
||||
$JSGlobals = [
|
||||
"BASE_URL" => self::getUrl(""),
|
||||
"MFAPPNAME" => MFAPPNAME_SLUG,
|
||||
"PAGE_TITLE" => "Custom Preorders (300)",
|
||||
"PATH" => [
|
||||
["text" => MFAPPNAME_SLUG, "href" => self::getUrl("Dashboard")],
|
||||
["text" => "Custom Preorders (300)", "href" => self::getUrl("Preorder/custom300")] // Adjust URL if module is different
|
||||
],
|
||||
"PREORDERS_DATA" => $preorders, // Directly pass the fetched data
|
||||
"IS_ADMIN" => $this->me->is(["Admin"]), // Pass admin status if needed in frontend
|
||||
];
|
||||
|
||||
// Ensure the additionalJS array includes your custom Vue component file.
|
||||
// This assumes PreorderCustom300.js is located in public/js/pages/Preorder/.
|
||||
$this->layout()->set('additionalJS', array_merge($this->additionalJS ?? [], ['js/pages/Preorder/PreorderCustom300.js']));
|
||||
|
||||
// Set layout for Vue view.
|
||||
$this->layout()->set("vueViewName", "PreorderCustom300"); // Name of the Vue component
|
||||
$this->layout()->set("JSGlobals", $JSGlobals);
|
||||
$this->layout()->setTemplate("VueViews/Vue"); // Assuming a generic Vue template
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user