Witam,

Mam problem z odpaleniem helperów ZendX_View_Helper_JQuery np. ZendX_View_Helper_JQuery_AjaxLink. Ścieżki są poprawne.
Jeżeli ktoś zna przyczynę proszę o podpowiedź jak naprawić skrypty.

Wydaje mi się również, że ten skrypt kiedyś działał ale pod jakąś starszą wersją jQuery, nie jestem pewien czy wersja biblioteki może mieć znaczenie.

www/index.php:
  1. <?php
  2. defined('APPLICATION_NAME')
  3. || define('APPLICATION_NAME', 'Default');
  4.  
  5. defined('APPLICATION_PATH')
  6. || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/default'));
  7.  
  8. defined('ROOT_PATH')
  9. || define('ROOT_PATH', realpath(dirname(__FILE__) . '/../'));
  10.  
  11. defined('BASE_PATH')
  12. || define('BASE_PATH', realpath(dirname(__FILE__) . '/default/'));
  13.  
  14. defined('APPLICATION_ENV')
  15. || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
  16.  
  17. set_include_path(implode(PATH_SEPARATOR, array(
  18. realpath(ROOT_PATH . '/library'),
  19. //realpath(APPLICATION_PATH . '/models'),
  20. )));
  21.  
  22. require_once 'Zend/Application.php';
  23.  
  24. $application = new Zend_Application(
  25. APPLICATION_ENV,
  26. realpath(APPLICATION_PATH . '/configs/application.ini')
  27. );
  28. $application->bootstrap()
  29. ->run();


/application/default/configs/application.ini:
  1. [production]
  2. phpSettings.display_startup_errors = 0
  3. phpSettings.display_errors = 0
  4. phpSettings.date.timezone = "Europe/Warsaw"
  5.  
  6. autoloaderNamespaces[] = "Default"
  7. autoloaderNamespaces[] = "Zend"
  8. autoloaderNamespaces[] = "ZendX"
  9.  
  10. bootstrap.path = APPLICATION_PATH "/bootstrap.php"
  11.  
  12. resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
  13.  
  14. resources.layout.layoutpath = APPLICATION_PATH "/layouts/scripts"
  15. resources.layout.layout = default
  16.  
  17. resources.locale.default = "pl_PL"
  18. resources.locale.force = true
  19.  
  20. resources.Jquery.enable = true
  21. resources.Jquery.version = 1.7.2
  22. resources.Jquery.uienable = true
  23. resources.Jquery.ui_version = 1.8.18
  24. resources.Jquery.noconflictmode = false
  25.  
  26. [testing : production]
  27.  
  28. [development : testing]
  29. phpSettings.display_startup_errors = 1
  30. phpSettings.display_errors = 1


/application/default/Bootstrap.php:
  1. <?php
  2. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  3. {
  4. protected $_appNamespace = 'Default';
  5.  
  6. protected function _initView()
  7. {
  8. $view = new Zend_View();
  9. ZendX_JQuery::enableView($view);
  10. $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
  11. $viewRenderer->setView($view);
  12. Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
  13. $view->doctype('HTML5');
  14. return $view;
  15. }
  16. }


/application/default/layouts/scripts/default.phtml:
  1. <?=$this->doctype()?>
  2. <html>
  3. <head>
  4. <?=$this->headMeta()?>
  5. <?=$this->headTitle()?>
  6. <?=$this->headLink()?>
  7. <?=$this->headScript()?>
  8. <?=$this->jQuery()?>
  9. </head>
  10. <body>
  11. <div id="main_container">
  12. <?php echo $this->ajaxLink('treść linka',
  13. '/index/ajax',
  14. 'update' => '#content'
  15. ),
  16. 'param1' => 'value1',
  17. 'param2' => 'value2'
  18. )
  19. );
  20. ?><?php echo $this->datePicker('data',
  21. null,
  22. 'minDate' => 'new Date()',
  23. 'dateFormat' => 'yy-mm-dd'
  24. ),
  25. 'class' => 'some-class',
  26. 'readonly' => 'readonly'
  27. )
  28. );
  29. ?>
  30. <h1>CMS</h1>
  31. <div id="content">
  32. <?=$this->layout()->content?>
  33. </div>
  34. </div>
  35. </body>
  36. </html>


Kod HTML (źródło wygenerowanej strony):
<!DOCTYPE html><html>
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>

</head>
<body>
<div id="main_container">
<a href="#" class="ajaxLink1">treść linka</a><input type="text" name="data" id="data" value="" class="some-class" readonly="readonly"> <h1>CMS</h1>
<div id="content">
sad </div>
</div>
</body>
</html>