PHP code example of fantomx1 / view-locator

1. Go to this page and download the library: Download fantomx1/view-locator 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/ */

    

fantomx1 / view-locator example snippets

    



namespace fantomx1\toolmasterforeman\examples\ComposerAssetsInstallerTool;

use fantomx1\toolmasterforeman\ToolMasterForemanAbstract;
use fantomx1\ViewLocatorRenderTrait;

class ComposerAssetsInstallerTool extends ToolMasterForemanAbstract
{

    use ViewLocatorRenderTrait;


    /**
     *   the 
     * protected function getViewsDir()
     * {
     * return $this->getDefaultViewsDir();
     * }
     * @return string
     */
    protected function getViewsDir()
    {
        return $this->getDefaultViewsDir("./views");
    }


    public function actionIndex()
    {
        $this->render("index", ['test'=>1]);
    }

}