Ksmarty is a view replacement for Kohana3. It works with either Smarty2 or Smarty3 (currently in alpha)


  • Clone the repository and copy the 'smarty' directory to the 'modules' directory of your Kohana3 project.
  • Download Smarty and put the contents of the 'libs' folder to 'smarty/vendor/smarty'


Ksmarty mimics the usage of Kohana::View. Please note that, unlike the Kohana::View, template variables are global to all nested views.

Example controller:

<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Welcome extends Controller_Template
	public $template = 'welcome';

	public function action_index()
                // Assign a value to the variable 'intro'
		$this->template->intro = 'Hello world!';

                // Create a nested view by loading a different template
		$this->template->content = View::factory('content');
// End Welcome

Template: welcome.tpl


Template: content.tpl

Yes, this works!


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.