public function renderCommand($prototypeName, $packageKey = null, $propSet = '__default', $props = '', $locales = '')
    {
        $sitePackageKey = $packageKey ?: $this->getDefaultSitePackageKey();
        $convertedProps = json_decode($props, true) ?? [];
        $convertedLocales = json_decode($locales, true) ?? [];

        $controllerContext = $this->createDummyControllerContext();

        $fusionView = new FusionView();
        $fusionView->setControllerContext($controllerContext);
        $fusionView->setPackageKey($sitePackageKey);

        $fusionRootPath = $this->configurationService->getSiteConfiguration($sitePackageKey, ['cli', 'fusionRootPath']);

        $fusionView->setPackageKey($sitePackageKey);
        $fusionView->setFusionPath($fusionRootPath);

        $fusionView->assignMultiple([
            'sitePackageKey' => $packageKey,
            'prototypeName' => $prototypeName,
            'propSet' => $propSet,
            'props' => $convertedProps,
            'locales' => $convertedLocales
        ]);

        $this->output($fusionView->render());
    }
public function renderCommand($prototypeName, $packageKey = null, $propSet = '__default', $props = '', $locales = '')
    {
        $sitePackageKey = $packageKey ?: $this->getDefaultSitePackageKey();
        $convertedProps = json_decode($props, true) ?? [];
        $convertedLocales = json_decode($locales, true) ?? [];

        $controllerContext = $this->createDummyControllerContext();

        $fusionView = new FusionView();
        $fusionView->setControllerContext($controllerContext);
        $fusionView->setPackageKey($sitePackageKey);

        $fusionRootPath = $this->configurationService->getSiteConfiguration($sitePackageKey, ['cli', 'fusionRootPath']);

        $fusionView->setPackageKey($sitePackageKey);
        $fusionView->setFusionPath($fusionRootPath);

        $fusionView->assignMultiple([
            'sitePackageKey' => $packageKey,
            'prototypeName' => $prototypeName,
            'propSet' => $propSet,
            'props' => $convertedProps,
            'locales' => $convertedLocales
        ]);

        $this->output($fusionView->render());
    }
public function renderCommand ( $ prototypeName , $ packageKey = null , $ propSet = '__default' , $ props = '' , $ locales = '' ) { $ sitePackageKey = $ packageKey ? : $ this -> getDefaultSitePackageKey ( ) ; $ convertedProps = json_decode ( $ props , true ) ?? [ ] ; $ convertedLocales = json_decode ( $ locales , true ) ?? [ ] ; $ controllerContext = $ this -> createDummyControllerContext ( ) ; $ fusionView = new FusionView ( ) ; $ fusionView -> setControllerContext ( $ controllerContext ) ; $ fusionView -> setPackageKey ( $ sitePackageKey ) ; $ fusionRootPath = $ this -> configurationService -> getSiteConfiguration ( $ sitePackageKey , [ 'cli' , 'fusionRootPath' ] ) ; $ fusionView -> setPackageKey ( $ sitePackageKey ) ; $ fusionView -> setFusionPath ( $ fusionRootPath ) ; $ fusionView -> assignMultiple ( [ 'sitePackageKey' => $ packageKey , 'prototypeName' => $ prototypeName , 'propSet' => $ propSet , 'props' => $ convertedProps , 'locales' => $ convertedLocales ] ) ; $ this -> output ( $ fusionView -> render ( ) ) ; }
Render a given fusion component to HTML

@param string $prototypeName The prototype name of the component
@param string $packageKey site-package (defaults to first found)
@param string $propSet The propSet used for the preview
@param string $props Custom props for the preview
@param string $locales Custom locales for the preview
@return void
Render a given fusion component to HTML