2017 © Pedro PelĆ”ez
 

library view

Simple View renderer

image

koine/view

Simple View renderer

  • Sunday, August 16, 2015
  • by mjacobus
  • Repository
  • 1 Watchers
  • 1 Stars
  • 915 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

Koine View

Simple view renderer for phtml files, (*1)

Code information:, (*2)

Build Status Coverage Status Code Climate Scrutinizer Code Quality, (*3)

Package information:, (*4)

Latest Stable Version Total Downloads Latest Unstable Version License Dependency Status, (*5)

Usage

$config  = new \Koine\View\Config;

$config->addPath('/path1')
    ->addPath('/path2')
    ->addPaths(array(
        'path3',
        'path4',
    ));

$config->setHelper('escaper', new \MyEscaper());

$viewRenderer = new \Koine\View\Renderer($config);

echo $viewRenderer->render('post_template.phtml', array(
    'title'        => 'Some Title',
    'body'         => 'Some content',
    'relatedPosts' => $relatedPosts,
));

The templates:, (*6)


<article>
    <!-- either $this->escape() or $this->getHelper('escaper')->escape() will work -->
    <h1><?= $this->escape($title) ?></h1>
    <div class="body"><?= $this->getHelper('escaper')->escape($body) ?></div>

    <?= $this->partial('related_posts.phtml', array(
            'posts' => $relatedPosts
        ));
    ?>
</article>


<sidebar class="related">
    <h2>Related Posts</h2>
    <?php foreach ($posts as $post) : ?>
        <?= $this->partial('related_post.phtml', array(
            'title' => $post['title'],
            'url'   => $post['url'],
        )) ?>
    <?php endforeach ?>
</sidebar>


<a href="<?= $this->getHelper('escaper')->escape($url) ?>">= $this->getHelper('escaper')->escape($title) ?></a>

Installing

Via Composer

Append the lib to your requirements key in your composer.json., (*7)

{
    // composer.json
    // [..]
    require: {
        // append this line to your requirements
        "koine/view": "dev-master"
    }
}

Alternative install

Issues/Features proposals

Here is the issue tracker., (*8)

Contributing

Only TDD code will be accepted. Please follow the PSR-2 code standard., (*9)

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

How to run the tests:

phpunit --configuration tests/phpunit.xml

To check the code standard run:

phpcs --standard=PSR2 lib
phpcs --standard=PSR2 tests

Lincense

MIT, (*10)

Authors

The Versions

16/08 2015

dev-master

9999999-dev

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

16/08 2015

1.0

1.0.0.0

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

16/08 2015

0.9.x-dev

0.9.9999999.9999999-dev

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

05/09 2014

0.9.7

0.9.7.0

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

05/09 2014

0.9.6

0.9.6.0

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

05/09 2014

0.9.5

0.9.5.0

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

05/09 2014

0.9.4

0.9.4.0

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

05/09 2014

0.9.3

0.9.3.0

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

04/09 2014

0.9.2

0.9.2.0

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

04/09 2014

0.9.1

0.9.1.0

Simple View renderer

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

27/08 2014

0.9.0

0.9.0.0

Simple View renderer

  Sources   Download

MIT

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa

20/08 2014

dev-wip

dev-wip

Simple View renderer

  Sources   Download

MIT

The Development Requires

by Marcelo Jacobus
by Elisandro Nabinger
by Daniel CaƱa