mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-07 07:41:37 +01:00
32 lines
754 B
PHP
32 lines
754 B
PHP
<?php
|
|
|
|
/*
|
|
* Smarty plugin
|
|
* -------------------------------------------------------------
|
|
* File: resource.db2.php
|
|
* Type: resource
|
|
* Name: db
|
|
* Purpose: Fetches templates from a database
|
|
* -------------------------------------------------------------
|
|
*/
|
|
|
|
use Smarty\Resource\RecompiledPlugin;
|
|
use Smarty\Template;
|
|
use Smarty\Template\Source;
|
|
|
|
class Smarty_Resource_Db2 extends RecompiledPlugin
|
|
{
|
|
public function populate(Source $source, Template $_template = null)
|
|
{
|
|
$source->filepath = 'db2:';
|
|
$source->uid = sha1($source->resource);
|
|
$source->timestamp = 0;
|
|
$source->exists = true;
|
|
}
|
|
|
|
public function getContent(Source $source)
|
|
{
|
|
return '{$x="hello world"}{$x}';
|
|
}
|
|
}
|