<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>张文杰的博客 &#187; MVC</title>
	<atom:link href="http://zhangwenjie.net/archives/tag/mvc/feed" rel="self" type="application/rss+xml" />
	<link>http://zhangwenjie.net</link>
	<description>技术、生活博客</description>
	<lastBuildDate>Mon, 24 Oct 2011 14:23:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>也谈Zend构架与Smarty的集成配置</title>
		<link>http://zhangwenjie.net/archives/355</link>
		<comments>http://zhangwenjie.net/archives/355#comments</comments>
		<pubDate>Sun, 11 Apr 2010 12:36:30 +0000</pubDate>
		<dc:creator>zhangwenjie</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[smarty]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://zhangwenjie.net/?p=355</guid>
		<description><![CDATA[　　Zend架构是一个成熟、强大的PHP Web MVC的开发框架，而smarty是一个灵活、强大的模板引擎。如果将两者结合起来，将会使PHP的Web开发轻松不少，且上手也快。]]></description>
			<content:encoded><![CDATA[<p>　　Zend架构是一个成熟、强大的PHP Web MVC的开发框架，而smarty是一个灵活、强大的模板引擎。如果将两者结合起来，将会使PHP的Web开发轻松不少，且上手也快。</p>
<p>　　对于Zend构架与Smarty的集成配置，网上也有不少文章说到，但我自己觉得都不够完整，且并不是真正、深入集成。我这里所说的方法，是彻底的集成，程序写法是Zend本身的带的view写法是一样的。</p>
<p>　　首先说一下总体目录结构：</p>
<div id="attachment_356" class="wp-caption aligncenter" style="width: 236px"><a href="http://zhangwenjie.net/wp-content/uploads/2010/04/Zend.jpg"><img class="size-full wp-image-356" title="Zend目录结构" src="http://zhangwenjie.net/wp-content/uploads/2010/04/Zend.jpg" alt="Zend目录结构" width="226" height="154" /></a><p class="wp-caption-text">Zend目录结构</p></div>
<p>　　其中，application目录中包括config目录、controllers目录、models目录等；cache目录用于smarty缓存；compile目录用于smarty编译目录；config目录放置smarty的配置；library目录放置Zend框架库及smarty库；public目录放置引导文件及js、css、images等公共文件；template目录放置.tpl模板文件。</p>
<p>　　<strong>首先修改配置文件来支持smarty模板库(就是application/configs/application.ini文件)，</strong>添加如下内容：</p>
<p>　　</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p355code1'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3551"><td class="code" id="p355code1"><pre class="php" style="font-family:monospace;">　　smarty<span style="color: #339933;">.</span>class_path <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Smarty/Smarty.class.php&quot;</span>
　　smarty<span style="color: #339933;">.</span>left_delimiter <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&amp;lt;*&quot;</span>
　　smarty<span style="color: #339933;">.</span>right_delimiter <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;*&amp;gt;&quot;</span>
　　smarty<span style="color: #339933;">.</span>template_dir <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #0000ff;">&quot;/../template&quot;</span>
　　smarty<span style="color: #339933;">.</span>compile_dir <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #0000ff;">&quot;/../compile&quot;</span>
　　smarty<span style="color: #339933;">.</span>cache_dir <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #0000ff;">&quot;/../cache&quot;</span>
　　smarty<span style="color: #339933;">.</span>cache_lifetime <span style="color: #339933;">=</span> <span style="color: #cc66cc;">600</span>
　　smarty<span style="color: #339933;">.</span>caching <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>
　　smarty<span style="color: #339933;">.</span>config_dir <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #0000ff;">&quot;/../config&quot;</span></pre></td></tr></table></div>

<p>　　<strong>第二，创建一个模板类文件Template，里面旋转初始smarty库的内容</strong>。这个文件里的类名我写为Zend_Templater，我把它放到library/Zend/下，这样它就会被自动加载：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p355code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3552"><td class="code" id="p355code2"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>?php
<span style="color: #000000; font-weight: bold;">class</span> Zend_Templater <span style="color: #000000; font-weight: bold;">extends</span> Zend_View_Abstract
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_path</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$_engine</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
           <span style="color: #000088;">$config</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Config_Ini<span style="color: #009900;">&#40;</span>APPLICATION_PATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/configs/application.ini'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'production'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
           <span style="color: #b1b100;">require_once</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>class_path<span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Smarty<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>template_dir <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>template_dir<span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>compile_dir <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>compile_dir<span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>cache_dir <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>cache_dir<span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>cache_lifetime <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>cache_lifetime<span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>caching <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>caching<span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>left_delimiter <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>left_delimiter<span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>right_delimiter <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>right_delimiter<span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config_dir  <span style="color: #339933;">=</span> <span style="color: #000088;">$config</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>smarty<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config_dir<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getEngine<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __set<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>assign<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_template_vars<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __isset<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_template_vars<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __unset<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>clear_assign<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> assign<span style="color: #009900;">&#40;</span><span style="color: #000088;">$spec</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$spec</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>assign<span style="color: #009900;">&#40;</span><span style="color: #000088;">$spec</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>assign<span style="color: #009900;">&#40;</span><span style="color: #000088;">$spec</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> clearVars<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>clear_all_assign<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> render<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_engine<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>fetch<span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> _run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>　　其实也可以不放置到Zend目录且支持自动加载此文章，请见另一篇文章<a rel="bookmark" href="http://zhangwenjie.net/archives/352.html">让Zend框架自己加载自定义的类</a>。<br />
　　<strong>第三，修改引导文件，完成smarty与Zend的集成</strong>。修改Zend的引导文件index.php，添加支持smarty的视图类：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p355code3'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3553"><td class="code" id="p355code3"><pre class="php" style="font-family:monospace;">　　<span style="color: #000088;">$vr</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Controller_Action_Helper_ViewRenderer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　<span style="color: #000088;">$vr</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setView<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Zend_Templater<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　<span style="color: #000088;">$vr</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setViewSuffix<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tpl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
　　Zend_Controller_Action_HelperBroker<span style="color: #339933;">::</span><span style="color: #004000;">addHelper</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$vr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>　　到这里，已经完成Zend与smarty的集成。这样在controller文件中，可以如下的方式写代码：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p355code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3554"><td class="code" id="p355code4"><pre class="php" style="font-family:monospace;">　　<span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>view<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>name <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Zend与smarty的集成'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>　　然后在你的tpl文件中，像如下的方式访问设置的变量：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p355code5'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3555"><td class="code" id="p355code5"><pre class="php" style="font-family:monospace;">　　<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;*</span><span style="color: #b1b100;">if</span> <span style="color: #000088;">$name</span><span style="color: #339933;">*&amp;</span>gt<span style="color: #339933;">;</span>
     <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;*</span><span style="color: #000088;">$name</span><span style="color: #339933;">*&amp;</span>gt<span style="color: #339933;">;</span>
　　<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;*/</span><span style="color: #b1b100;">if</span><span style="color: #339933;">*&amp;</span>gt<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>　　</p>
<p>　　原创文章如转载，请注明：转载自<a title="张文杰的博客" href="http://zhangwenjie.net/">张文杰的博客</a> [ <a title="张文杰的博客" href="http://zhangwenjie.net/">http://zhangwenjie.net</a> ]<br />
　　本文链接地址：<a href="http://zhangwenjie.net/archives/355.html">http://zhangwenjie.net/archives/355.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zhangwenjie.net/archives/355/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>微软宣布Visual Studio 2010正式版发布日期</title>
		<link>http://zhangwenjie.net/archives/65</link>
		<comments>http://zhangwenjie.net/archives/65#comments</comments>
		<pubDate>Mon, 19 Oct 2009 08:52:10 +0000</pubDate>
		<dc:creator>zhangwenjie</dc:creator>
				<category><![CDATA[互联网]]></category>
		<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[MSDN]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[微软]]></category>

		<guid isPermaLink="false">http://zhangwenjie.net/?p=65</guid>
		<description><![CDATA[早在今年5月份微软就发布了Visual Studio 2010和.NET Framework 4.0的首个Beta测试版，今天微软宣布已经为MSDN订阅用户提供了VS 2010的第二个Beta版，普通用户将在10月21日获取免费下载...]]></description>
			<content:encoded><![CDATA[<p>早在今年5月份微软就发布了Visual Studio 2010和.NET Framework 4.0的首个Beta测试版，今天微软宣布已经为MSDN订阅用户提供了VS 2010的第二个Beta版，普通用户将在<strong>10月21日</strong>获取免费下载。</p>
<p>此外，微软还宣布了Visual Studio 2010的官方正式发布日期，定在<strong>2010年3月22日</strong>，并且表示这将是近几年来Visual Studio和.NET Framework最重要的一次版本升级，新增功能包括Windows 7和SharePoint 2010工具以及对并行编程的支持等。</p>
<p>VS2010开发代号“Rosario”(阿根廷港市罗萨里奥)，除了上述功能外还在以下方面进行了改进：</p>
<ol>
<li>完善了Visual Studio IDE；</li>
<li>Visual Basic和C#语言：在Visual Studio 2010中，VB和C#语言的演变是对等的，开发人员可以根据自己的爱好选择任意一种语言；</li>
<li>Visual Studio 2010包括一种新的.NET Framework语言：F#；</li>
<li>Web开发：VS 2010改进了代码编写的速度，简化了Web开发，还支持基于MVC的Web应用等；</li>
<li>WPF和Silverlight：改进了对WPF和Silverlight应用程序的开发；</li>
<li>完善了Visual C++功能。</li>
</ol>
<p>VS2010的截图如下：</p>
<div class="wp-caption aligncenter" style="width: 510px"><img class=" " title="Visual Studio 2010外观截图" src="http://img2.zol.com.cn/product/28_500x2000/878/ce2jL5wFm2n8s.jpg" alt="VS2010" width="500" height="400" /><p class="wp-caption-text">Visual Studio 2010外观截图</p></div>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Visual Studio 2010外观截图" src="http://img2.zol.com.cn/product/28_500x2000/879/ce4UiZuRkuOL2.jpg" alt="Visual Studio 2010外观截图" width="500" height="354" /><p class="wp-caption-text">Visual Studio 2010外观截图</p></div>
<p>官方下载Visual Studio 2010 Beta 1：<br />
<a style="color: #0000ff; text-decoration: underline;" href="http://blogs.msdn.com/onoj/archive/2009/05/19/visual-studio-2010-beta-1-download-options.aspx" target="_blank">http://blogs.msdn.com/onoj/archive/2009/05/19/visual-studio-2010-beta-1-download-options.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zhangwenjie.net/archives/65/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

