Comments (7)
There's some big issues with the compile command.
I've hit the same issues; it's something I'm looking at fixing with the
next release.
On Friday, 7 June 2013, Ivรกn N. Paz wrote:
When trying to precompile the twig templates:
$ php artisan twig:compile
The process breaks with:
[InvalidArgumentException]
View [home/main.html] not found.Extra info:
- The twig views follow the"$viewname.html.twig" convention
- The config.php for the TwigBridge specifies the extension as: 'extension'
=> 'html.twig'- The views load perfectly fine on site, this issue only happens with
the compile command.โ
Reply to this email directly or view it on GitHubhttps://github.com//issues/41
.
from twigbridge.
So started looking at this again. I just can't see how we can make this command actually work.
The current implementation of the compile just can't work. It uses Laravel to load the view without any data
which means functions, etc are likely to just fall over.
It's likely that this command is going to be dropped unless someone has a fix for this?
from twigbridge.
I believe it can be done without having to launch the view rendering via Laravel (not 100% sure though). According to http://twig.sensiolabs.org/doc/internals.html you can tokenize the views as such, which in the end will call the actual methods/varianles you inject into them. I believe this is as far as you can go on compiling the views... Anything else above this I believe it would onto Varnish or smth like that. Again, not 100% sure about this, I`ll get a closer look coming weeks.
from twigbridge.
Hopefully this works out. It essentially does what you said, but after looking at it I realised I was being stupid, there really was no need to call render.
I've committed this to master and will tag later if no issues arise.
from twigbridge.
Scrap that, not working quite right. Correct way to go about it but the implementation is slightly off.
It's generating the compiled template, however the name/file is different to that generated when called through the web. Effectively meaning currently the compile is useless.
I don't really have the time at the moment to look at this issue, maybe someone else can take this on?
from twigbridge.
Just pushed a revised twig:compile
command to 0.6. Let me know of any issues.
from twigbridge.
Looks like Laravels optimize
command supports the ability to pre-compile views. Currently TwigBridge doesn't support this.
Once this is implemented the separate twig:compile
is likely to disappear.
from twigbridge.
Related Issues (20)
- Enabled Laravel 8 HOT 2
- Include markdown files
- Migrate to Github actions
- store templates in database HOT 1
- [Question] Laravel8 + TwigBridge + GraphQL Twig extension -- example or available package?
- trans node is missing?
- Full example for adding an existing Twig Extension to Laravel8 +TwigBridge?
- How to use twigphp/cache-extra? HOT 2
- Not working in Lumen HOT 1
- View::composer not working v.0.14.0 HOT 3
- Deprecated Messages [php 8.2+]
- Bridge Version says it's v0.10.0 on v0.14.1
- os
- How would I go about adding an extension that needs configuration? HOT 1
- Relative include paths don't work when using namespaces HOT 4
- Laravel Collective HTML package is abandoned HOT 5
- Twig cache file has path instead of name in laravel view cache for getTemplateName() HOT 3
- TwigBridge 0.14.* not compatible with Twig 3.9.0 HOT 5
- $path being null causes deprecation warnings in logs when using Telescope
- Vite in Twig (rcrowe/TwigBridge) for Laravel 11 [SOLUTION]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twigbridge.