PHP code example of hypejunction / elgg_stars

1. Go to this page and download the library: Download hypejunction/elgg_stars library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hypejunction / elgg_stars example snippets


echo elgg_view_form('stars/rate', array(), array(
	'entity' => $entity,
	'annotation_names' => array($criteria1, $criteria2)
));

echo elgg_view('input/stars', array(
	'name' => 'stars'
));

$stars = get_input('stars');

$ratings = elgg_stars_get_entity_rating_values($entity, array($criteria1, $criteria2);

echo elgg_view('output/stars', array(
	'value' => $my_value
));