存档

文章标签 ‘zend’

zend studio 7.0 beta 注册码、注册机,序列号

2009年7月30日 Jansfer 1 条评论

前些时候试用了一下zend studio 7.0,但因为没有注册码后来就不能用了。今天终于找到一个注册码了
jansfer
307076195D2D40756195D2D4

在zend studio 7.0 beta build 20090621上试用通过。

jQueryWTP一款让Eclipse支持jQuery的插件

2008年12月19日 Jansfer 没有评论

Eclipse的WTP支持Javascript的代码补全功能
但是很简单,而且不支持jQuery
jQueryWTP的目的就是让Eclipse WTP支持jQuery

需要说明的是该插件对于MyEclipse等基于Eclipse WTP的工具也是支持的
项目主页是
http://www.langtags.com/jquerywtp/index.html

==========

Installations
step1:download jqueryWTP_version.jar
step2:find you Eclipse Plugin org.eclipse.wst.javascript.ui_xxxxxxx.jar,backup the plugin.
step3:double click the jar file or run with command java -jar jqueryWTP.version.jar
step4:on the opened swing UI,choose org.eclipse.wst.javascript.ui_xxxxxxx.jar,and output dir.
step5:click generate button.
step6:replace old org.eclipse.wst.javascript.ui_xxxxxxx.jar file with the generated file.
step7:restart eclipse.
step8:open a html file,edit js content.


============
Zend Studio for Eclipse 6也是可以用滴

jqueryWTP0.2forJQuery1.2.6.rar

分类: 随笔 标签: , ,

zend framework 1.6发布

2008年9月4日 Jansfer 没有评论

Zend Framework 1.6于今天发布,可以在其官网下载 http://framework.zend.com/download/current/

该版本包括了一系列的新工具:

Zend_Tool
Lucene 2.3 Index File Format Support
Zend_Session save handler for Database Tables
Paginator Component
Figlet Support
ReCaptcha Service
Captcha Form Element
Zend_Config_Xml Attribute Support
Zend_File_Transfer Component
File Upload Form Element
Zend_Wildfire Component with FireBug Log Writer

与新版同时发布的还有Zend Framework文档的PDF版本,也可以在其官网找到 http://www.zend.com/community/downloads

分类: 随笔 标签: ,

AJAX in Zend Framework

2008年4月17日 Jansfer 没有评论

Zend Framework 1.5 已经对 AJAX 有了不错的支持,使用上也很简单。主要涉及到的类是 Zend_Controller_Action_Helper_AjaxContext,这个类中的方法 initContext() 中通过判断 XHR 头来确定是否是 AJAX 调用:

<?php
/**
 * Initialize AJAX context switching
 *
 * Checks for XHR requests; if detected, attempts to perform context switch.
 * 
 * @param  string $format 
 * @return void
 */
public function initContext($format null)
{
    
$this->_currentContext null;

    if (!$this->getRequest()->isXmlHttpRequest()) {
        return;
    }

    return parent::initContext($format);
}
?>

可以使用 ZF 默认的目录部署来写一个简单示例,目录结构如下:

application/
    controllers/
        IndexController.php
    models/
    views/
        scripts/
            index/
                index.phtml
                demo.ajax.phtml
        helpers/
        filters/
html/
    .htaccess
    index.php
    js/
        jquery.js

JavaScript 库使用 jQuery。需要写代码的文件是 IndexController.php、index.phtml 和 demo.ajax.phtml。IndexController.php 包含了 2 个 actions,一个是 index,一个是 demo。index 中有个按钮用于测试 AJAX 请求,而请求的目标则是 demo action。demo 对应的视图名字后缀使用了 .ajax.phtml,这是默认的设置。Front controller 的调用很简单:


<?php
require_once \’Zend/Controller/Front.php\’;
Zend_Controller_Front::getInstance()
    ->
setParam(\’useDefaultControllerAlways\’true)
    ->
setControllerDirectory(\’../application/controllers\’)
    ->
dispatch();
?>

IndexController.php 在初始化的时候,需要初始化 AjaxContext Helper:


<?php
class IndexController extends Zend_Controller_Action
{
    public function 
init()
    {
        
$ajaxContext $this->_helper->getHelper(\’AjaxContext\’);
        
$ajaxContext->addActionContext(\’demo\’\’html\’)                     ->initContext();
    }
    
    public function 
indexAction()
    {
    }
    
    public function 
demoAction()
    {
        
$this->view->hello \’Hello, world! (\’.date(\’H:i:s\’).\’)\’;
    }
}

addActionContext(\’demo\’, \’html\’) 表明 demoAction 为 AJAX 调用的 action,格式为 html。除了 html 之外,还支持 xml、json 等。AJAX 请求时需要给请求的 url 加上 format=html 的 GET 参数。indexAction 对应的视图 index.phtml 代码如下:


<html>
<head>
<title>AJAX DEMO</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="<?=$this->url()?>js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $(\’#ajax_button\’).click(function(){ //#ajax_button 的 onclick 事件触发
        var url = \’<?=$this->url(array(\’controller\’=>\’index\’,\’action\’=>\’demo\’))?>\’; //AJAX 请求的目标 URL
        $.get(url, {\’format\’:\’html\’}, function(data){ //这里传递了 format=html 的 GET 参数
            $(\’#hello_message\’).html(data); //将 AJAX 返回的内容显示在 #hello_message 里边
        });
    });
});
</script>
</head>

<body>
<p><input type="button" id="ajax_button" value="AJAX Call" />
<p id="hello_message"><p>
</body>

</html>

demoAction 对应的视图 demo.ajax.phtml 内容很简单,只是输出 $hello:


<?=$this->hello?>

Zend Framework 还提供了 autocomplete(自动完成)AJAX 的 action helper:Zend_Controller_Action_Helper_AutoCompleteScriptaculousZend_Controller_Action_Helper_AutoCompleteDojo,一个是 for Scriptaculous 的,另一个是 for Dojo 的。

分类: 随笔 标签: , ,

Zend Framework 中文手册

2008年4月10日 Jansfer 没有评论
分类: 随笔 标签: , , , ,