如何在社交引擎中显示分类列表的类别名称

时间:2015-09-28 11:11:07

标签: socialengine

我正在使用社交引擎在管理面板中创建一个表单,以便在前端发布广告但是当我添加类别时,所有字段都显示不同但类别未显示如何在我的广告列表中显示类别名称..

  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

所以请建议我如何在我的广告列表中显示我的类别..

1 个答案:

答案 0 :(得分:0)

希望以下答案对您有帮助。

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

$categoryName = $categoryObject->category_name;

**在上面的代码中,$ classified是Classified_Model_Classified类的对象。如果您只想使用类别名称(还需要仅提取类别名称),还可以优化上述代码。

**我假设您正在使用SocialEngine - Classified模块,并且您没有在SocialEngine中对给定结构进行任何修改,因为在这种情况下,以下答案可能会导致错误。