我正在嘗試製作簡單的自定義標籤以允許在我的應用上使用自定義模板。但我無法弄清楚如何解析和替換標籤。使用PHP解析自定義標籤
(實施例)
<div class="blog">
<module display="posts" limit="10" show="excerpt" />
</div>
<div class="sidebar">
<module display="users" limit="5" />
<module display="comment" limit="10" />
</div>
每個發現模塊標籤,我想運行與參數(在標籤中作爲屬性中列出)的模塊創建功能。並將模塊標籤替換爲從該函數返回的實際HTML塊。
認真嗎?爲什麼使用正則表達式時,它比內置的XML函數慢得多。 – icco 2009-07-29 23:05:05