Download the PHP package arrilot/vue-templates-in-php without Composer
On this page you can find all versions of the php package arrilot/vue-templates-in-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download arrilot/vue-templates-in-php
More information about arrilot/vue-templates-in-php
Files in arrilot/vue-templates-in-php
Download arrilot/vue-templates-in-php
More information about arrilot/vue-templates-in-php
Files in arrilot/vue-templates-in-php
Vendor arrilot
Package vue-templates-in-php
Short Description A simple package to manage vue components' templates in php
License MIT
Homepage https://github.com/arrilot/vue-templates-in-php
Package vue-templates-in-php
Short Description A simple package to manage vue components' templates in php
License MIT
Homepage https://github.com/arrilot/vue-templates-in-php
Keywords vue
Please rate this library. Is it a good library?
Informations about the package vue-templates-in-php
Vue templates in PHP
Introduction
There are two main ways to deal with vue components' templates:
- Single file components
<script type="text/x-template">
Single files components are great, but they have their own problems:
- You need a decent build setup.
- You can't manage templates from php directly.
If this is not an issue for you - go with them, you don't need this package then.
Otherwise this small packages can help you to set up
<script type="text/x-template">
scheme in a simple and maintainable way.
Installation
composer require arrilot/vue-templates-in-php
Usage
First of all create a helper like that
or place TemplateManager
object in a Service Container if you have one.
Add
somewhere in footer above a script that starts vue application.
Now you can start making templates. For example let's imagine that you want to create a component for main menu.
- Create a component without template somewhere in js.
- Create a
main-menu.php
file inside the directory you passed toTemplateManager
. This is a component template. You don't need to add any<script type="text/x-template">
or<template>
tags to it. It's done behind the scenes. - Register this template on pages where you need it -
vue()->addTemplate('main-menu')
. - Now you can reference it in a vue component you have created in step 1 like that:
template: '#vue-main-menu-template'
All versions of vue-templates-in-php with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6
The package arrilot/vue-templates-in-php contains the following files
Loading the files please wait ....