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

Document issues when using View::assign/start/end #49

Open
othercorey opened this issue Apr 22, 2020 · 7 comments
Open

Document issues when using View::assign/start/end #49

othercorey opened this issue Apr 22, 2020 · 7 comments
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@othercorey
Copy link
Member

Users will get a confusing php error about casting to string.

Provide a better explanation for some of the porting gotchas.

@othercorey othercorey added this to the 1.0.x milestone Apr 22, 2020
@othercorey othercorey added the documentation Improvements or additions to documentation label Apr 22, 2020
@markstory
Copy link
Member

Would you want this info in the readme, or should we start a docs site like some of the other plugins have?

@othercorey
Copy link
Member Author

It would help me decide if I knew what documentation requests people have.

I don't want to re-create View documentation -- more like link to View and explain TwigView changes.

I want it to be easy to use -- but if I have to write more than very simple explanations then a separate document is probably easier.

@markstory
Copy link
Member

Starting off with the README until it gets too long is a good place to start then 😄

@victoreassis
Copy link

How these methods can be used avoiding this warning?

For now I created a TwigView that overrides the assign method to return nothing. I don't know if this is the way to go, but it seems to work.

@othercorey
Copy link
Member Author

Use the do tag - https://twig.symfony.com/doc/3.x/tags/do.html

{% do _view.assign() %}

@victoreassis
Copy link

Thanks, it worked out great and makes a lot more sense. I should have read the docs more carefully.

The previous package didn't complain about it at all, so I though it was ok.

@othercorey
Copy link
Member Author

The assign() function returns $this and the previous TwigView had a hack to convert itself to an empty string. It didn't throw an error, but it wasn't supposed to work like that.

@othercorey othercorey modified the milestones: 1.0.x, 1.1.x Jul 16, 2020
@othercorey othercorey modified the milestones: 1.1.x, 1.2.x Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants