PHP Class Contao\Frontend

Provide methods to manage front end controllers.
Inheritance: extends Controller
Mostrar archivo Open project: contao/core-bundle Class Usage Examples

Protected Properties

Property Type Description
$arrAux array Aux array
$arrMeta array Meta array
$arrProcessed array Processed files array

Public Methods

Method Description
__construct ( ) Load the database object
addToUrl ( string $strRequest, boolean $blnIgnoreParams = false, array $arrUnset = [] ) : string Overwrite the parent method as front end URLs are handled differently
getCronTimeout ( ) : integer Return the cron timeout in seconds
getMetaData ( string $strData, string $strLanguage ) : array Get the meta data from a serialized string
getPageIdFromUrl ( ) : mixed Split the current request into fragments, strip the URL suffix, recreate the $_GET array and return the page ID
getResponseFromCache ( ) : Response | null Check whether there is a cached version of the page and return a response object
getRootIdFromUrl ( ) : integer Return the root page ID
getRootPageFromUrl ( ) : PageModel Try to find a root page based on language and URL
indexPageIfApplicable ( Response $objResponse ) Index a page if applicable

Protected Methods

Method Description
getLoginStatus ( string $strCookie ) : boolean Check whether a back end or front end user is logged in
jumpToOrReload ( integer | array $intId, string $strParams = null, string $strForceLang = null ) Redirect to a jumpTo page or reload the current page
prepareMetaDescription ( string $strText ) : string Prepare a text to be used in the meta description tag

Method Details

__construct() public method

Make the constructor public, so pages can be instantiated (see #6182)
public __construct ( )

addToUrl() public static method

Overwrite the parent method as front end URLs are handled differently
public static addToUrl ( string $strRequest, boolean $blnIgnoreParams = false, array $arrUnset = [] ) : string
$strRequest string
$blnIgnoreParams boolean
$arrUnset array
return string

getCronTimeout() public static method

Return the cron timeout in seconds
public static getCronTimeout ( ) : integer
return integer

getLoginStatus() protected method

Check whether a back end or front end user is logged in
protected getLoginStatus ( string $strCookie ) : boolean
$strCookie string
return boolean

getMetaData() public static method

Get the meta data from a serialized string
public static getMetaData ( string $strData, string $strLanguage ) : array
$strData string
$strLanguage string
return array

getPageIdFromUrl() public static method

Split the current request into fragments, strip the URL suffix, recreate the $_GET array and return the page ID
public static getPageIdFromUrl ( ) : mixed
return mixed

getResponseFromCache() public static method

Check whether there is a cached version of the page and return a response object
Deprecation: Deprecated since Contao 4.3, to be removed in Contao 5.0. Use proper response caching headers instead.
public static getResponseFromCache ( ) : Response | null
return Symfony\Component\HttpFoundation\Response | null

getRootIdFromUrl() public static method

Return the root page ID
Deprecation: Deprecated since Contao 4.0, to be removed in Contao 5.0. Use Frontend::getRootPageFromUrl()->id instead.
public static getRootIdFromUrl ( ) : integer
return integer

getRootPageFromUrl() public static method

Try to find a root page based on language and URL
public static getRootPageFromUrl ( ) : PageModel
return PageModel

indexPageIfApplicable() public static method

Index a page if applicable
public static indexPageIfApplicable ( Response $objResponse )
$objResponse Symfony\Component\HttpFoundation\Response

jumpToOrReload() protected method

Redirect to a jumpTo page or reload the current page
protected jumpToOrReload ( integer | array $intId, string $strParams = null, string $strForceLang = null )
$intId integer | array
$strParams string
$strForceLang string

prepareMetaDescription() protected method

Prepare a text to be used in the meta description tag
protected prepareMetaDescription ( string $strText ) : string
$strText string
return string

Property Details

$arrAux protected_oe property

Aux array
protected array $arrAux
return array

$arrMeta protected_oe property

Meta array
protected array $arrMeta
return array

$arrProcessed protected_oe property

Processed files array
protected array $arrProcessed
return array