Exemplo n.º 1
0
        }
        $vars = array();
        foreach ($tag['attributes'] as $key => $value) {
            if (isset($setup['map'][$key])) {
                $key = $setup['map'][$key];
            }
            $vars[$key] = $value;
        }
        extract($vars, EXTR_SKIP);
        ob_start();
        include $path;
        return ob_get_clean();
    }
}
// Lets change the template path and the file extension.
$engine = new TestEngine();
$engine->setPath(__DIR__ . '/templates/');
$code = new \mjohnson\decoda\Decoda();
$code->addFilter(new \mjohnson\decoda\filters\QuoteFilter());
$code->setEngine($engine);
?>

<h2>Test Rendering</h2>

<p>Uses a different template engine, with a separate templates folder and a different file extension.</p>

<br>

<?php 
$string = '[quote]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque non sapien a eros tincidunt accumsan. Ut nisl dui, dignissim at posuere quis, facilisis eget lectus. Morbi vitae massa eu metus pharetra rhoncus. Suspendisse potenti. Phasellus laoreet dapibus dapibus. Duis faucibus lacinia diam, nec pharetra est pharetra vitae. Etiam sodales, nulla et ullamcorper mattis, augue nunc sollicitudin risus, nec imperdiet est leo vitae est. Integer ultricies, metus at scelerisque interdum, sapien lorem mollis orci, vel mattis felis augue vitae nunc. Fusce eget sem sed orci interdum commodo sit amet et metus. In ultricies feugiat eleifend. Aliquam erat volutpat.
	[quote="Miles"]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque non sapien a eros tincidunt accumsan. Ut nisl dui, dignissim at posuere quis, facilisis eget lectus. Morbi vitae massa eu metus pharetra rhoncus. Suspendisse potenti. Phasellus laoreet dapibus dapibus. Duis faucibus lacinia diam, nec pharetra est pharetra vitae. Etiam sodales, nulla et ullamcorper mattis, augue nunc sollicitudin risus, nec imperdiet est leo vitae est. Integer ultricies, metus at scelerisque interdum, sapien lorem mollis orci, vel mattis felis augue vitae nunc. Fusce eget sem sed orci interdum commodo sit amet et metus. In ultricies feugiat eleifend. Aliquam erat volutpat.[/quote]
<?php

require_once realpath(dirname(__FILE__) . '/../../../TestEngine.class.php');
//set_time_limit(60);
TestEngine::createDatabaseSchema('rest_test');
$url = 'http://localhost:9080/webitems/REST/rest_test';
$testEngine = new TestEngine('rest_test', $url, array('user' => 'Rob'));
$testEngine->executeDatabaseScript(file_get_contents('create_tables-rest_test.sql'));
$fillDatabaseScript = file_get_contents('fill_db-rest_test.sql');
require 'testCreate.php';
echo $output;
require 'testUpdate.php';
echo $output;
//require 'testDelete.php';
//echo $output;