PHP code example of ldrahnik / theme-keeper

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

    

ldrahnik / theme-keeper example snippets


	/**
	* @var \ThemeKeeper\ThemeKeeper 
	* @inject 
	*/
	private $themes;
	
	public function __construct(ThemeKeeper\ThemeKeeper $themes)
    {
		$this->themes = $themes;
    }
    
    public function render()
    {
    	$this->template->setFile($this->themes->getView($this->name, 'controls'));
		$this->template->render();
		// you can cast getView without getTheme('default') because default name is automatically default
		// theme for short use as that, if is not set up name 'default', is choosen first theme in order
    }