2017 © Pedro Peláez
 

library phptal-module

BEAR.Sunday PHPTAL adapter module

image

bear/phptal-module

BEAR.Sunday PHPTAL adapter module

  • Wednesday, July 23, 2014
  • by tanakahisateru
  • Repository
  • 1 Watchers
  • 2 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

BEAR.PhptalModule

Introduction

BEAR.PhptalModule is PHPTAL adaptor extension for BEAR.Sunday framework., (*1)

Installation

Add the package name to your composer.json., (*2)

{
    "require": {
        "bear/phptal-module": "~0.2"
    }
}

Usage

For example you are using BEAR.Package ..., (*3)

At first install the module by modifying YourApp\Module\App\AppModule as:, (*4)

namespace YourApp\Module\App;

use BEAR\PhptalModule\Provide\TemplateEngine\Phptal\PhptalModule;

class AppModule extends AbstractModule
{
    protected function configure()
    {
        // (Existing configurations here)

        $this->install(new PhptalModule($this));
    }
}

Place TAL syntax mixed XHTML file into YourApp/src/Resource/Page directory., (*5)

src/Resource/Page/Index.xhtml

<!DOCTYPE html>
<html lang="ja" metal:use-macro="layout/default.xhtml/html">
<head>
    <meta charset="utf-8" />
    <title metal:fill-slot="title">Index</title>
</head>
<body>
    <div class="container" metal:fill-slot="page">
        <h1><span tal:content="greeting" tal:omit-tag="">Some greeting message</span></h1>
        <p>template engine: PHPTAL</p>
    </div>
</body>
</html>

To define shared PHPTAL's macro, place another template file into YourApp/var/lib/phptal/template/layout., (*6)

var/lib/phptal/template/layout/default.xhtml

<!DOCTYPE html>
<html lang="ja" metal:define-macro="html">
<head>
    <meta charset="utf-8" />
    <title metal:define-slot="title">title</title>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" />
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
</head>
<body>
    <div class="container" metal:define-slot="page">page</div>
</body>
</html>

Run your app, enjoy!, (*7)

The Versions

23/07 2014

dev-master

9999999-dev

BEAR.Sunday PHPTAL adapter module

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

bear.sunday phptal bear.sunday module

23/07 2014

0.2.1

0.2.1.0

BEAR.Sunday PHPTAL adapter module

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

bear.sunday phptal bear.sunday module

22/07 2014

0.2.0

0.2.0.0

BEAR.Sunday PHPTAL adapter module

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

bear.sunday phptal bear.sunday module

04/06 2013

0.1.0

0.1.0.0

BEAR.Sunday PHPTAL adapter module

  Sources   Download

BSD-3-Clause

The Requires

 

bear.sunday phptal bear.sunday module