Example #1
0
/**
 * @param EntityBuilderHelper $entityBuilder
 */
function buildCreateView($entityBuilder)
{
    $emptyEntityInstance = $entityBuilder->createEmpty();
    $formViewAggregator = new FormViewAggregator($emptyEntityInstance);
    $contentHeader = $entityBuilder->getLabel();
    $contentAction = 'Shto';
    $contentHTML = $formViewAggregator->buildEntityFormHTML();
    $GLOBALS[CONTENT_HEADER] = $contentHeader;
    $GLOBALS[CONTENT_ACTION] = $contentAction;
    $GLOBALS[CONTENT_HTML] = $contentHTML;
}
Example #2
0
/**
 * @param EntityBuilderHelper $entityBuilder
 * @param Entity[] $entityInstances
 * @param bool $tableHasActions [optional]
 * @param bool $appendCreateButton [optional]
 */
function buildListViewFromList($entityBuilder, $entityInstances, $tableHasActions = true, $appendCreateButton = true)
{
    $isEmpty = false;
    if (empty($entityInstances)) {
        $isEmpty = true;
        array_push($entityInstances, $entityBuilder->createEmpty());
    }
    $listViewAggregator = new ListViewAggregator($entityInstances, $tableHasActions);
    $contentHeader = $entityBuilder->getLabel();
    $contentAction = 'Lista';
    $contentHTML = $listViewAggregator->buildListHTML($isEmpty, $appendCreateButton);
    $GLOBALS[CONTENT_HEADER] = $contentHeader;
    $GLOBALS[CONTENT_ACTION] = $contentAction;
    $GLOBALS[CONTENT_HTML] = $contentHTML;
}