Giter VIP home page Giter VIP logo

kirby-blade-template's People

Contributors

obelmont avatar pedroborges avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kirby-blade-template's Issues

Fatal error: Cannot redeclare e()

After installing kirby-blade-template the CMS did not start to work.

Kirby and Laravel have an e() helper function and Kirby cannot redeclare it.

As a workaround I was extending the index.php to look like this. I don't know if there is any other workaround.

require __DIR__ . '/kirby/config/helpers.php';
require __DIR__ . '/kirby/bootstrap.php';

echo (new Kirby)->render();

Error reporting

So I used the master.blade.php and default.blade.php examples from the README, but got an error catched by Whoops:

Whoops \ Exception \ ErrorException (E_ERROR)
Method Illuminate\View\View::__toString() must not throw an exception

And nothing in the stack trace, so Whoops showed my index.php, which was not very useful.

With Whoops disabled, I get this error printed in the page:

Fatal error: Method Illuminate\View\View::__toString() must not throw an exception in /Users/Florens/[…]/index.php on line 0

Turned out I was using @extends('layouts.master') but had put my master.blade.php at the root of the templates folder, rather than in a layouts subfolder. But with no relevant errors, that can be hard to figure out.

In this specific case, both the basic error and the Whoops error handler page show the same unhelpful error. Here is a case where Whoops shows that unhelpful error but the basic error output is more helpful:

@section('title', $page->doesntexist)

Basic output:

Notice: Undefined property: Page::$doesntexist in /Users/Florens/[…]/site/cache/d2039ed96c3f8c364028a47d23fef68b5cfe6b8d.php on line 1

Whoops output:

Whoops \ Exception \ ErrorException (E_ERROR)
Method Illuminate\View\View::__toString() must not throw an exception

For the record, I wrote https://github.com/fvsch/kirby-twig and since Twig was reporting meaningful errors but not adding them to a stack trace, I had to skip using Whoops and catch the errors myself to display an error page. Feel free to reuse my code if you think you want to do something similar.

Kirby 3

Just curious to know if this works with Kirby 3?
I haven't had the opportunity to use it (v3) yet and don't think I would be able to go back to pre blade Kirby!

Plugin always caches templates

Hi,

Should the template cache always be active? I expected it to follow the c::get('cache') (or kirby()->get('option', 'cache')) setting.

It was a bit puzzling to get an error saying "in in /Users/Florens/[…]/site/cache/d2039ed96c3f8c364028a47d23fef68b5cfe6b8d.php" when I have caching disabled locally.

Now I’m mostly puzzled because with Twig, the template cache tends to be a bit sticky and require manual purging sometimes. With Blade, it seems that it's picking up template changes easily, so maybe there's no value in avoiding caching.

What do you think?

Does not accept crop or resize image

Whoops \ Exception \ ErrorException (E_ERROR)
Method Illuminate\View\View::__toString() must not throw an exception, caught ErrorException: Parse error: syntax error, unexpected ')', expecting ',' or ';'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.