- Posts: 57
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
{% for oSurvey in aSurveyInfo.publicSurveys %} <li> {{ oSurvey.localizedTitle }} - {{ oSurvey.description }} </li> {% endfor %}
An exception has been thrown during the rendering of a template ("Survey and its behaviors do not have a method or closure named "description".") in "__string_template ..."
{ "publicSurveys": [ // <== this is oSurveys { "searched_value": null, "showsurveypolicynotice": "0" }, { "searched_value": null, "showsurveypolicynotice": "0" }, ... { "searched_value": null, "showsurveypolicynotice": "0" } ], "futureSurveys": , "oTemplate": { ... }
'publicSurveys' => Survey::model()->active()->open()->public()->with('languagesettings')->findAll()
public function getDescription() { $sLanguage = isset(App()->language)? App()->language: $this->language; $aSurveryInfo = getSurveyInfo($this->sid, $sLanguage); if (isset($aSurveryInfo) && isset($aSurveryInfo['description'])) return $aSurveryInfo['description']; return 'no description available'; }