How can I implement jquery in a Zend Framework application in my own way?

How can I implement jquery in my Zend Framework application in my own way.

  • Adding jquery.js ok
  • add script ok
  • send POST data to ok controller
  • process posted data ok
  • send 'AjaxContext' reply to client ok now (thanks)

I am using jquery for the first time, what am I doing wrong?

+3
source share
3 answers

, , Zend ajax , , . ContextSwitcher

AjaxContent

.

class CommentController extends Zend_Controller_Action
{
    public function init()
    {
        $ajaxContext = $this->_helper->getHelper('AjaxContext');
        $ajaxContext->addActionContext('view', 'html')
                    ->initContext();
    }

    public function viewAction()
    {
        // Pull a single comment to view.
        // When AjaxContext detected, uses the comment/view.ajax.phtml
        // view script.
    }

: , , . , .

/url/path?format=html

, . . .

+8

, $(document).ready() jQuery, DOM. javascript/parser. Firefox Tools- > Error Console. , Firebug.

+2

, , ...
ZF + JQuery.
, , php. , Jquery , php.
, , FireBug.

0

Source: https://habr.com/ru/post/1703489/


All Articles