Class UmbracoPageController
An abstract controller for a front-end Umbraco page
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Microsoft.AspNetCore.Mvc.Controller
Namespace: Umbraco.Cms.Web.Common.Controllers
Assembly: Umbraco.Web.Common.dll
Syntax
public abstract class UmbracoPageController : UmbracoController, IActionFilter, IAsyncActionFilter, IFilterMetadata, IDisposable
Constructors
View SourceUmbracoPageController(ILogger<UmbracoPageController>, ICompositeViewEngine)
Initializes a new instance of the UmbracoPageController class.
Declaration
protected UmbracoPageController(ILogger<UmbracoPageController> logger, ICompositeViewEngine compositeViewEngine)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Logging.ILogger<UmbracoPageController> | logger | |
Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine | compositeViewEngine |
Properties
View SourceCurrentPage
Gets the current content item.
Declaration
protected virtual IPublishedContent? CurrentPage { get; }
Property Value
Type | Description |
---|---|
System.Nullable<IPublishedContent> |
UmbracoRouteValues
Gets the UmbracoRouteValues
Declaration
protected virtual UmbracoRouteValues UmbracoRouteValues { get; }
Property Value
Type | Description |
---|---|
UmbracoRouteValues |
Methods
View SourceCurrentTemplate<T>(T)
Gets an action result based on the template name found in the route values and a model.
Declaration
protected virtual IActionResult CurrentTemplate<T>(T model)
Parameters
Type | Name | Description |
---|---|---|
T | model | The model. |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Mvc.IActionResult | The action result. |
Type Parameters
Name | Description |
---|---|
T | The type of the model. |
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 |