pedro151/zendx

v1.0 2016-05-14 03:49 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:58:41 UTC


README

安装

$ composer require pedro151/zendx

设置在 public\index.php

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../vendor/zendframework/zendframework1/library'),
    realpath(APPLICATION_PATH . '/../vendor/pedro151/zendx/library'),
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

配置

设置在 application/configs/application.ini

;CONFIG ZENDX
resources.view.helperPath.ZendX_JQuery_View_Helper = APPLICATION_PATH "/../ZendX/JQuery/View/Helper"

application/Bootstrap.php

$view->addHelperPath ( "ZendX/JQuery/View/Helper" , "ZendX_JQuery_View_Helper" );

启用

Bootstrap.php 文件中进行设置

public function _initJQuery ()
{
    $this->_bootstrap ( 'FrontController' );
    $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper ( 'viewRenderer' );
    if ( null === $viewRenderer->view )
    {
        $viewRenderer->initView ();
    }
    $view = $viewRenderer->view;

    /* Initialize action controller here */
    $view->jQuery ()
         ->uiDisable ()
         ->enable ();
}