PHP code example of gsteel / looker

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

    

gsteel / looker example snippets


return [
    'looker' => [
        'templates' => [
            'map' => [
                'some::template' => __DIR__ . '/some/path/to/template.phtml',
            ],
        ],
    ],
];

use Looker\Model\Model;
use Looker\Renderer\Renderer;

$model = Model::new('some::template', ['variable' => 'value']);
/** @var Renderer */
$renderer->render($model);

return [
    'looker' => [
        'templates' => [
            'paths' => [
                __DIR__ . '/some-directory',
                __DIR__ . '/other-directory',
            ],
            'defaultSuffix' => 'phtml',
        ],
    ],
];

$resolver->resolve('some/template'); // __DIR__ . '/some-directory/some/template.phtml'
$resolver->resolve('something.txt'); // __DIR__ . '/some-directory/something.txt'

return [
    'looker' => [
        'templates' => [
            'aggregate' => [
                \Looker\Template\MapResolver::class,
                \Looker\Template\DirectoryResolver::class,
            ],
        ],
    ],
];