#!/bin/bash
# Check if $name is set
if [[ -z "${name}" ]]; then
echo "Error: Variable \$name is not set. Exiting (displaycontroller.sh)."
exit 1
fi
cat <<EOM > admin/src/Controller/DisplayController.php
<?php
namespace Harvst\\Component\\${name^}\\Administrator\\Controller;
defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\BaseController;
class DisplayController extends BaseController {
protected \$default_view = '${name}';
public function display(\$cachable = false, \$urlparams = array()) {
return parent::display(\$cachable, \$urlparams);
}
EOM