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:
<?php
|| define('APPLICATION_NAME', 'Default');
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ?
getenv('APPLICATION_ENV') : 'production'));
//realpath(APPLICATION_PATH . '/models'),
)));
require_once 'Zend/Application.php';
$application = new Zend_Application(
APPLICATION_ENV,
realpath(APPLICATION_PATH
. '/configs/application.ini') );
$application->bootstrap()
->run();
/application/default/configs/application.ini:
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
phpSettings
.date.timezone
= "Europe/Warsaw"
autoloaderNamespaces[] = "Default"
autoloaderNamespaces[] = "Zend"
autoloaderNamespaces[] = "ZendX"
bootstrap.path = APPLICATION_PATH "/bootstrap.php"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.layout.layoutpath = APPLICATION_PATH "/layouts/scripts"
resources.layout.layout = default
resources.locale.default = "pl_PL"
resources.locale.force = true
resources.Jquery.enable = true
resources.Jquery.version = 1.7.2
resources.Jquery.uienable = true
resources.Jquery.ui_version = 1.8.18
resources.Jquery.noconflictmode = false
[testing : production]
[development : testing]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
/application/default/Bootstrap.php:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected $_appNamespace = 'Default';
protected function _initView()
{
$view = new Zend_View();
ZendX_JQuery::enableView($view);
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
$view->doctype('HTML5');
return $view;
}
}
/application/default/layouts/scripts/default.phtml:
<?=$this->doctype()?>
<html>
<head>
<?=$this->headMeta()?>
<?=$this->headTitle()?>
<?=$this->headLink()?>
<?=$this->headScript()?>
<?=$this->jQuery()?>
</head>
<body>
<div id="main_container">
<?php echo $this->ajaxLink('treść linka', '/index/ajax',
'update' => '#content'
),
'param1' => 'value1',
'param2' => 'value2'
)
);
?><?php echo $this->datePicker('data', null,
'minDate' => 'new Date()',
'dateFormat' => 'yy-mm-dd'
),
'class' => 'some-class',
'readonly' => 'readonly'
)
);
?>
<h1>CMS</h1>
<div id="content">
<?=$this->layout()->content?>
</div>
</div>
</body>
</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>