Assuming this is DD4T 2, rendering partial views for Component Presentations, and that you have all the dependency injection etc setup, your most basic version of this method should be:
public class ComponentController : ModelControllerBase
{
public ComponentController(IPageFactory pageFactory, IComponentPresentationFactory componentPresentationFactory,
ILogger logger, IDD4TConfiguration dd4tConfiguration,
IViewModelFactory viewModelFactory)
: base(pageFactory, componentPresentationFactory, logger, dd4tConfiguration, viewModelFactory)
{
}
public override ActionResult ComponentModel()
{
return base.ComponentModel();
}
}
With the following in your page layout
@foreach (var item in Model.Items)
{
@Html.Render(item)
}