Happpi PHP Library

getLifestyles()

Retrieves a list of all the Lifestyles.

Return Type

Array of type: CurtAPICategory

Required Parameters

    None

Optional Parameters

    None

Dependencies

    None

Example:


<!-- getLifestyles() -->
<?php
	require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

	// once the library is required, you can now use one of the main "interaction" classes.
	// These interaction classes contain methods that get information from our REST API and
	// converts them to PHP objects for you to use.
	$Cat = new CurtCategory(); // create a new category object to gain access to its functions.

	$lifestyles = $Cat->getLifestyles(); // call getLifestyles() to get an array of type APICategory
	echo "<h2>All Lifestyles: </h2>";
	foreach($lifestyles as $lifestyleObj){ // step through each of the lifestyles
		echo $lifestyleObj->getCatTitle(); // use the getter to get the catTitle for each lifestyle.
		echo "<br />";

	}
?>