Support the ongoing development of Laravel.io →
Views Architecture
Last updated 1 year ago.
0

You could, but that will break the MVC pattern. I'm sure you can find a better way of doing what you want. What exactly do you want in your view ? A view should be the "dumbest" part of your application, so try not to involve any logic in it.

Last updated 1 year ago.
0

Thanks for the reply. Sorry for my long time to reply (forum doen't send email when answer is posted :( )

It's about formating content., I want my views to be the simplest possible. So it can be in controller.

How can I use controller methods in view ?

Last updated 1 year ago.
0

Just create a variable in the controller that would passed the content into the view. You shouldn't do that kind of approach. As ChrisRM said, It would break the MVC pattern

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

SebSept sebsept Joined 20 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.