Skip navigation

Pure UL / LI Listing Example


Below example generate pure ul / li listing from all parent / child category information.

Example


include_once(ROOTPATH . "include/scripts/categories.php");
$cat = new vskCategory();
/* OUTPUT TYPE
--> 0: return complete panel
--> 1: return div output with ul
--> 2: return ul li listing
--> 3: return array
--> 4: return dropdown list */
$cat->outputType = 2;
$cat->type = 15; // category types (configured under /include/config.xml) in order to manage categories for different types of contents e.g (photos, videos, products, directories, etc)
$cat->parentid = -1; // -1 will remove fetching categories based on parent id
$cat->isAll = true; // if true will load all categories
$cat->isParents = false; // if false will load all parents and child categories
$cat->url = "[CID]/[CT].html"; // set category url format based on your application requirements
echo $cat->Process();

Demo