Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Extension for Kohana View class. Allows use blocks like Django
tree: 285d6693c1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

This module allow use blocks like in Django.

In your layout template define blocks:

        <?php $this->block('title') ?>
            Layout title
        <?php $this->endblock('title') ?>
    <?php $this->block('content') ?>
        Layout content
    <?php $this->endblock('content') ?>

And add in child view this:

<?php $this->extend('layout') ?>

<?php $this->block('content') ?>
    Child content 
<?php $this->endblock('content') ?>

Now you can simple render child view:

$this->request->response = View::factory('child');

Blocks can be nested:

<?php $this->extend('layout') ?>

<?php $this->block('content') ?>


    <?php $this->block('left') ?>
    <?php $this->endblock('left') ?>

    <?php $this->block('right') ?>
    <?php $this->endblock('right') ?>

<?php $this->endblock('content') ?>

You can use any vars to discover which template to extend.

<?php $this->extend('layouts/'.$extends) ?>

Block name in endblock() method is optional. If it passed, module also check right order of blocks.

Something went wrong with that request. Please try again.