PHP code example of hipnaba / indigo-view

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

    

hipnaba / indigo-view example snippets



$content = <<< EOS
Line 1
EOS;

$content1 = <<< EOS
Line 1.1
Line 1.2
EOS;

echo '<div>' . PHP_EOL 
        . ($this->indent($content)) . PHP_EOL
            . ($this->indent($content1, 2)) . PHP_EOL
    . '</div>';


class RenderableObject implements \Indigo\View\HelperPluginAwareInterface
{
    public function getHelperPlugin()
     {
        return function ($object) {
            return '<h1>' . get_class($object) . '</h1>';
        };
    }
}

$object = new RenderableObject();

echo $this->renderObject($object);


class RenderableObject implements \Indigo\View\HelperPluginAwareInterface
{
    public function getHelperPlugin() 
    {
        return 'pluginName';
    }
}