Backend\Traits\VueMaker

VueMaker Trait Adds exception based methods to a class, goes well with [System\Traits\ViewMaker](/docs/api/system/traits/viewmaker).

To add a component call registerVueComponent() in a controller action:

$this->registerVueComponent('Plugin/VueComponents/MyComponent');

This will automatically load the component's JavaScript definition, component template, and CSS file.

See also:

Protected properties

protected array $vueComponents

A list of registered Vue component classes

Public methods

public void outputVueComponentTemplates()

public void registerVueComponent(String $componentClassName)

Registers a Vue component to be loaded when the action view renders.

Parameters
  • String $componentClassName

Protected methods

protected void isVueComponentRegistered($componentClassName)
Parameters
  • $componentClassName

protected void makeVueComponent($className)
Parameters
  • $className