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

Chaining function result ends in error #139

Closed
paganotoni opened this issue Apr 23, 2021 · 10 comments
Closed

Chaining function result ends in error #139

paganotoni opened this issue Apr 23, 2021 · 10 comments
Milestone

Comments

@paganotoni
Copy link
Member

Similar to the arrays issue when trying to call a member of the result of a function call plush errors.

Code:

...
<p class="mr-2">
    Employees will be reminded on 
    <date class="font-semibold">
        <%= period.EmployeeReviewReminderDate().Format("Jan 2, 2006") %>
    </date>.
</p>
...

Error:

no prefix parse function for DOT found

It would be good to support this.

cc @Mido-sys

@Mido-sys
Copy link
Contributor

@paganotoni sounds good. Thanks for creating the issue. I will probably get it done sometime next week.

@paganotoni
Copy link
Member Author

Awesome. No rush on this. Appreciate all the great work you're putting into plush.

@Mido-sys
Copy link
Contributor

Mido-sys commented Jun 7, 2021

@paganotoni, Sorry, I've been swamped lately. However, I will try to get it done before the end of the month.

@paganotoni
Copy link
Member Author

paganotoni commented Jun 7, 2021

Hey! don't worry about that. I appreciate your effort with all these issues and understand you take your time. Thanks for all your dedication.

@temuera
Copy link

temuera commented Jan 4, 2022

Can this feature be used?

today I try to use the buffalo engine in new project and I have many years of experience in using the gin engine with golang native html.template

buffalo looks great. everything is going well.

but this will increase a lot code of template , if there is no support cascading object call function.

every range level need define a new temp variable ,then call the it's function.

This makes plush meaningless.

@paganotoni
Copy link
Member Author

@temuera agree. It would be awesome to have this one solved cc @Mido-sys .

@paganotoni
Copy link
Member Author

@temuera At the moment I use variables as a workaround.

<p class="mr-2">
    Employees will be reminded on 
    <date class="font-semibold">
        <% let date = period.EmployeeReviewReminderDate() %>
        <%= date.Format("Jan 2, 2006") %>
    </date>.
</p>
...

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 27, 2022
@sio4 sio4 added this to the Backlog milestone Sep 27, 2022
@sio4 sio4 removed the stale label Sep 27, 2022
@Mido-sys
Copy link
Contributor

Mido-sys commented Apr 25, 2024

@paganotoni

Hello Antonio, It's been a long time. I know I promised to get this done in 2021, so I apologize for going dark on this for 3 years now. I sent a PR #181 and added different test cases. Please let me know if you think a test case is missing.

I also fixed a bug in which plush didn't return an error when an undefined function was called on an object.

@paganotoni
Copy link
Member Author

Hey @Mido-sys! Thanks a lot!

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

4 participants