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