Stud.IP  6.1
VueApp Class Reference
Inheritance diagram for VueApp:

Public Member Functions

 getAppPath ()
 
 withProps (array $props, bool $overwrite=false)
 
 getProps ()
 
 setSlot (string $name, string|Template $content)
 
 withSlot (string $name, string|Template $content)
 
 withSlots (array $slots, bool $overwrite=false)
 
 getSlots ()
 
 withStore (string $store, ?string $command=null, ?array $data=null)
 
 getStores ()
 
 getStoreData ()
 
 withVuexStore (string $store, ?string $index=null, ?array $data=null)
 
 getVuexStores ()
 
 getVuexStoreData ()
 
 withPlugin (string $plugin, string $filename=null)
 
 getPlugins ()
 
 getTemplate ()
 
 render ()
 
 __toString ()
 

Static Public Member Functions

static create (string $appPath)
 

Detailed Description

PHP abstraction of vue app

The VueApp is used to create a Vue app in a general way. Just create it using the relative path of the app component and pass in any required props or stores including initial data.

The store data is passed as an associative array where the key is the name of the mutation to call with the given value as data.

All methods are written in fluid manner so that you can create the app like this:

<?= Studip::create('ExampleApp') ->withProps(['foo' => 'bar']) ->withStore('exampleStore', data: ['setBar' => 'baz']) ?>

All with* methods will always create a new cloned instance so the original instance is immutable.

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Since
Stud.IP 6.0

Member Function Documentation

◆ __toString()

__toString ( )

Returns a string representation of the vue app by rendering it.

◆ create()

static create ( string  $appPath)
static

Creates a vue app with the given relative path to the app component.

◆ getAppPath()

getAppPath ( )

Returns the relative path to the app component.

◆ getPlugins()

getPlugins ( )

Returns all plugins

◆ getProps()

getProps ( )

Returns all props

◆ getSlots()

getSlots ( )

Returns all slots

◆ getStoreData()

getStoreData ( )

Returns all store data

◆ getStores()

getStores ( )

Returns all stores

◆ getTemplate()

getTemplate ( )

Returns the template to render the vue app

◆ getVuexStoreData()

getVuexStoreData ( )

Returns all vuex store data

◆ getVuexStores()

getVuexStores ( )

Returns all vuex stores

◆ render()

render ( )

Renders the vue app

◆ setSlot()

setSlot ( string  $name,
string|Template  $content 
)

Set the content of a slot.

◆ withPlugin()

withPlugin ( string  $plugin,
string  $filename = null 
)

Adds a plugin

You may specify a different filename for the plugin.

◆ withProps()

withProps ( array  $props,
bool  $overwrite = false 
)

Add props

You may choose to overwrite the defined props

◆ withSlot()

withSlot ( string  $name,
string|Template  $content 
)

Add a slot with the given name

If you pass a flexi template as the content, it will be rendered.

◆ withSlots()

withSlots ( array  $slots,
bool  $overwrite = false 
)

Add slots

You may choose to overwrite the defined slots

◆ withStore()

withStore ( string  $store,
?string  $command = null,
?array  $data = null 
)

Adds a store

◆ withVuexStore()

withVuexStore ( string  $store,
?string  $index = null,
?array  $data = null 
)

Adds a vuex store


The documentation for this class was generated from the following file: