Skip to content
deseven edited this page Mar 21, 2017 · 4 revisions

First of all, grab the latest vodka.class.php and put it in your site root directory. Then create an empty index.php right next to it, we'll build our site inside.

Start with some basic engine parameters (don't forget to replace base_url with your real site url):

$params["system"] = array(
	"base_url"    => "http://example.com/",
	"show_errors" => true
);

Continue with defining your template (if you don't have it you can grab demo template here or learn how to make one):

$params["templates"] = array(
	"myCoolTemplate" => "tpl/myCoolTemplate"
);

We also need a menu, change the html code to something that suits your template:

$params["menu"] = array(
	"html" => '<li><a href="{VODKA:URL}" id="{VODKA:NAME}" class="{VODKA:CLASS}">{VODKA:TITLE}</a></li>',
	"selected_class" => "selected"
);

The next step is to include the class file and to initialize vodka:

require "vodka.class.php";
$vodka = new vodka($params);

After that we will load the template and the page, build the menu and then output the generated page:

$vodka->loadTemplate("myCoolTemplate");
$vodka->loadCurrentPage();
$vodka->buildCurrentMenu();
$vodka->buildCurrentPage();

That's it!

Check the demo sources and other documentation pieces to get some advanced usage examples.

Have fun with vodka! :)

Clone this wiki locally