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 module #265

Open
andrew-m-p opened this issue Nov 14, 2024 · 3 comments
Open

blade module #265

andrew-m-p opened this issue Nov 14, 2024 · 3 comments

Comments

@andrew-m-p
Copy link

Hello. This is not a bug I need info on using blade module.

I want to create components , where am I expected to put this in the app ?

app()->blade()->directive('datetime', function ($expression) {
return "format('F d, Y g:i a'); ?>";
});

Can I create a component like this instead ? with alert.blade.php

Thanks in advance

@andrew-m-p
Copy link
Author

Cannot get the example to work:

app()->blade()->directive('datetime', function ($expression) {
return "format('F d, Y g:i a'); ?>";
});

Which allows you to use the following in your blade template:

Current date: @datetime(date())

It says ""Call to a member function directive() on null""

@andrew-m-p
Copy link
Author

It is a bug I get "Call to a member function directive() on null""
The reason is that configure in\leaf\blade is not being called first to set $this->blade

@andrew-m-p
Copy link
Author

Need to hack with a call to configure first before directive()

Leaf\Config::get("views.blade")->configure(AppConfig('views.path'), AppConfig('views.cachePath'));

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

1 participant