/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/src
/app
/controllers
/ServiceSubPageController.php
$serviceEntry->uri = $oldEntry->uri;
}
if ($serviceEntry->getType()->handle === 'residentServicePageMirror') {
$oldEntry = $serviceEntry;
$serviceEntry = $serviceEntry->mirrorsResidentServicePage->one();
$serviceEntry->uri = $oldEntry->uri;
}
$serviceModel = $this->serviceModelFromEntry->get($serviceEntry);
/** @var SuperTableBlockQuery $subPageQuery */
$subPageQuery = $serviceEntry->subPageBuilder;
$subPageQuery->pageSlug = $subPageSlug;
$subPage = $subPageQuery->one();
if (! $subPage) {
throw new HttpException(404);
}
$subPageModel = $this->subPageModelFromElement->get($subPage);
$parentEntryQuery = $this->entryQueryFactory->make();
$parentEntryQuery->section = $this::$pageControlEntrySection;
$parentEntry = $parentEntryQuery->one();
$parentBreadCrumbTitle = $this::$breadCrumbTitleFallback;
/** @var SuperTableBlockQuery $headerQuery */
$headerQuery = $parentEntry->header;
$header = $headerQuery->one();
if ($header) {
$parentBreadCrumbTitle = $header->headline;
}
return $this->renderTemplateService->renderTemplate(
Arguments
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/src
/app
/actioncontrollers
/DepartmentsSubPageController.php
namespace src\app\actioncontrollers;
use Exception;
use src\app\Di;
use yii\web\Response;
use src\app\controllers\DepartmentsSubPageController as ControllerReal;
class DepartmentsSubPageController extends AbstractBaseController
{
/**
* @throws Exception
*/
public function actionRender(
string $serviceSlug,
string $subPageSlug
): Response {
/** @var ControllerReal $controllerReal */
$controllerReal = Di::get(ControllerReal::class);
return $controllerReal->render($serviceSlug, $subPageSlug);
}
}
Arguments
"sheriffs-office"
"sheriff-department-divisions"
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/yiisoft
/yii2
/base
/InlineAction.php
{
$this->actionMethod = $actionMethod;
parent::__construct($id, $controller, $config);
}
/**
* Runs this action with the specified parameters.
* This method is mainly invoked by the controller.
* @param array $params action parameters
* @return mixed the result of the action
*/
public function runWithParams($params)
{
$args = $this->controller->bindActionParams($this, $params);
Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__);
if (Yii::$app->requestedParams === null) {
Yii::$app->requestedParams = $args;
}
return call_user_func_array([$this->controller, $this->actionMethod], $args);
}
}
Arguments
"sheriffs-office"
"sheriff-department-divisions"
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/yiisoft
/yii2
/base
/InlineAction.php
{
$this->actionMethod = $actionMethod;
parent::__construct($id, $controller, $config);
}
/**
* Runs this action with the specified parameters.
* This method is mainly invoked by the controller.
* @param array $params action parameters
* @return mixed the result of the action
*/
public function runWithParams($params)
{
$args = $this->controller->bindActionParams($this, $params);
Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__);
if (Yii::$app->requestedParams === null) {
Yii::$app->requestedParams = $args;
}
return call_user_func_array([$this->controller, $this->actionMethod], $args);
}
}
Arguments
array:2 [
0 => DepartmentsSubPageController {}
1 => "actionRender"
]
array:2 [
0 => "sheriffs-office"
1 => "sheriff-department-divisions"
]
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/yiisoft
/yii2
/base
/Controller.php
$this->action = $action;
$modules = [];
$runAction = true;
// call beforeAction on modules
foreach ($this->getModules() as $module) {
if ($module->beforeAction($action)) {
array_unshift($modules, $module);
} else {
$runAction = false;
break;
}
}
$result = null;
if ($runAction && $this->beforeAction($action)) {
// run the action
$result = $action->runWithParams($params);
$result = $this->afterAction($action, $result);
// call afterAction on modules
foreach ($modules as $module) {
/* @var $module Module */
$result = $module->afterAction($action, $result);
}
}
if ($oldAction !== null) {
$this->action = $oldAction;
}
return $result;
}
/**
* Runs a request specified in terms of a route.
* The route can be either an ID of an action within this controller or a complete route consisting
Arguments
array:2 [
"serviceSlug" => "sheriffs-office"
"subPageSlug" => "sheriff-department-divisions"
]
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/craftcms
/cms
/src
/web
/Controller.php
}
// Enforce $allowAnonymous
if (
(is_array($this->allowAnonymous) && (!preg_grep("/{$action->id}/i", $this->allowAnonymous))) ||
$this->allowAnonymous === false
) {
$this->requireLogin();
}
return true;
}
/**
* @inheritdoc
*/
public function runAction($id, $params = [])
{
try {
return parent::runAction($id, $params);
} catch (\Throwable $e) {
if (Craft::$app->getRequest()->getAcceptsJson()) {
Craft::$app->getErrorHandler()->logException($e);
if (!YII_DEBUG && !$e instanceof UserException) {
$message = Craft::t('app', 'An unknown error occurred.');
} else {
$message = $e->getMessage();
}
if ($e instanceof ClientException) {
$statusCode = $e->getCode();
if (($response = $e->getResponse()) !== null) {
$body = Json::decodeIfJson((string)$response->getBody());
if (isset($body['message'])) {
$message = $body['message'];
}
}
} else if ($e instanceof HttpException) {
$statusCode = $e->statusCode;
} else {
$statusCode = 500;
Arguments
"render"
array:2 [
"serviceSlug" => "sheriffs-office"
"subPageSlug" => "sheriff-department-divisions"
]
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/yiisoft
/yii2
/base
/Module.php
/**
* Runs a controller action specified by a route.
* This method parses the specified route and creates the corresponding child module(s), controller and action
* instances. It then calls [[Controller::runAction()]] to run the action with the given parameters.
* If the route is empty, the method will use [[defaultRoute]].
* @param string $route the route that specifies the action.
* @param array $params the parameters to be passed to the action
* @return mixed the result of the action.
* @throws InvalidRouteException if the requested route cannot be resolved into an action successfully.
*/
public function runAction($route, $params = [])
{
$parts = $this->createController($route);
if (is_array($parts)) {
/* @var $controller Controller */
list($controller, $actionID) = $parts;
$oldController = Yii::$app->controller;
Yii::$app->controller = $controller;
$result = $controller->runAction($actionID, $params);
if ($oldController !== null) {
Yii::$app->controller = $oldController;
}
return $result;
}
$id = $this->getUniqueId();
throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
}
/**
* Creates a controller instance based on the given route.
*
* The route should be relative to this module. The method implements the following algorithm
* to resolve the given route:
*
* 1. If the route is empty, use [[defaultRoute]];
* 2. If the first segment of the route is a valid module ID as declared in [[modules]],
* call the module's `createController()` with the rest part of the route;
Arguments
"render"
array:2 [
"serviceSlug" => "sheriffs-office"
"subPageSlug" => "sheriff-department-divisions"
]
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/craftcms
/cms
/src
/web
/Application.php
}
// If this is an action request, call the controller
if (($response = $this->_processActionRequest($request)) !== null) {
return $response;
}
// If we're still here, finally let Yii do it's thing.
return parent::handleRequest($request);
}
/**
* @inheritdoc
* @param string $route
* @param array $params
* @return Response|null The result of the action, normalized into a Response object
*/
public function runAction($route, $params = [])
{
$result = parent::runAction($route, $params);
if ($result !== null) {
if ($result instanceof Response) {
return $result;
}
$response = $this->getResponse();
$response->data = $result;
return $response;
}
return null;
}
/**
* @inheritdoc
*/
public function setVendorPath($path)
{
Arguments
"app-module/departments-sub-page/render"
array:2 [
"serviceSlug" => "sheriffs-office"
"subPageSlug" => "sheriff-department-divisions"
]
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/yiisoft
/yii2
/web
/Application.php
$url = $e->url;
if (is_array($url)) {
if (isset($url[0])) {
// ensure the route is absolute
$url[0] = '/' . ltrim($url[0], '/');
}
$url += $request->getQueryParams();
}
return $this->getResponse()->redirect(Url::to($url, $e->scheme), $e->statusCode);
}
} else {
$route = $this->catchAll[0];
$params = $this->catchAll;
unset($params[0]);
}
try {
Yii::debug("Route requested: '$route'", __METHOD__);
$this->requestedRoute = $route;
$result = $this->runAction($route, $params);
if ($result instanceof Response) {
return $result;
}
$response = $this->getResponse();
if ($result !== null) {
$response->data = $result;
}
return $response;
} catch (InvalidRouteException $e) {
throw new NotFoundHttpException(Yii::t('yii', 'Page not found.'), $e->getCode(), $e);
}
}
private $_homeUrl;
/**
* @return string the homepage URL
*/
Arguments
"app-module/departments-sub-page/render"
array:2 [
"serviceSlug" => "sheriffs-office"
"subPageSlug" => "sheriff-department-divisions"
]
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/craftcms
/cms
/src
/web
/Application.php
// If they're accessing a plugin's section, make sure that they have permission to do so
$firstSeg = $request->getSegment(1);
if ($firstSeg !== null) {
/** @var Plugin|null $plugin */
$plugin = $this->getPlugins()->getPlugin($firstSeg);
if ($plugin && !$user->checkPermission('accessPlugin-' . $plugin->id)) {
throw new ForbiddenHttpException();
}
}
}
// If this is an action request, call the controller
if (($response = $this->_processActionRequest($request)) !== null) {
return $response;
}
// If we're still here, finally let Yii do it's thing.
return parent::handleRequest($request);
}
/**
* @inheritdoc
* @param string $route
* @param array $params
* @return Response|null The result of the action, normalized into a Response object
*/
public function runAction($route, $params = [])
{
$result = parent::runAction($route, $params);
if ($result !== null) {
if ($result instanceof Response) {
return $result;
}
$response = $this->getResponse();
$response->data = $result;
Arguments
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/vendor
/yiisoft
/yii2
/base
/Application.php
*/
public function setBasePath($path)
{
parent::setBasePath($path);
Yii::setAlias('@app', $this->getBasePath());
}
/**
* Runs the application.
* This is the main entrance of an application.
* @return int the exit status (0 means normal, non-zero values mean abnormal)
*/
public function run()
{
try {
$this->state = self::STATE_BEFORE_REQUEST;
$this->trigger(self::EVENT_BEFORE_REQUEST);
$this->state = self::STATE_HANDLING_REQUEST;
$response = $this->handleRequest($this->getRequest());
$this->state = self::STATE_AFTER_REQUEST;
$this->trigger(self::EVENT_AFTER_REQUEST);
$this->state = self::STATE_SENDING_RESPONSE;
$response->send();
$this->state = self::STATE_END;
return $response->exitStatus;
} catch (ExitException $e) {
$this->end($e->statusCode, isset($response) ? $response : null);
return $e->statusCode;
}
}
/**
* Handles the specified request.
*
* This method should return an instance of [[Response]] or its child class
Arguments
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/CraftFrontController.php
$whoops->register();
require __DIR__ . '/config/devMode.php';
$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/console.php';
$exitCode = $app->run();
exit($exitCode);
}
if (getenv('DEV_MODE') === 'true') {
// Register handler to catch errors that come up before Yii registers a handler
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
$whoops->register();
require __DIR__ . '/config/devMode.php';
}
$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/web.php';
$app->run();
/mnt
/dwg-do-dev-lemp-expansion
/work
/dev
/fcsc
/public
/index.php
<?php
require dirname(__DIR__) . '/CraftFrontController.php';
Arguments
"/mnt/dwg-do-dev-lemp-expansion/work/dev/fcsc/CraftFrontController.php"