Search Results for

    Show / Hide Table of Contents
    View Source

    Class UmbracoPageController

    An abstract controller for a front-end Umbraco page

    Inheritance
    object
    ControllerBase
    Controller
    UmbracoController
    Namespace: Umbraco.Cms.Web.Common.Controllers
    Assembly: Umbraco.Web.Common.dll
    Syntax
    public abstract class UmbracoPageController : UmbracoController

    Constructors

    View Source

    UmbracoPageController(ILogger<UmbracoPageController>, ICompositeViewEngine)

    Initializes a new instance of the UmbracoPageController class.

    Declaration
    protected UmbracoPageController(ILogger<UmbracoPageController> logger, ICompositeViewEngine compositeViewEngine)
    Parameters
    Type Name Description
    ILogger<UmbracoPageController> logger
    ICompositeViewEngine compositeViewEngine

    Properties

    View Source

    CurrentPage

    Gets the current content item.

    Declaration
    protected virtual IPublishedContent? CurrentPage { get; }
    Property Value
    Type Description
    IPublishedContent
    View Source

    UmbracoRouteValues

    Gets the UmbracoRouteValues

    Declaration
    protected virtual UmbracoRouteValues UmbracoRouteValues { get; }
    Property Value
    Type Description
    UmbracoRouteValues

    Methods

    View Source

    CurrentTemplate<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
    IActionResult

    The action result.

    Type Parameters
    Name Description
    T

    The type of the model.

    Exceptions
    Type Condition
    InvalidOperationException

    If the template found in the route values doesn't physically exist and exception is thrown

    View Source

    EnsurePhsyicalViewExists(string?)

    Ensures that a physical view file exists on disk.

    Declaration
    [Obsolete("Please use the correctly spelt EnsurePhysicalViewExists method. Scheduled for removal in Umbraco 18.")]
    protected bool EnsurePhsyicalViewExists(string? template)
    Parameters
    Type Name Description
    string template

    The view name.

    Returns
    Type Description
    bool
    View Source

    EnsurePhysicalViewExists(string?)

    Ensures that a physical view file exists on disk.

    Declaration
    protected bool EnsurePhysicalViewExists(string? template)
    Parameters
    Type Name Description
    string template

    The view name.

    Returns
    Type Description
    bool
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX