Show Action Show View

<?php

    namespace Showcase\Action\Demo\Services;

    use ObjectivePHP\Application\Action\RenderableAction;
    use ObjectivePHP\Application\ApplicationInterface;
    use ObjectivePHP\Application\Workflow\Event\WorkflowEvent;

    /**
     * Class Definitions
     *
     * @package Showcase\Action\Demo\Services
     */
    class Definitions extends RenderableAction
    {
        /**
         * @param WorkflowEvent $event
         *
         * @return array
         */
        public function run(ApplicationInterface $app)
        {

            $services = $this->getServicesFactory()->getServices();

            return [
                'services' => $services
            ];
        }

    }
<?php

    use ObjectivePHP\Application\View\Helper\Vars;
    use ObjectivePHP\ServicesFactory\Specs\ClassServiceSpecs;
    use ObjectivePHP\ServicesFactory\Specs\PrefabServiceSpecs;


    Vars::set('page.title', 'Services definitions');
    Vars::set('page.subtitle', 'Show declared services list');


    echo '<dl>';
    foreach(Vars::get('services') as $serviceSpec)
    {

        if($serviceSpec instanceof PrefabServiceSpecs)
        {
            if(is_object($serviceSpec->getInstance()))
            {
                $type = 'Object of ' . get_class($serviceSpec->getInstance());
            }
            else $type = gettype($serviceSpec->getInstance());
        }
        elseif($serviceSpec instanceof ClassServiceSpecs)
        {
            $type = 'Object of ' . $serviceSpec->getClass();
        }

        echo '<dt>' . $serviceSpec->getId() . ' </dt>';
        echo '<dd>' . $type . '</dd>';
    }
    echo '</dl>';
application
Object of Showcase\Application
config
Object of ObjectivePHP\Config\Config
events-handler
Object of ObjectivePHP\Events\EventsHandler
service.human-resources
Object of Showcase\Service\HumanResources
gateway.human-resources
Object of Showcase\Gateway\HumanResourcesGateway
action.demo.doctrine.entity-parameter
Object of Showcase\Action\Demo\Doctrine\EntityParameter