Happpi PHP Library

getCategoryAttributes()

Retrieves a list of all the attribute titles.

Return Type

Array of type: string

Required Parameters

    None

Optional Parameters

    None

Dependencies

    $category->setCatID(int $value)

Example:

<!-- getCategoryAttributes() -->
<?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.


	$Cat->setCatID(7); // set the required dependency of catID to determine which category (Class V Trailer Hitches).
	$catAttributes = $Cat->getCategoryAttributes(); // call getCategoryAttributes which returns an array of strings.

	echo "<h2>Attributes for Class V Trailer Hitches</h2>";
	foreach($catAttributes as $attrString){ // step through each category attribute.
		echo $attrString; // display the string.
		echo "<br />";
	}
?>