Giter VIP home page Giter VIP logo

mason's People

Contributors

bostrt avatar dwest avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

mason's Issues

Throwing Exceptions makes render unsuitable for use in __toString

When mason cannot find a requested template file it throws an exception. Unfortunately if this happens inside a __toString method this causes a fatal error which cannot be caught and provides little information as to why the application died.

Possible solutions:

  • Have an error reporting level (EXCEPTION|WARN|IGNORE|LOG) for development, testing, and production.
  • Detect if a __toString method is anywhere on the callstack and use trigger_error instead (not a fan of this one).
  • Just always print a warning (is problematic in a production setting when errors should not appear to the user)

Before and After functions

Sometimes you want to append or prepend something to the parent's content instead of replacing it outright. This is not currently possible with append/prepend because they work only in the parent template. To that end we should add before and after functions that work outside of the normal blocks and are only concatenated after the block is full processed.

For example:

===File A===

Default

===File B===

<?php $after('content')?>
<div>After</div>
<?php $end('content')?>

===File C===

<?php $before('content')?>
<div>Before</div>
 <?php $end('content")?>

<?php $block('content')?>
<div>Override</div>
<?php $end('content')?>

Would produce:

Before

Override

After

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.