2015-09-28 38 views
0

我正在使用社交引擎在管理面板中創建表單以在前端發佈廣告及其顯示,但是當我添加類別時,所有字段都顯示但類別不顯示如何顯示類別名字我的廣告上市..如何在社交引擎中顯示分類列表的類別名稱

This is my listing frontend... 

enter image description here

This is my form to crete ad..in frontend 

enter image description here

This is my category which is add from backend and dispaly in frontend form when you create ad then choose category ... 

enter image description here

所以,請建議我如何顯示我的類別中我的廣告上市..

回答

0

希望下面的回答將幫助你。

$categoryObject = Engine_Api::_()->getDbtable('categories', 'classified')->find($classified->category_id)->current(); 

$categoryName = $categoryObject->category_name; 

**在上面的代碼中,$ classified是Classified_Model_Classified類的對象。如果您只想使用類別名稱,則還可以優化上述代碼(只需要獲取類別名稱)。

**我假設您正在使用SocialEngine - Classified模塊,並且您沒有對SocialEngine在給定結構中做任何修改,因爲在這種情況下,下面的答案可能會導致錯誤。

相關問題