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
I have tried to create a helper function to render dynamic partials in my code. I've added these in the config/handlebars.php file:
config/handlebars.php
'flags' => LightnCandy::FLAG_HANDLEBARSJS | LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_RUNTIMEPARTIAL, 'partials' => [], 'partialresolver' => function ($cx, $name) { if (file_exists(resource_path("views/partials/$name.hbs"))) { return file_get_contents(resource_path("views/partials/$name.hbs")); } return ''; }, 'helpers' => [ 'concat' => function ($path) { return $path; }, ], 'helperresolver' => function ($cx, $name) { if ($name === 'concat') { return (function () { return ''; }); } return ''; },
I've added these in the resources/views/home.hbs file:
resources/views/home.hbs
<main id="main"> {{#each data }} {{> (concat this.name) this}} {{/each}} </main>
I've made this helper function work, but the partial resolver is not working after the helper function is called.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have tried to create a helper function to render dynamic partials in my code.
I've added these in the
config/handlebars.php
file:I've added these in the
resources/views/home.hbs
file:I've made this helper function work, but the partial resolver is not working after the helper function is called.
The text was updated successfully, but these errors were encountered: