We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can i use this in wordpress? If yes, can you give me some examples how integrate to wordpress?
The text was updated successfully, but these errors were encountered:
Yes, we can. On my testing the easiest way was:
<?php require_once __dir__ . "/vendor/autoload.php"; use Jenssegers\Blade\Blade; function render(string $view, array $args = []) { $blade = new Blade(__dir__ . '/src/views', __dir__ . '/cache'); echo $blade->make($view, $args); }
Then the default wordpress routes acts as controllers, so in home.php, for example:
<?php $posts = get_posts(); render('home', array( 'posts' => $posts ));
So the last step is to create a ./src/views/home.blade.php
<!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="UTF-8"> {{-- {{ wp_head() }} --}} <title>{{ get_bloginfo('name') }} | {{ get_bloginfo('description') }}</title> </head> <body> </body> </html>
This is a WIP, any improvement ideas are welcome.
Sorry, something went wrong.
No branches or pull requests
Can i use this in wordpress? If yes, can you give me some examples how integrate to wordpress?
The text was updated successfully, but these errors were encountered: