mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-08 16:21:39 +01:00
30 lines
753 B
PHP
30 lines
753 B
PHP
<?php
|
|
|
|
/*
|
|
* Smarty plugin
|
|
* -------------------------------------------------------------
|
|
* File: resource.db.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_Db extends RecompiledPlugin {
|
|
|
|
public function populate(Source $source, Template $_template = null) {
|
|
$source->filepath = 'db:';
|
|
$source->uid = sha1($source->resource);
|
|
$source->timestamp = 1000000000;
|
|
$source->exists = true;
|
|
}
|
|
|
|
public function getContent(Source $source) {
|
|
return '{$x="hello world"}{$x}';
|
|
}
|
|
}
|