我已经写了一个类,它完全符合你对我自己的cms的要求。我已经为你上传了src,尽管我从未发布它,但它的源代码是在BSD样式许可下发布的。 Custom Tags
它基本上可以让你做你想要的东西。在这个类中有一些自定义标签的例子,所以我不会在这里粘贴代码。让我知道你怎么去。
编辑1:请求的示例代码。 :-)
编辑2:我应该添加它支持埋藏的自定义标签。
编辑3:它还支持在线模板和标记替换,即
This is an in line template.
This is a #{tag} that can be accessed by the callback function
PHP/HTML:使用example.php
$current_dir = dirname(__FILE__).DIRECTORY_SEPARATOR;
require_once dirname($current_dir).DIRECTORY_SEPARATOR.'customtags.php';
$ct = new CustomTags(array(
'parse_on_shutdown' => true,
'tag_directory' => $current_dir.'tags'.DIRECTORY_SEPARATOR,
'sniff_for_buried_tags' => true
));
?>/p>
"http://www.w3.org/TR/html4/strict.dtd">
untitled自定义标签的PHP函数:标签/youtube/tag.php:
function ct_youtube($tag)
{
return '';
}
输出:
/p>
"http://www.w3.org/TR/html4/strict.dtd">
untitled