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

Why we should echo instead of return? #28

Open
mahshad opened this issue May 28, 2019 · 1 comment
Open

Why we should echo instead of return? #28

mahshad opened this issue May 28, 2019 · 1 comment

Comments

@mahshad
Copy link

mahshad commented May 28, 2019

Hi,

Could you please describe why we should do
echo $blade->make('homepage', ['name' => 'John Doe']);
instead of doing
return $blade->make('homepage', ['name' => 'John Doe']);?

Thanks

@jjrohrer
Copy link

@mahshad I think it would completely depend upon the context. If you are ready to output to the page, then echo it. If you are being called from within some function that expects HTML, then return what it wants. You'll just have to look deeper into whatever framework you are using.

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