duncan3dc / blade Goto Github PK
View Code? Open in Web Editor NEWUse Blade templates without the full Laravel framework
License: Apache License 2.0
Use Blade templates without the full Laravel framework
License: Apache License 2.0
haloo.
how to use this blade without cache?
Would be cool to see support for Laravel 7 and it's new x-
component syntax.
https://www.twilio.com/blog/dont-repeat-yourself-html-laravel-7-blade-components-php
https://laravel.com/docs/7.x/blade#components
is there any plan to support version 9?
Hello,
Im learning PHP and im following a course via a website. The instructor uses this package for templating. And we learned about using routes controllers etc.
Now we switched from Twig -> Blade. And im having a problem.
This is my BaseController.php
namespace Nrs\controllers;
use duncan3dc\Laravel\BladeInstance;
class BaseController
{
protected $Blade;
public function __construct()
{
$this->Blade = new BladeInstance("/views/", "/cache/views/");
}
}
And this is my PageController:
namespace Nrs\controllers;
use duncan3dc\Laravel\BladeInstance;
class PageController extends BaseController
{
public function getShowHomePage()
{
echo $this->Blade->render("home");
}
}
Im getting the error in my Title of this issue.
Getting stuck for ever now. Hope i allowed here to post it.
Sorry for my English
Tino
Hello,
Thanks for this amazing thing so that I can use it outside of Laravel.
In development, when I change the blade file and reload the browser, the changes don't immediately show up until I delete all cache files.
How can I do the immediate change for this?
Thanks!
The latest version of illuminate\view seems to have broken this library.
An error is thrown stating createMatcher
is undefined in https://github.com/duncan3dc/blade/blob/master/src/Blade.php#L63
I believe the change can be seen here illuminate/view@742f7db...de5a719
Hi guys,
I'm can find document this package.
I'm found some method: ->share() , ->with(), ->make() ...
I'm want find full method have into blade this and tutorial .
Thanks !
Works well on localhost but when it came to hosting, above error message pops up
Hi, I want to add file extension like these;
$instance = new BladeInstance($views, $cache);
$instance->getViewFactory()->addExtension('blade', 'blade');
$instance->getViewFactory()->addExtension('html', 'php');
But, that method is protected, and i cant reach it outside of the class.
Could you set it to public or add new public method to reach it?
Thanks.
Calling a non-existent variable seems not throw any ErrorException.
{{ $non_existent }}
It just silently running without a thing. Interesting enough, that every non-existent variable got default value of null
.
@if ($non_existent == null)
<div>It does exist, but null</div>
@endif
Should it be throw an ErrorException? or is it excpected behaviour?
I use your package and I use it like that:
blade = new BladeInstance("src/Views"); } ``` } and query('SELECT * FROM forgecms_pages WHERE slug=?', [$slug])->fetch(); $this->blade->render('Pages.show'); } ``` } and I don't have InvalidArgumentException but nothing display Can you help me ?I'm getting the follow error on my webhost, on my localhost everything is okay:
syntax error, unexpected '.'
And this is triggered in line 63:
public static function __callStatic($name, array $arguments)
{
return static::getInstance()->$name(...$arguments);
}
Any ideas what could be wrong?
Thanks
I want to try Blade in Symfony instead of Twig. For this I try install your Blade implementation, but I have a problem during installation:
Problem 1
- Conclusion: remove symfony/symfony v3.1.2
- Conclusion: don't install symfony/symfony v3.1.2
- duncan3dc/blade 2.2.0 requires illuminate/view ~5.1.0 -> satisfiable by illuminate/view[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1
.8].
- duncan3dc/blade 2.2.1 requires illuminate/view ~5.1.0 -> satisfiable by illuminate/view[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1
.8].
- illuminate/view v5.1.1 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.13 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.16 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.2 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.20 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.22 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.25 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.28 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.30 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.31 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.6 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/view v5.1.8 requires illuminate/filesystem 5.1.* -> satisfiable by illuminate/filesystem[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41,
v5.1.6, v5.1.8].
- illuminate/filesystem v5.1.1 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v2
.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.13 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.16 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.2 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v2
.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.20 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.22 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.25 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.28 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.30 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.31 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.41 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v
2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.6 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v2
.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/filesystem v5.1.8 requires symfony/finder 2.7.* -> satisfiable by symfony/finder[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v2
.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9].
- illuminate/view v5.1.41 requires symfony/debug 2.7.* -> satisfiable by symfony/debug[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.2, v2.7.3, v2.7.4, v2.7.5, v
2.7.6, v2.7.7, v2.7.8, v2.7.9].
- don't install symfony/finder v2.7.0|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.1|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.10|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.11|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.12|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.13|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.14|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.15|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.16|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.2|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.3|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.4|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.5|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.6|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.7|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.8|don't install symfony/symfony v3.1.2
- don't install symfony/finder v2.7.9|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.0|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.1|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.10|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.11|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.12|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.13|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.14|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.15|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.16|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.2|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.3|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.4|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.5|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.6|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.7|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.8|don't install symfony/symfony v3.1.2
- don't install symfony/debug v2.7.9|don't install symfony/symfony v3.1.2
- Installation request for symfony/symfony (locked at v3.1.2, required as 3.1.*) -> satisfiable by symfony/symfony[v3.1.2].
- Installation request for duncan3dc/blade ^2.2 -> satisfiable by duncan3dc/blade[2.2.0, 2.2.1].
This is my composer.json
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The "Symfony Standard Edition" distribution",
"autoload": {
"psr-4": { "": "src/" },
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
"psr-4": { "Tests": "tests/" }
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.1.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"symfony/polyfill-apcu": "^1.0",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"post-install-cmd": [
"Incenteev\ParameterHandler\ScriptHandler::buildParameters",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
],
"post-update-cmd": [
"Incenteev\ParameterHandler\ScriptHandler::buildParameters",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"platform": {
"php": "5.5.9"
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.1-dev"
}
}
}
In
May be you know how I can solve this problem?
Thanks!
I can't use the $this instance using the blade template engine.
Example:
{{ $this->config->item() }}
{{ $this->session->flashdata() }}
Type: ErrorException
Message: Call to a member function flashdata() on null
Hi,
imagine the following folders structure
└── app/
├── layouts/
│ ├── master.blade.php
│ └── login.blade.php
└── packages/
├── users/
│ ├── list.blade.php
│ └── add.blade.php
└── products/
├── list.blade.php
└── add.blade.php
I've added booth app/layouts/
and app/packages/
to the Blade instance. When I render products.list
without extending it works fine, as well as if I render master
or login
.
But when I try to @extends('master')
in list.blade.php
it doesn't work because it will look only in that folder that it is already in. For example in users folder only.
How can you achieve this?
Cheers.
It would be great if we could use view composers, just like with Blade when using Laravel.
View::composer('sidebar', function($view) {
$view->with('links', ['hello','world!']);
});
I've been digging in the Laravel (Illuminate) codebase, but I couldn't find myself what I was looking for.
Hello! I am using PHPStorm IDE and installed your library. Now it shows error on the blade page, the doctype is underlined by red:
@use(App\Models\Menu)
<!DOCTYPE html>
...
Also, when i write smth like:
{{ Menu::buildMenu($menu) }}
in the code below, there is no smart help of IDE as if i write the full path:
{{ \App\Models\Menu::buildMenu($menu) }}
in the 2nd before method is called - ide shows a list of possible methods.
Can this problems be somehow fixed?
Thanks.
First of all, thank you for this wonderful and up-to-date package; it's a gem.
I realize that there is not much to the package itself to warrant talking to the .env
file, but it would be wonderful if the asset shortcut you have provided could take variables (while keeping your prepended defaults for css/js)
I hope this is a reasonable suggestion because this package serves those us who do not want the full-Laravel treatment. I would like to be able to keep my boilerplate folder structure while making your blade repo my default viewer. Since you have made such a nice addition to blade, I thought to ask.
Thanks a bunch for your work. It is much appreciated.
I wanted to display the categories[ ](https://i.stack.imgur.com/hOrjb.png
And then click on create This page appearsenter image description here
I have tried to solve the problem but could not please help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.