Skip to content
New issue

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

How to return views upon Ajax requests, sir ? #71

Closed
vuminhluan opened this issue Apr 9, 2019 · 1 comment
Closed

How to return views upon Ajax requests, sir ? #71

vuminhluan opened this issue Apr 9, 2019 · 1 comment

Comments

@vuminhluan
Copy link

No description provided.

@jorgecc
Copy link
Member

jorgecc commented Apr 11, 2019

Do you care to elaborate?

For example

$.ajax('page.php', 
    {
        success: function (data, status, xhr) {
            $('p').html(data);
    }
});

<p></p>

page.php:

Use eftec\bladeone;

$views = __DIR__ . '/views'; // it uses the folder /views to read the templates
$cache = __DIR__ . '/cache'; // it uses the folder /cache to compile the result. 
$blade = new bladeone\BladeOne($views,$cache,BladeOne::MODE_AUTO);
echo $blade->run("hello",array("variable1"=>"value1")); // /views/hello.blade.php must exist

@jorgecc jorgecc closed this as completed Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants