Browse Source

adding #7

develop
HerrHase 3 years ago
parent
commit
bec21cf385
2 changed files with 6 additions and 2 deletions
  1. +2
    -2
      app/Controllers/PageController.php
  2. +4
    -0
      resources/views/page/default.blade.php

+ 2
- 2
app/Controllers/PageController.php View File

@ -38,8 +38,8 @@ class PageController extends DirectusControllerAbstract
$repository = Manager::get('Page'); $repository = Manager::get('Page');
$page = $repository->findOneBySlug($slug); $page = $repository->findOneBySlug($slug);
if ($page['data'] === NULL) {
$this->app>redirect('/404', 301);
if (count($page['data']) === 0) {
$this->app->redirect('/404', 301);
} else { } else {
$this->render($page); $this->render($page);
} }


+ 4
- 0
resources/views/page/default.blade.php View File

@ -1,5 +1,9 @@
@extends('layout') @extends('layout')
@php
var_dump($page); die();
@endphp
@inject('markdownHelper', 'App\Helpers\MarkdownHelper') @inject('markdownHelper', 'App\Helpers\MarkdownHelper')
@section('content') @section('content')


Loading…
Cancel
Save