Hello Everybody, I'm Trying to Create a plugin, And stuck in ViewPublic How Can I Show List Of Posts Via ViewPublic ? Please Fix My Code class Custom_ViewPublic_Index extends XenForo_ViewPublic_Base { public function renderHtml() { $db = XenForo_Application::get('db'); $sql = $db->fetchAll("SELECT * FROM custom_item"); foreach ($sql as $item) { //What to Do } } } PHP: I Have to Show Like This <ul> <li>Title Num 1</li> <li>Title Num 2</li> <li>Title Num 3</li> </ul>
Well first of all, you shouldn't be doing queries within a view... rather you should be doing queries within your model and passing the results to your view.