Библиотека для cis, online, cms1
This commit is contained in:
commit
3c2e614d87
269 changed files with 39854 additions and 0 deletions
36
core/tales.php
Normal file
36
core/tales.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Ðàñøèðåíèÿ äëÿ PHPTAL äëÿ îòîáðàæåíèÿ âðåìåíè è äàòû
|
||||
* package utils
|
||||
*/
|
||||
class DateTime_Tales implements PHPTAL_Tales
|
||||
{
|
||||
static public function date ($expression, $nothrow = false)
|
||||
{
|
||||
return "phptal_date(".PHPTAL_TalesInternal::path ($expression).")";
|
||||
}
|
||||
|
||||
static public function time ($expression, $nothrow = false)
|
||||
{
|
||||
return "phptal_time(".PHPTAL_TalesInternal::path ($expression).")";
|
||||
}
|
||||
}
|
||||
|
||||
/* Ðåãèñòðàöèÿ íîâîãî ïðåôèêñà äëÿ ïîäêëþ÷åíèÿ êîìïîíåíòà */
|
||||
$registry = PHPTAL_TalesRegistry::getInstance();
|
||||
$registry->registerPrefix('date', array('DateTime_Tales', 'date'));
|
||||
$registry->registerPrefix('time', array('DateTime_Tales', 'time'));
|
||||
|
||||
|
||||
function phptal_date ($e)
|
||||
{
|
||||
return date ("d.m.Y", $e);
|
||||
}
|
||||
|
||||
function phptal_time ($e)
|
||||
{
|
||||
return date ("H:i", $e);
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue