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

Blade for snippets and blocks #9

Closed
iskrisis opened this issue Jun 6, 2022 · 3 comments
Closed

Blade for snippets and blocks #9

iskrisis opened this issue Jun 6, 2022 · 3 comments

Comments

@iskrisis
Copy link

iskrisis commented Jun 6, 2022

Hi, is there way to use blade in snippets and for blocks?
If not is there some way to use components in non blade templates? Maybe some global function that would render them?

@lukasleitsch
Copy link
Owner

is there way to use blade in snippets

An alternative or replacement for snippets are subviews or components.

and for blocks?

Currently, not supported.

If not is there some way to use components in non blade templates?

You could use the render method to render a component inside a php template.

<?= \Illuminate\Support\Facades\Blade::render('<x-alert />') ?>

Or you could use the component() helper: https://github.com/lukasleitsch/kirby-blade/blob/main/helpers.php#L15

@iskrisis
Copy link
Author

iskrisis commented Jun 7, 2022

@lukasleitsch very helpful thank you so much!

@iskrisis iskrisis closed this as completed Jun 7, 2022
@lukasleitsch
Copy link
Owner

@iskrisis You're welcome

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