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.
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 ?
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community