Backend Utility
Collection of helpers for backend developing.
- createFrontendLink ( $pageUid, $params)
-
Creates a frontend link, also in backend context.
- param int $pageUid
-
The page uid.
- param array $params
-
Typolink parameters.
Example:
BackendUtility::createFrontendLink(123, ['lightbox' => 1]);
Copied!returns
/a-page?lightbox=1&cHash=ffe...
Copied!- Returns
-
Link url.
- currentPageUid ( )
-
Returns the current page uid (in backend and frontend context).
Example:
BackendUtility::currentPageUid();
Copied!returns
123
Copied!- Returns
-
Current page uid.
- getHostname ( )
-
Get the fully-qualified domain name of the host.
Example:
// current Domain is https://example.com/bla BackendUtility::getHostname();
Copied!returns
example.com
Copied!- Returns
-
The fully-qualified host name.
- getEditLink ( $table, $uid)
-
Get route link for editing records in backend.
- param string $table
-
The record table.
- param int $uid
-
The record uid.
Example:
BackendUtility::getEditLink('tt_content', 123);
Copied!returns
/typo3/index.php?route=%2Frecord%2Fedit&token=75...&returnUrl=%2Ftypo3%2Findex.php%3Froute%3D%252Fmodule%252Fweb%252Flayout%26token%3D74...%26id%3D270%23element-tt_content-123&edit%5Btt_content%5D%5B123%5D=edit
Copied!- Returns
-
The resulting link.
- getWrappedEditLink ( $table, $uid, $content)
-
Get route link for editing records in backend. Wrapped in a <a>-Tag
- param string $table
-
The record table.
- param int $uid
-
The record uid.
- param string $content
-
Inner HTML of the <a>-tag.
Example:
BackendUtility::getWrappedEditLink('tt_content', 123, 'Click to edit');
Copied!returns
<a href="/typo3/index.php?route=%2Frecord%2Fedit&token=...">Click to edit</a>
Copied!- Returns
-
The resulting <a>-tag.
- getWizardInformations ( $ctype)
-
Returns informations from the "New Content Wizard".
- param string $ctype
-
The CType.
Example:
BackendUtility::getWizardInformations('html');
Copied!returns
[ 'iconIdentifier' => 'content-special-html', 'title' => 'Plain HTML', 'description' => 'With this element you can insert raw HTML code on the page.' ]
Copied!- Returns
-
Informations about that wizard.
- getCurrentPageTS ( )
-
Returns the current page TSconfig as array.
Example:
BackendUtility::getCurrentPageTS();
Copied!returns
[ mod => array(/* 6 items */), TCEMAIN => array(/* 4 items */), TCEFORM => array(/* 3 items */), RTE => array(/* 1 item */), options => array(/* 1 item */), TCAdefaults => array(/* 2 items */), tt_content => array(/* 1 item */), ]
Copied!- Returns
-
Current page TSconfig.