0
- 我添加了ZendX庫。
- 添加在控制器中的幫手:
public function init() { $this->view->addHelperPath( 'ZendX/JQuery/View/Helper' ,'ZendX_JQuery_View_Helper'); }
- 用於創建視圖頁面的表單:
public function indexAction() { // Filter form $this->view->autocompleteElement = new ZendX_JQuery_Form_Element_AutoComplete('txtLocation'); $this->view->autocompleteElement->setAttrib('placeholder', 'Search Location'); $this->view->autocompleteElement->setJQueryParam('data', array('Manila', 'Pasay', 'Mandaluyong', 'Pasig', 'Marikina','Makati')); }
- 加載jQuery和表單查看頁面。
<?php echo $this->jQuery(); ?> <form> <?php echo $this->autocompleteElement; ?> </form>
形式是在視圖頁面可見。但自動完成功能無效。我什至沒有看到源頁面中的任何jQuery腳本。我錯過了什麼嗎?ZendX jQuery自動完成不在框架中工作