Exemple #1
0
<?php

use Pronto\ShortcodeContainer;
use Pronto\ConfigContainer;
use Pronto\GlobalContainer;
use Pronto\HelperContainer;
ShortcodeContainer::add('image', function ($attributes) {
    $page = GlobalContainer::get('page');
    $image = array_shift($attributes);
    if (HelperContainer::relative($image)) {
        $image = $page->folder() . $image;
    }
    $defaults = array('alt' => '');
    $options = array_merge($defaults, $attributes);
    $xhtml = ConfigContainer::get('xtml') ? ' /' : '';
    if (isset($options['url'])) {
        $url = $options['url'];
        if (HelperContainer::relative($url)) {
            $url = $page->folder() . $url;
        }
        return '<img src="' . $image . '" alt=""' . $xhtml . '>';
    }
    return '<img src="' . $image . '" alt=""' . $xhtml . '>';
});
Exemple #2
0
<?php

/*
 * This file is part of the PRONTO core.
 *
 * (c) Thomas Rasshofer <*****@*****.**>
 *
 * For the full copyright and license information, please view http://prontocms.com/license.
 */
use Pronto\ConfigContainer;
/**
 * Custom configuration
 */
ConfigContainer::set('home', 'home');
ConfigContainer::set('error', 'error');