Class RenderMvcController
Represents the default front-end rendering controller.
Namespace: Umbraco.Web.Mvc
Assembly: Umbraco.Web.dll
Syntax
public class RenderMvcController : UmbracoController, IRenderMvcController, IRenderController, IDiscoverable
Constructors
View SourceRenderMvcController()
Declaration
public RenderMvcController()
RenderMvcController(IGlobalSettings, IUmbracoContextAccessor, ServiceContext, AppCaches, IProfilingLogger, UmbracoHelper)
Declaration
public RenderMvcController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ServiceContext services, AppCaches appCaches, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper)
Parameters
Type | Name | Description |
---|---|---|
IGlobalSettings | globalSettings | |
IUmbracoContextAccessor | umbracoContextAccessor | |
ServiceContext | services | |
AppCaches | appCaches | |
IProfilingLogger | profilingLogger | |
UmbracoHelper | umbracoHelper |
Properties
View SourceCurrentPage
Gets the current content item.
Declaration
protected IPublishedContent CurrentPage { get; }
Property Value
Type | Description |
---|---|
IPublishedContent |
PublishedRequest
Gets the current published content request.
Declaration
protected virtual PublishedRequest PublishedRequest { get; }
Property Value
Type | Description |
---|---|
PublishedRequest |
UmbracoContext
Gets the Umbraco context.
Declaration
public override UmbracoContext UmbracoContext { get; }
Property Value
Type | Description |
---|---|
UmbracoContext |
Methods
View SourceCurrentTemplate<T>(T)
Gets an action result based on the template name found in the route values and a model.
Declaration
protected ActionResult CurrentTemplate<T>(T model)
Parameters
Type | Name | Description |
---|---|---|
T | model | The model. |
Returns
Type | Description |
---|---|
ActionResult | The action result. |
Type Parameters
Name | Description |
---|---|
T | The type of the model. |
Remarks
If the template found in the route values doesn't physically exist, then an empty ContentResult will be returned.
EnsurePhsyicalViewExists(String)
Ensures that a physical view file exists on disk.
Declaration
protected bool EnsurePhsyicalViewExists(string template)
Parameters
Type | Name | Description |
---|---|---|
System.String | template | The view name. |
Returns
Type | Description |
---|---|
System.Boolean |
Index(ContentModel)
The default action to render the front-end view.
Declaration
public virtual ActionResult Index(ContentModel model)
Parameters
Type | Name | Description |
---|---|---|
ContentModel | model |
Returns
Type | Description |
---|---|
ActionResult |