paneon / php-vue-to-twig
Installs: 17 051
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 3
Forks: 4
Open Issues: 1
Requires
- php: ^7.3|^8.0
- ext-dom: *
- ext-libxml: *
- ramsey/uuid: ^3.8
- scssphp/scssphp: ^1.9
- squizlabs/php_codesniffer: ^3.3
Requires (Dev)
- ext-simplexml: *
- friendsofphp/php-cs-fixer: ^2.16
- monolog/monolog: ^1.24
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^9
- dev-master
- 0.32.2
- 0.32.1
- 0.32.0
- 0.31.5
- 0.31.4
- 0.31.3
- 0.31.2
- 0.31.1
- 0.31.0
- 0.30.0
- v0.29.3
- 0.29.2
- 0.29.1
- 0.29.0
- 0.28.1
- 0.28.0
- 0.27.2
- 0.27.1
- 0.27.0
- 0.26.1
- 0.26.0
- 0.25.6
- 0.25.5
- 0.25.4
- 0.25.3
- 0.25.2
- 0.25.1
- 0.25.0
- 0.24.1
- 0.24.0
- 0.23.0
- 0.22.1
- 0.22.0
- 0.21.0
- 0.20.1
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.2
- 0.17.1
- 0.17.0
- 0.16.1
- 0.16.0
- 0.15.1
- 0.15.0
- 0.14.3
- 0.14.2
- 0.14.1
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.0
- v0.2.1
- v0.2
- dev-feature/php8
- dev-Macavity-patch-1
- dev-Add-actions
- dev-bugfix/props
- dev-feature/phpstan
- dev-feature/filters
- dev-develop
- dev-bugfix/missing-spaces
- dev-feature/twig-block
- dev-feature/slots
- dev-feature/required-props
- dev-feature/double-attribute-binding
- dev-feature/template-strings
- dev-feature/SHODEVS2-26
- dev-feature/SHODVES2-122
This package is auto-updated.
Last update: 2025-04-04 17:32:16 UTC
README
Compile vue files to twig templates with PHP
Directives
Directive | Implemented |
---|---|
v-text | ✅ |
v-html | ✅ |
v-show | ✅ |
v-if | ✅ |
v-else | ✅ |
v-else-if | ✅ |
v-for | ✅ |
v-on | ✅ |
v-bind | partially working |
v-bind:style | ✅ |
v-bind:class | ✅ |
v-model | partially working |
v-pre | ✅ |
v-cloak | ✅ |
v-once | ✅ |
Other Functionalities
Functionality | Implemented |
---|---|
Slots | partially working |
Components | ✅ |
Filters |
Limitations
It's difficult to interpret JavaScript language features and translate them into twig.
For example, string concatenation within attribute binding is not currently working properly: 🚫
This example works:
<template> <div :style="'fontSize: ' + (size + 10) + 'px'"></div> </template> <script> export default { props: { size: { type: number, required: true, }, }, }; </script>
<div style="{{ 'fontSize: ' ~ (size + 10) ~ 'px' }};"></div>
But this example doesn't work correct:
<template> <div :style="'fontSize: ' + (foo.size + 10) + 'px'"></div> </template> <script> export default { props: { foo: { type: object, required: true, }, }, }; </script>
<div style="{{ 'fontSize: ' ~ (foo.size ~ 10) ~ 'px' }};"></div>