uawdijnntqw1x1x1
IP : 216.73.216.107
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
.
/
apps
/
craft4-newsite-space
/
vendor
/
ether
/
seo
/
src
/
.
/
controllers
/
SeoController.php
/
/
<?php namespace ether\seo\controllers; use craft\helpers\DateTimeHelper; use craft\web\Controller; use ether\seo\Seo; class SeoController extends Controller { protected array|int|bool $allowAnonymous = ['robots']; public function actionIndex () { $this->renderTemplate('seo/index'); } public function actionRobots () { $settings = Seo::$i->getSettings(); \Craft::$app->response->headers->set( 'Content-Type', 'text/plain; charset=UTF-8' ); $template = $settings->robotsTxt; unset($settings->robotsTxt); return $this->asRaw(\Craft::$app->view->renderString($template, [ 'seo' => $settings, ])); } /** * @throws \yii\web\BadRequestHttpException * @throws \yii\base\InvalidConfigException * @throws \Exception */ public function actionRenderData () { $this->requirePostRequest(); $craft = \Craft::$app; $elementType = $craft->request->getBodyParam('elementType'); $elementId = $craft->request->getBodyParam('elementId', null); $siteId = $craft->request->getBodyParam('siteId'); $seoHandle = $craft->request->getBodyParam('seoHandle'); // Get the element if ($elementId) { $element = $craft->elements->getElementById( $elementId, $elementType, $siteId ); if (!$element) return $this->asJson([]); } else { $element = new $elementType(); } // Populate the data $body = $craft->request->getBodyParams(); foreach ($body as $prop => $value) { if (!property_exists($element, $prop)) continue; if (in_array($prop, ['postDate', 'expiryDate'])) { $dateTime = DateTimeHelper::toDateTime($value); if ($dateTime !== false) { $element->$prop = DateTimeHelper::toDateTime($value); } } else { $element->$prop = $value; } } $element->setFieldValuesFromRequest( $craft->request->getParam('fieldsLocation', 'fields') ); return $this->asJson($element->$seoHandle->titleAsTokens); } }
/srv/users/craft4/./apps/craft4-newsite-space/vendor/ether/seo/src/./controllers/SeoController.php