asika/vaseman

A prototype system. He is nothing but pretty face.

Installs: 48

Dependents: 0

Stars: 21

Watchers: 3

Forks: 6

Open Issues: 2

Language: HTML

2.0.4 2015-07-05 15:57 UTC

README

logo

Travis Latest Stable Version Total Downloads Latest Unstable Version License

Vaseman is nothing but only pretty face. He is a prototype system and static site generator.

Installation

Install by Download

Please download from here: https://github.com/asika32764/vaseman/releases

Install by Composer

$ php composer.phar create-project asika/vaseman [project-dir] 2.*

Getting Started

View Pages

Open project dir by browser, you can see the index page.

index

And click Admin button on top left, this is a back-end page example.

admin

Writing Pages

Just create your *.twig in entries folder.

The template file path are match the url path. If you go path/to/your/page, Vaseman will render entries/path/to/your/page.twig for you.

Base URI

Using {{ uri.base }} to add subfolder for assets url.

For Example, If you put your project in http://localhost/subfolder

<script src="{{ uri.base }}assets/js/main.js"></script>

Will render as:

<script src="/subfolder/assets/js/main.js"></script>

That avoid the loading failure by relative path.

Helper

Create your own helper class in src/Helper:

<?php
// src/Helper/Myhelper.php

namespace Vaseman\Helper;

use Vaseman\Helper\Set\AbstractHelper as Helper;

class Myhelper extends AbstractHelper
{
    public function getSomeThing($foo = '')
    {
        return 'Something is ' . $foo;
    }
}

Then you can use this helper in templates:

<div class="{{ helper.myhelper.getSomeThing('bar') }}"></div>

License

GNU General Public License version 2 or later;

Resources

About Windwalker

https://github.com/ventoviro/windwalker

About Twig

http://twig.sensiolabs.org/