Skip to content

sadephp/sadephp.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Work in progress!

Sade, a library for creating PHP Components with Twig (2.x). This package will not do any preprocessing or somthing like that.

Installation

composer require sade/sade

Or use the boilerplate

Example

<template>
    <p>{{ greeting }} World!</p>
</template>

<style scoped>
    p {
        font-size: 2em;
        text-align: center;
    }
</style>

<?php
    return [
        'data' => function() {
            return [
                'greeting' => 'Hello'
            ];
        }
    ];
?>

To render

$sade = new \Sade\Sade(__DIR__ . '/examples');

echo $sade->render('greeting.php');

With CLI:

sade --src "examples/greeting.php" --out build

License

MIT © Fredrik Forsmo

Releases

No releases published

Packages

No packages published

Languages