Documentation

Uzuvi works on sqlite database. Trying to be as small as possible but full system. As you can see here, Uzuvi provide API with very few methods. All functions are static methods of Uzuvi class. This is facade-based approach which makes code bugs-free drastically. Despite on tiny amount of methods, they are enough to work. With these methods you can add/delete/update/copy any entries.

Uzuvi in not only CMS but also a framework of common purpose.
Php Framework Documentation


Data Structure

In Uzuvi you have Fields and Folders and nothing else! Every field and every folder has name, value and rowid.
		Field: name, value, rowid;
		Folder: name, value, rowid;
	

Path is a sequences of names and values to find entry in database. Use leading dot to find entry by value. Finding folders by values is very usefull method. It is the often case when you use folder names as number to put them in desired order. Using folder names for order — recommended approach. This is how path works:
		<?= uzuvi::value("footer/.about/content") ?> 
		// Find `footer` name in root, then find `about` value in found `footer`,
		// then find `content` name in found `about`,
		// then return value of that `content`
	

API


01. static function uzuvi::value($baseid, $path) -> string


		// Get field value  
		<?= uzuvi::value("seo/title") ?> 
		<?= uzuvi::value($entry, "title") ?> 
		
		// In HTML:
		<a href="<?=uzuvi::value('.top/button/href')?>">
			  <?=uzuvi::value(".top/button/title")?>
		</a>
		
	

02. static function uzuvi::name($baseid, $path) -> string


		// Get field name  
		<?= uzuvi::name("seo/title"); // = 'title' ?>
		<?= uzuvi::name($entry, "innerfolder/title"); // = 'title' ?> 
	

03. static function uzuvi::exist($baseid, $path) -> bool


		// Check if entry exists
		<?= uzuvi::exist("footer/about") ?>
	

04. static function uzuvi::folders($baseid, $path) -> array


		// Get folders within a folder
		<?php foreach (uzuvi::folders("features") as $entry) {
			    clog( uzuvi::value($entry, "title") );
		} ?>
		
		// In HTML:
		<ul>
			  <? foreach (uzuvi::folders(".footer/menu") as $item): ?>
			    <li>
			      <a href="<?=uzuvi::value($item, 'href')?>">
			        <?=uzuvi::value($item, "title")?>
			      </a>
			    </li>
			  <? endforeach ?>
		</ul>
	

05. static function uzuvi::fields($baseid, $path) -> array


		// Get fields within a folder
		<?php foreach (uzuvi::fields("seo") as $field) {
			    clog( uzuvi::name($field) );
			    clog( uzuvi::value($field) );
		} ?>
	

06. static function uzuvi::entry($baseid, $path) -> object


		// Get entry by path
		<?php print_r(uzuvi::entry("seo")) ?>
	

07. static function uzuvi::get($rowid) -> object


		// Get entry by rowid
		<?php print_r(uzuvi::get(101)) ?>
	

08. static function uzuvi::add($values) -> int, new rowid


		// Add entry
		// ---
		// Add Field
		<?php $id = uzuvi::add(['name' => 'title', 'value' => 'hello', 'parentid' => 101]) ?>
		// Add Folder
		<?php $id = uzuvi::add(['name' => '1', 'value' => 'seo', 'isfolder' => 1]) ?>
	

09. static function uzuvi::delete($rowid) -> none


		// Delete entry and all inner items recursively
		<?php uzuvi::delete(101) ?>
	

10. static function uzuvi::update($rowid, $values) -> none


		// Update entry name, value or parentid 
		<?php uzuvi::update(101, ['name' => 'title', 'value' => 'hello']) ?>
	

11. static function uzuvi::move($rowid, $intoid) -> none


		// Move entry to another folder
		<?php uzuvi::move(101, 102) ?>
	

12. static function uzuvi::findone($values) -> object


		// Find one entry by exact name or value
		<?php print_r( uzuvi::findone(['name' => '1', 'value' => '2']) ) ?>
	

13. static function uzuvi::findall($values) -> array


		// Find all entries by exact name or value
		<?php print_r( uzuvi::findall(['name' => '1', 'value' => '2']) ) ?>
	

14. static function uzuvi::copy($rowid, $intoid = -1) -> int, new rowid


		// Make a deep copy and optionally move to new folder
		<?php uzuvi::copy(101, 102) ?>
	

16. static function uzuvi::connect($sqlitefile) -> bool


		// Connect to Sqlite database file 
		<?php uzuvi::connect(__DIR__ . '/site.sqlite') ?>