REQUEST
Craft::$app->getRequest()
Craft::$app->getRequest()->getAcceptsJson()
$this->asJson();
CURRENT USER
Craft::$app->getUser()->getIdentity()
GET SESSION ERROR|NOTICE
Craft::$app->getSession()->setError(Craft::t('app', 'Couldn’t save entry.'))
Craft::$app->getSession()->setNotice(Craft::t('app', 'Entry saved.'))
SET ROUTE PARAMS
Craft::$app->getUrlManager()->setRouteParams([
'entry' => $entry
]);
USER SESSION
Craft::$app->getUser()
GET ELEMENTS
$event = VentiEvent::find()
->eid($variables['eid'])
->localeEndabled(null)
->one();
TIMEZONE
Craft::$app->getTimeZone()
PLUGINS
Craft::$app->getPlugins()->getPlugin()
DATE FORMATS
DateTimeHelper::toIso8601()
// \craftcms\src\i18n\locale
Craft::$app->locale->getDateFormat('short',Locale::FORMAT_PHP)
Craft::$app->locale->getTimeFormat('medium')
Craft::$app->locale->getDateTimeFormat('long')
SITES
Craft::$app->getSites()->getAllSiteIds()
Craft::$app->getSites()->currentSite->id
Craft::$app->getSites()->getAllSites()
Craft::$app->getSites()->getSiteById()
Craft::$app->getSites()->getSiteByHandle()
Craft::$app->getSites()->getEditableSiteIds()
Craft::$app->getSites()->getPrimarySite()->id