PHP code example of kumwe / portal-contract

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

    

kumwe / portal-contract example snippets




umwe\Access\Capability;
use Kumwe\Contribution\ContributionOwner;
use Kumwe\Portal\Contract\PortalContributionAdmission;
use Kumwe\Portal\Contract\PortalTemplateDefinition;

$template = new PortalTemplateDefinition('acme.editor.index', 'editor/index.twig');
$admission = new PortalContributionAdmission(
    ContributionOwner::extension('acme/editor'),
    $template,
    Capability::fromString('acme.editor.read'),
);
assert($admission->exposed === false);