dimanche 26 mars 2017

ASP.NET MVC to PHP Laravel Migration: Html.RenderAction Alternative

I'm currently developing a CMS using PHP Laravel (5.4) based on an existing ASP.NET MVC version i've made in the past. Since most of the ASP.NET version is written in JS, i'm trying to reuse the most i can in the newer Laravel version i'm developing. I have already "translated" most of the C# code to PHP, thanks to Laravel's similarities with ASP.NET MVC architecture, this was somewhat strait forward.

Currently i'm facing a issue which is trying to call a controller action from within a view that will in turn render a partial view. In the ASP.NET MVC version i've accomplished this using a Html.RenderAction helper.

ASP.NET MVC Example:

<div>
    @{Html.RenderAction("Controller", "Action");}
</div>

Since i'm a newbie in Laravel (and PHP), i would like to know if there is any alternative to the Html.RenderAction helper that i can use to accomplish this task.

I've search the interwebs and Laravel's documentation, and from what i was able to find, View Composers seem to be closest alternative. Unfortunately, i didn't find any example that could resolve my issue.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2nkDD9S
via IFTTT

Aucun commentaire:

Enregistrer un commentaire