<!DOCTYPE html> <html lang="en-US"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta charset="utf-8" /> <title>{{entry.title}} | Sykkelriket.no</title> {% if entry.metadescription | length %} <meta name="description" content="{{entry.metadescription}}" /> {% elseif entry.excerpt | length %} <meta name="description" content="{{entry.excerpt}}" /> {% else %} <meta name="description" content="Velkommen til Sykkelriket. Seks nasjonalparker, idylliske tettsteder, koselige destinasjoner og verdens beste vertskap venter på deg." /> {% endif %} {% if craft.request.getSegment(1) == "turer" and craft.request.getSegment(2) | length %}
// Add deprecated support for the old DateTime methods if ($object instanceof \DateTime && ($value = self::_dateTimeAttribute($object, $item, $type)) !== false) { return $value; } try { return \twig_get_attribute($env, $source, $object, $item, $arguments, $type, $isDefinedTest, $ignoreStrictCheck); } catch (UnknownMethodException $e) { // Copy twig_get_attribute()'s BadMethodCallException handling if ($ignoreStrictCheck || !$env->isStrictVariables()) { return null; } throw new \Twig_Error_Runtime($e->getMessage(), -1, $source);
<head> <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" /> <meta charset=\"utf-8\" /> <title>"; // line 7 echo twig_escape_filter($this->env, craft\helpers\Template::attribute($this->env, $this->getSourceContext(), (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new Twig_Error_Runtime('Variable "entry" does not exist.', 7, $this->source); })()), "title", []), "html", null, true); echo " | Sykkelriket.no</title> "; // line 8 if (twig_length_filter($this->env, craft\helpers\Template::attribute($this->env, $this->getSourceContext(), (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new Twig_Error_Runtime('Variable "entry" does not exist.', 8, $this->source); })()), "metadescription", []))) { // line 9 echo " <meta name=\"description\" content=\"";
return ob_get_clean(); } protected function displayWithErrorHandling(array $context, array $blocks = []) { try { $this->doDisplay($context, $blocks); } catch (Twig_Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } // this is mostly useful for Twig_Error_Loader exceptions
* @throws \Twig_Error * @throws \Twig_Error_Runtime */ protected function displayWithErrorHandling(array $context, array $blocks = []) { try { parent::displayWithErrorHandling($context, $blocks); } catch (\Twig_Error_Runtime $e) { if (Craft::$app->getConfig()->getGeneral()->suppressTemplateErrors) { // Just log it and move on Craft::$app->getErrorHandler()->logException($e); } else { throw $e;
{ return $this->blocks; } public function display(array $context, array $blocks = []) { $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks)); } public function render(array $context) { $level = ob_get_level(); ob_start();
* @inheritdoc */ public function display(array $context, array $blocks = []) { $name = $this->getTemplateName(); Craft::beginProfile($name, __METHOD__); parent::display($context, $blocks); Craft::endProfile($name, __METHOD__); } // Protected Methods // =========================================================================
// line 1 $context["entry"] = craft\helpers\Template::attribute($this->env, $this->getSourceContext(), craft\helpers\Template::attribute($this->env, $this->getSourceContext(), craft\helpers\Template::attribute($this->env, $this->getSourceContext(), craft\helpers\Template::attribute($this->env, $this->getSourceContext(), (isset($context["craft"]) || array_key_exists("craft", $context) ? $context["craft"] : (function () { throw new Twig_Error_Runtime('Variable "craft" does not exist.', 1, $this->source); })()), "entries", []), "section", [0 => "hikes"], "method"), "slug", [0 => craft\helpers\Template::attribute($this->env, $this->getSourceContext(), craft\helpers\Template::attribute($this->env, $this->getSourceContext(), (isset($context["craft"]) || array_key_exists("craft", $context) ? $context["craft"] : (function () { throw new Twig_Error_Runtime('Variable "craft" does not exist.', 1, $this->source); })()), "request", []), "getSegment", [0 => 2], "method")], "method"), "first", [], "method"); // line 2 echo " "; // line 3 $this->loadTemplate("header.html", "turer/_print", 3)->display($context); // line 4 echo "<script src=\"/js/mapcontroller.js\"></script> <script src=\"https://d3js.org/d3.v3.min.js\" charset=\"utf-8\"></script> <link rel=\"stylesheet\" href=\"/CSS/leaflet.elevation-0.0.4.css\" /> <script type=\"text/javascript\" src=\"/js/Leaflet.Elevation-0.0.4.min.js\"></script>
return ob_get_clean(); } protected function displayWithErrorHandling(array $context, array $blocks = []) { try { $this->doDisplay($context, $blocks); } catch (Twig_Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } // this is mostly useful for Twig_Error_Loader exceptions
* @throws \Twig_Error * @throws \Twig_Error_Runtime */ protected function displayWithErrorHandling(array $context, array $blocks = []) { try { parent::displayWithErrorHandling($context, $blocks); } catch (\Twig_Error_Runtime $e) { if (Craft::$app->getConfig()->getGeneral()->suppressTemplateErrors) { // Just log it and move on Craft::$app->getErrorHandler()->logException($e); } else { throw $e;
{ return $this->blocks; } public function display(array $context, array $blocks = []) { $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks)); } public function render(array $context) { $level = ob_get_level(); ob_start();
* @inheritdoc */ public function display(array $context, array $blocks = []) { $name = $this->getTemplateName(); Craft::beginProfile($name, __METHOD__); parent::display($context, $blocks); Craft::endProfile($name, __METHOD__); } // Protected Methods // =========================================================================
public function render(array $context) { $level = ob_get_level(); ob_start(); try { $this->display($context); } catch (Throwable $e) { while (ob_get_level() > $level) { ob_end_clean(); } throw $e;
* @throws Twig_Error_Loader When the template cannot be found * @throws Twig_Error_Syntax When an error occurred during compilation * @throws Twig_Error_Runtime When an error occurred during rendering */ public function render($name, array $context = []) { return $this->loadTemplate($name)->render($context); } /** * Displays a template. * * @param string $name The template name
// Render and return $renderingTemplate = $this->_renderingTemplate; $this->_renderingTemplate = $template; Craft::beginProfile($template, __METHOD__); try { $output = $this->getTwig()->render($template, $variables); } catch (\RuntimeException $e) { if (!YII_DEBUG) { // Throw a generic exception instead throw new Exception('An error occurred when rendering a template.', 0, $e); } throw $e;
ob_implicit_flush(false); $isRenderingPageTemplate = $this->_isRenderingPageTemplate; $this->_isRenderingPageTemplate = true; $this->beginPage(); echo $this->renderTemplate($template, $variables); $this->endPage(); $this->_isRenderingPageTemplate = $isRenderingPageTemplate; $output = ob_get_clean();
} $headers->set('content-type', $mimeType . '; charset=' . $response->charset); } // Render and return the template $response->data = $this->getView()->renderPageTemplate($template, $variables); // Prevent a response formatter from overriding the content-type header $response->format = YiiResponse::FORMAT_RAW; return $response; }
// Merge any additional route params $routeParams = Craft::$app->getUrlManager()->getRouteParams(); unset($routeParams['template'], $routeParams['template']); $variables = array_merge($variables, $routeParams); return $this->renderTemplate($template, $variables); } /** * Shows the 'offline' template. * * @return Response
$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); } }
} $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 */
/** * @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); $message = $e->getMessage(); if ($e instanceof ClientException) { $statusCode = $e->getCode();
$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; }
* @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; }
$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) {
// 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
{ 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();
(new Dotenv\Dotenv(CRAFT_BASE_PATH))->load(); } // Load and run Craft define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); $app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/web.php'; $app->run(); /* $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'https://cbis-rest-api.citybreak.com/v1/api/category'); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$_GET = [ 'p' => 'en/print/tour-de-dovre', ];