PHP code example of holabs / security

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

    

holabs / security example snippets


 

use Holabs\Security\Container;
use Nette\Application\UI\Presenter;
use Nette\Application\UI\Multiplier;

/**
 * @author       Tomáš Holan <[email protected]>, D-Music s.r.o. [www.d-music.cz]
 * @package      holabs/security
 * @copyright    Copyright © 2016, D-Music s.r.o. [www.d-music.cz]
 */
class SignPresenter extends Presenter {
	
	/** @var Container @inject */
    public $container;
    
    public function renderIn(){
		$this->template->authenticators = $this->container->getAuthenticators();
	}
	
	/**
	 * @return Multiplier
	 */
	protected function createComponentLogin(){
		return new Multiplier(function($name) {

			return $this->container->getAuthenticator($name);

		});
	}
}
latte
<div n:inner-foreach="$authenticators as $name => $authenticator">
	{control $authenticator}
	{*control $authenticators-{$name}*}
</div>