2017 © Pedro Peláez
 

library gaunt

image

gaunt/gaunt

  • Thursday, October 10, 2013
  • by tkjaergaard
  • Repository
  • 3 Watchers
  • 3 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

What is Gaunt?

Gaunt is the simplest template engine written for Wordpress. The engine is heavily inspired and based upon Laravel 4 Blade. Gaunt is not nearly as heavy and feature-rich as dedicated template engines such as Smarty and Twig. But it helps you simplify your theme pages quite a lot., (*1)

Installation

Gaunt is installable through Composer., (*2)

"require" : {
     "gaunt/gaunt":"1.0.*"
}

Require "vendor/autoload.php" in your functions.php or plugin.php, (*3)

require("vendor/autoload.php");

Docs

The loop

@startloop
    ``the_title();``
    ``the_content();``
@endloop


@startloop
    ``the_title();``
    ``the_content();``
@noposts


No posts yet, sorry.., (*4)

@endloop

Code blocks

Code blocks is equal to , (*5)

    ``
         $foo = "bar";
         $bar = ["a","b","c"];
    ``

Echoing data

Hello, {{ $user }}.

Hello, {{ $user.name }} // $user['name'];

Hello, {{ $user->name }}

The current UNIX timestamp is {{ time() }}.

If statements

@if (count($posts) === 1)
    I have one post!
@elseif (count($posts) > 1)
    I have multiple posts!
@else
    I don't have any posts!
@endif

Loops

@for ($i = 0; $i < 10; $i++)
    The current value is {{ $i }}
@endfor

@foreach ($posts as $post)


The title of this post is: {{ $post->post_title }}, (*6)

@endforeach @while (true)

I'm looping forever., (*7)

@endwhile

Including sub-views

@include('view.php')




Comments

{{-- This comment will not be in the rendered HTML --}}

Examples

<!doctype html>
<html lang="en">
<head>
    <title>Page Title</title>
</head>
<body>

    @include('header.php')

    @startloop
        ``the_title();``
        ``the_content();``
    @noposts
        <p>Sorry no posts here..</p>
    @endloop

    @include('footer.php')

</body>
</html>

The Versions

10/10 2013

dev-master

9999999-dev

  Sources   Download

MIT

by t_kjaergaard

10/10 2013

1.0.2

1.0.2.0

  Sources   Download

MIT

by t_kjaergaard

10/05 2013

1.0.1

1.0.1.0

  Sources   Download

MIT

by t_kjaergaard

10/05 2013

1.0.0

1.0.0.0

  Sources   Download

MIT

by t_kjaergaard