0
我的帖子有正文,在這個文本我把短代碼像[gallery = 2],現在我可以找到2個參數在我的文本(畫廊和2)我想動態調用在我看來,一個函數(畫廊),並且調用元素(圖庫ID = 2)所示:Cakephp短代碼動態調用函數和元素
應用程序/視圖/職位/ index.ctp
findshortcode($posts[Post][Body]); // this function find short code and call his name like gallery(2)
//my problem is :
function gallery($id = null){
$this->element('gallery', array('galleryid' => $id), array('plugin' => 'gallerys'));
}
thaks了很多,我想你的回答是真實的,我在MVC方式的編程邏輯中犯了錯誤。 – ali786