-
-
Notifications
You must be signed in to change notification settings - Fork 13
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 access functions through pug variable? #28
Comments
I actually got it working with |
Since you're still in PHP technically, I would expect to work with the php operator, like you discovered. But this is gonnna be the purview of https://github.com/pug-php/pug, we are a wrapper for that package. |
@weotch Makes sense. Thanks for your help! |
Hi @pjhartin We did some quick translate from JS syntax to PHP syntax. It's done by this engine: https://github.com/pug-php/js-phpize In theory, your code with the dot should work. I tested with the following: Each with the dot syntax seems to work in this example. Can you try to update to the last versions with |
I am porting over existing blade templates to pug.
One of the patterns that is used extensively in the default authentication views bundled with the framework is the use of MessageBags, and a global $errors variable that can be accessed in any view.
I wanted to know how this could be converted into a pug template.
As you can see, it accesses the errors objects, runs the any() method which returns an array of error messages as strings and then loops over the messages and outputs them to a list.
I have tried the following:
However, it seems I cannot access the
all
method in this way. Am I doing this incorrectly?The text was updated successfully, but these errors were encountered: