Comments (2)
Without args:
$blade->compiler()->compileString($string);
With args:
function renderFromString(string $string, array $params): string
{
$generated = $blade->compiler()->compileString($string);
ob_start() and extract($params, EXTR_SKIP);
try {
eval('?>' . $generated);
} catch (\Exception $e) {
ob_get_clean();
throw $e;
}
return ob_get_clean();
}
from blade.
If this package were updated to use illuminate/view: ^9.0
, this could be done in one line.
https://laravel.com/docs/9.x/blade#rendering-inline-blade-templates
from blade.
Related Issues (20)
- x-component tag example HOT 8
- Target class [filesystem] does not exist HOT 2
- How to know if is using template cache ?
- $blade->share($key, $value) does not work
- Semantic versioning please
- how to put coding in this blade file top?
- How to use blade components with this package? HOT 12
- How to send data layouts?
- CUSTOM Directive Does NOT Work WITH PHP HOT 3
- Deleted cache files by accident HOT 1
- Added support for illuminate/view ^9.0 HOT 2
- Disable Blade caching completly HOT 2
- Question about blade in blade usage HOT 1
- Resource 'cache' already exists and is not a CI_Cache instance. HOT 1
- Illuminate/view 9.0 support
- Illuminate/View 10 support HOT 2
- Please release the new version
- How to use blade-icons
- Not working with illuminate/view 11.8/11.9/11.10 HOT 6
- $attributes and @props doesn't work
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 blade.