-
Notifications
You must be signed in to change notification settings - Fork 7
Getting started
First of all, download the latest vodka release and put it in your site root directory or one above it if you plan to have many vodka-powered websites. Alternatively just clone the master branch, i try to keep it stable anyway. Then create an empty index.php, this would be our main file.
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 by 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"; // change it accordingly
$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! :)