• \n

    This is an example.<\/p>\n<\/body>\n<\/html>\n\n<\/pre>\n\n

    現(xiàn)在,如果你訪問(wèn)自己網(wǎng)站的根資源,你會(huì)看到example.php的內(nèi)容。這仍沒(méi)什么用,但你要清楚你要在以一種結(jié)構(gòu)和組織非常清楚的方式在開(kāi)發(fā)網(wǎng)絡(luò)應(yīng)用。<\/p>\n

    為了讓Zend_View的應(yīng)用更清楚一點(diǎn),,修改你的模板(example.php)包含以下內(nèi)容:<\/p>\n\n

    \n\n\n  <?php echo $this->escape($this->title); ?><\/title>\n<\/head>\n<body>
    <h1><a href="http://www.miracleart.cn/">国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂</a></h1>\n  <?php echo $this->escape($this->body); ?>\n<\/body>\n<\/html>\n\n<\/pre>\n\n<p>現(xiàn)在已經(jīng)添加了兩個(gè)功能。$this->escape()類方法用于所有的輸出。即使你自己創(chuàng)建輸出,就像這個(gè)例子一樣。避開(kāi)所有輸出也是一個(gè)很好的習(xí)慣,它可以在默認(rèn)情況下幫助你防止跨站腳本攻擊(XSS)。<\/p>\n<p>$this->title和$this->body屬性用來(lái)展示動(dòng)態(tài)數(shù)據(jù)。這些也可以在controller中定義,所以我們修改IndexController.php以指定它們:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nZend::loadClass('Zend_Controller_Action');\nZend::loadClass('Zend_View');\nclass IndexController extends Zend_Controller_Action \n{\n  public function indexAction()\n  {\n    $view = new Zend_View();\n    $view->setScriptPath('\/path\/to\/views');\n    $view->title = 'Dynamic Title';\n    $view->body = 'This is a dynamic body.';\n    echo $view->render('example.php');\n  }\n  public function noRouteAction()\n  {\n    $this->_redirect('\/');\n  }\n}\n?>\n\n<\/pre>\n\n<p>現(xiàn)在你再次訪問(wèn)根目錄,應(yīng)該就可以看到模板所使用的這些值了。因?yàn)槟阍谀0逯惺褂玫?this就是在Zend_View范圍內(nèi)所執(zhí)行的實(shí)例。<\/p>\n<p>要記住example.php只是一個(gè)普通的PHP腳本,所以你完全可以做你想做的。只是應(yīng)努力只在要求顯示數(shù)據(jù)時(shí)才使用模板。你的controller (controller分發(fā)的模塊)應(yīng)處理你全部的業(yè)務(wù)邏輯。<\/p>\n<p>在繼續(xù)之前,我想做最后一個(gè)關(guān)于Zend_View的提示。在controller的每個(gè)類方法內(nèi)初始化$view對(duì)象需要額外輸入一些內(nèi)容,而我們的主要目標(biāo)是讓快速開(kāi)發(fā)網(wǎng)絡(luò)應(yīng)用更簡(jiǎn)單。如果所有模板都放在一個(gè)目錄下,是否要在每個(gè)例子中都調(diào)用setScriptPath()也存在爭(zhēng)議。<\/p>\n<p>幸運(yùn)的是,Zend類包含了一個(gè)寄存器來(lái)幫助減少工作量。你可以用register()方法把你的$view對(duì)象存儲(chǔ)在寄存器:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nZend::register('view', $view);\n?>\n\n<\/pre>\n\n<p>用registry()方法進(jìn)行檢索:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\n$view = Zend::registry('view');\n?>\n\n<\/pre>\n\n<p>基于這點(diǎn),本教程使用寄存器。 <\/p>\n<p><strong>Zend_InputFilter<\/strong><\/p>\n<p>本教程討論的最后一個(gè)組件是Zend_InputFilter。這個(gè)類提供了一種簡(jiǎn)單而有效的輸入過(guò)濾方法。你可以通過(guò)提供一組待過(guò)濾數(shù)據(jù)來(lái)進(jìn)行初始化。<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\n$filterPost = new Zend_InputFilter($_POST);\n?>\n\n<\/pre>\n\n<p>這會(huì)將($_POST)設(shè)置為NULL,所以就不能直接進(jìn)入了。Zend_InputFilter提供了一個(gè)簡(jiǎn)單、集中的根據(jù)特定規(guī)則過(guò)濾數(shù)據(jù)的類方法集。例如,你可以用getAlpha()來(lái)獲取$_POST['name']中的字母:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\n\/* $_POST['name'] = 'John123Doe'; *\/\n$filterPost = new Zend_InputFilter($_POST);\n\/* $_POST = NULL; *\/\n$alphaName = $filterPost->getAlpha('name');\n\/* $alphaName = 'JohnDoe'; *\/\n?>\n\n<\/pre>\n\n<p>每一個(gè)類方法的參數(shù)都是對(duì)應(yīng)要過(guò)濾的元素的關(guān)鍵詞。對(duì)象(例子中的$filterPost)可以保護(hù)數(shù)據(jù)不被篡改,并能更好地控制對(duì)數(shù)據(jù)的操作及一致性。因此,當(dāng)你操縱輸入數(shù)據(jù),應(yīng)始終使用Zend_InputFilter。<\/p>\n<p>提示:Zend_Filter提供與Zend_InputFilter方法一樣的靜態(tài)方法。<\/p>\n<p><strong>構(gòu)建新聞管理系統(tǒng)<\/strong><\/p>\n<p>雖然預(yù)覽版提供了許多組件(甚至許多已經(jīng)被開(kāi)發(fā)),我們已經(jīng)討論了構(gòu)建一個(gè)簡(jiǎn)單程序所需要的全部組件。在這里,你會(huì)對(duì)ZF的基本結(jié)構(gòu)和設(shè)計(jì)有更清楚的理解。<\/p>\n<p>每個(gè)人開(kāi)發(fā)的程序都會(huì)有所不同,而Zend Framework試圖包容這些差異。同樣,這個(gè)教程是根據(jù)我的喜好寫的,請(qǐng)根據(jù)自己的偏好自行調(diào)整。<\/p>\n<p>當(dāng)我開(kāi)發(fā)程序時(shí),我會(huì)先做界面。這并不意味著我把時(shí)間都花在標(biāo)簽、樣式表和圖片上,而是我從一個(gè)用戶的角度去考慮問(wèn)題。因此我把程序看成是頁(yè)面的集合,每一頁(yè)都是一個(gè)獨(dú)立的網(wǎng)址。這個(gè)新聞系統(tǒng)就是由以下網(wǎng)址組成的:<\/p>\n<p><span style=\"color: #0000ff\">\/<br \/>\n\/add\/news<br \/>\n\/add\/comment<br \/>\n\/admin<br \/>\n\/admin\/approve<br \/>\n\/view\/{id}<\/span><\/p>\n<p>你可以直接把這些網(wǎng)址和controller聯(lián)系起來(lái)。IndexController列出新聞,AddController添加新聞和評(píng)論,AdminController處理一些如批準(zhǔn)新聞之類的管理,ViewController特定新聞和對(duì)應(yīng)評(píng)論的顯示。<\/p>\n<p>如果你的FooController.php還在,把它刪除。修改IndexController.php,為業(yè)務(wù)邏輯以添加相應(yīng)的action和一些注釋:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nZend::loadClass('Zend_Controller_Action');\nclass IndexController extends Zend_Controller_Action \n{\n  public function indexAction()\n  {\n    \/* List the news. *\/\n  }\n  public function noRouteAction()\n  {\n    $this->_redirect('\/');\n  }\n}\n?>\n\n<\/pre>\n\n<p>接下來(lái),創(chuàng)建AddController.php文件:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nZend::loadClass('Zend_Controller_Action');\nclass AddController extends Zend_Controller_Action\n{\n  function indexAction()\n  {\n    $this->_redirect('\/');\n  }\n  function commentAction()\n  {\n    \/* Add a comment. *\/\n  }\n  function newsAction()\n  {\n    \/* Add news. *\/\n  }\n  function __call($action, $arguments)\n  {\n    $this->_redirect('\/');\n  }\n}\n?>\n\n<\/pre>\n\n<p>記住AddController的indexAction()方法不能調(diào)用。當(dāng)訪問(wèn)\/add時(shí)會(huì)執(zhí)行這個(gè)類方法。因?yàn)橛脩艨梢允止ぴL問(wèn)這個(gè)網(wǎng)址,這是有可能的,所以你要把用戶重定向到主頁(yè)、顯示錯(cuò)誤或你認(rèn)為合適的行為。<\/p>\n<p>接下來(lái),創(chuàng)建AdminController.php文件:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nZend::loadClass('Zend_Controller_Action');\nclass AdminController extends Zend_Controller_Action\n{\n  function indexAction()\n  {\n    \/* Display admin interface. *\/\n  }\n  function approveAction()\n  {\n    \/* Approve news. *\/\n  }\n  function __call($action, $arguments)\n  {\n    $this->_redirect('\/');\n  }\n}\n?>\n\n<\/pre>\n\n<p>最后,創(chuàng)建ViewController.php文件:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nZend::loadClass('Zend_Controller_Action');\nclass ViewController extends Zend_Controller_Action\n{\n  function indexAction()\n  {\n    $this->_redirect('\/');\n  }\n  function __call($id, $arguments)\n  {\n    \/* Display news and comments for $id. *\/\n  }\n}\n?>\n\n<\/pre>\n\n<p>和AddController一樣,index()方法不能調(diào)用,所以你可以使用你認(rèn)為合適的action。ViewController和其它的有點(diǎn)不同,因?yàn)槟悴恢朗裁床攀怯行У腶ction。為了支持像\/view\/23這樣的網(wǎng)址,你要使用__call()來(lái)支持動(dòng)態(tài)action。<\/p>\n<p><strong>數(shù)據(jù)庫(kù)操作<\/strong><\/p>\n<p>因?yàn)閆end Framework的數(shù)據(jù)庫(kù)組件還不穩(wěn)定,而我希望這個(gè)演示可以做得簡(jiǎn)單一點(diǎn)。我使用了一個(gè)簡(jiǎn)單的類,用SQLite進(jìn)行新聞條目和評(píng)論的存儲(chǔ)和查詢。<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nclass Database\n{\n  private $_db;\n  public function __construct($filename)\n  {\n    $this->_db = new SQLiteDatabase($filename);\n  }\n  public function addComment($name, $comment, $newsId)\n  {\n    $name = sqlite_escape_string($name);\n    $comment = sqlite_escape_string($comment);\n    $newsId = sqlite_escape_string($newsId);\n    $sql = \"INSERT\n        INTO  comments (name, comment, newsId)\n        VALUES ('$name', '$comment', '$newsId')\";\n    return $this->_db->query($sql);\n  }\n  public function addNews($title, $content)\n  {\n    $title = sqlite_escape_string($title);\n    $content = sqlite_escape_string($content);\n    $sql = \"INSERT\n        INTO  news (title, content)\n        VALUES ('$title', '$content')\";\n    return $this->_db->query($sql);\n  }\n  public function approveNews($ids)\n  {\n    foreach ($ids as $id) {\n      $id = sqlite_escape_string($id);\n      $sql = \"UPDATE news\n          SET  approval = 'T'\n          WHERE id = '$id'\";\n      if (!$this->_db->query($sql)) {\n        return FALSE;\n      }\n    }\n    return TRUE;\n  }\n  public function getComments($newsId)\n  {\n    $newsId = sqlite_escape_string($newsId);\n    $sql = \"SELECT name, comment\n        FROM  comments\n        WHERE newsId = '$newsId'\";\n    if ($result = $this->_db->query($sql)) {\n      return $result->fetchAll();\n    }\n    return FALSE;\n  }\n  public function getNews($id = 'ALL')\n  {\n    $id = sqlite_escape_string($id);\n    switch ($id) {\n      case 'ALL':\n        $sql = \"SELECT id,\n                title\n            FROM  news\n            WHERE approval = 'T'\";\n        break;\n      case 'NEW':\n        $sql = \"SELECT *\n            FROM  news\n            WHERE approval != 'T'\";\n        break;\n      default:\n        $sql = \"SELECT *\n            FROM  news\n            WHERE id = '$id'\";\n        break;\n    }\n    if ($result = $this->_db->query($sql)) {\n      if ($result->numRows() != 1) {\n        return $result->fetchAll();\n      } else {\n        return $result->fetch();\n      }\n    }\n    return FALSE;\n  }\n}\n?>\n\n<\/pre>\n\n<p>(你可以用自己的解決方案隨意替換這個(gè)類。這里只是為你提供一個(gè)完整示例的介紹,并非建議要這么實(shí)現(xiàn)。)<\/p>\n<p>這個(gè)類的構(gòu)造器需要SQLite數(shù)據(jù)庫(kù)的完整路徑和文件名,你必須自己進(jìn)行創(chuàng)建。<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\n$db = new SQLiteDatabase('\/path\/to\/db.sqlite');\n$db->query(\"CREATE TABLE news (\n    id    INTEGER PRIMARY KEY,\n    title  VARCHAR(255),\n    content TEXT,\n    approval CHAR(1) DEFAULT 'F'\n  )\");\n$db->query(\"CREATE TABLE comments (\n    id    INTEGER PRIMARY KEY,\n    name   VARCHAR(255),\n    comment TEXT,\n    newsId  INTEGER\n  )\");\n?>\n\n<\/pre>\n\n<p>你只需要做一次,以后直接給出Database類構(gòu)造器的完整路徑和文件名即可:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\n$db = new Database('\/path\/to\/db.sqlite');\n?>\n\n<\/pre>\n\n<p><strong>整合<\/strong><\/p>\n<p>為了進(jìn)行整合,在lib目錄下創(chuàng)建Database.php,loadClass()就可以找到它。你的index.php文件現(xiàn)在就會(huì)初始化$view和$db并存儲(chǔ)到寄存器。你也可以創(chuàng)建__autoload()函數(shù)自動(dòng)加載你所需要的類:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\ninclude 'Zend.php';\nfunction __autoload($class)\n{\n  Zend::loadClass($class);\n}\n$db = new Database('\/path\/to\/db.sqlite');\nZend::register('db', $db);\n$view = new Zend_View;\n$view->setScriptPath('\/path\/to\/views');\nZend::register('view', $view);\n$controller = Zend_Controller_Front::getInstance()\n       ->setControllerDirectory('\/path\/to\/controllers')\n       ->dispatch();\n?>\n\n<\/pre>\n\n<p>接下來(lái),在views目錄創(chuàng)建一些簡(jiǎn)單的模板。index.php可以用來(lái)顯示index視圖:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<html>\n<head>\n <title>News<\/title>\n<\/head>\n<body>\n <h1>News<\/h1>\n <?php foreach ($this->news as $entry) { ?>\n <p>\n  <a href=\"\/view\/<?php echo $this->escape($entry['id']); ?>\">\n  <?php echo $this->escape($entry['title']); ?>\n  <\/a>\n <\/p>\n <?php } ?>\n <h1>Add News<\/h1>\n <form action=\"\/add\/news\" method=\"POST\">\n <p>Title:<br \/><input type=\"text\" name=\"title\" \/><\/p>\n <p>Content:<br \/><textarea name=\"content\"><\/textarea><\/p>\n <p><input type=\"submit\" value=\"Add News\" \/><\/p>\n <\/form>\n<\/body>\n<\/html>\n\n<\/pre>\n\n<p>view.php模板可以用來(lái)顯示選定的新聞條目:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<html>\n<head>\n <title>\n  <?php echo $this->escape($this->news['title']); ?>\n <\/title>\n<\/head>\n<body>\n <h1>\n  <?php echo $this->escape($this->news['title']); ?>\n <\/h1>\n <p>\n  <?php echo $this->escape($this->news['content']); ?>\n <\/p>\n <h1>Comments<\/h1>\n <?php foreach ($this->comments as $comment) { ?>\n <p>\n  <?php echo $this->escape($comment['name']); ?> writes:\n <\/p>\n <blockquote>\n  <?php echo $this->escape($comment['comment']); ?>\n <\/blockquote>\n <?php } ?>\n <h1>Add a Comment<\/h1>\n <form action=\"\/add\/comment\" method=\"POST\">\n <input type=\"hidden\" name=\"newsId\" \n  value=\"<?php echo $this->escape($this->id); ?>\" \/>\n <p>Name:<br \/><input type=\"text\" name=\"name\" \/><\/p>\n <p>Comment:<br \/><textarea name=\"comment\"><\/textarea><\/p>\n <p><input type=\"submit\" value=\"Add Comment\" \/><\/p>\n <\/form>\n<\/body>\n<\/html>\n\n<\/pre>\n\n<p>最后,admin.php模板可以用來(lái)批準(zhǔn)新聞條目:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<html>\n<head>\n <title>News Admin<\/title>\n<\/head>\n<body>\n <form action=\"\/admin\/approve\" method=\"POST\">\n <?php foreach ($this->news as $entry) { ?>\n <p>\n  <input type=\"checkbox\" name=\"ids[]\"\n  value=\"<?php echo $this->escape($entry['id']); ?>\" \/>\n  <?php echo $this->escape($entry['title']); ?>\n  <?php echo $this->escape($entry['content']); ?>\n <\/p>\n <?php } ?>\n <p>\n  Password:<br \/><input type=\"password\" name=\"password\" \/>\n <\/p>\n <p><input type=\"submit\" value=\"Approve\" \/><\/p>\n <\/form>\n<\/body>\n<\/html>\n\n<\/pre>\n\n<p>提示:為了保持簡(jiǎn)單,這個(gè)表單用密碼作為驗(yàn)證機(jī)制。<\/p>\n<p>使用到模板的地方,你只需要把注釋替換成幾行代碼。如IndexController.php就變成下面這樣:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nclass IndexController extends Zend_Controller_Action \n{\n  public function indexAction()\n  {\n    \/* List the news. *\/\n    $db = Zend::registry('db');\n    $view = Zend::registry('view');\n    $view->news = $db->getNews();\n    echo $view->render('index.php');\n  }\n  public function noRouteAction()\n  {\n    $this->_redirect('\/');\n  }\n}\n?>\n\n<\/pre>\n\n<p>因?yàn)闂l理比較清楚,這個(gè)程序首頁(yè)的整個(gè)業(yè)務(wù)邏輯只有四行代碼。AddController.php更復(fù)雜一點(diǎn),它需要更多的代碼:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nclass AddController extends Zend_Controller_Action\n{\n  function indexAction()\n  {\n    $this->_redirect('\/');\n  }\n  function commentAction()\n  {\n    \/* Add a comment. *\/\n    $filterPost = new Zend_InputFilter($_POST);\n    $db = Zend::registry('db');\n    $name = $filterPost->getAlpha('name');\n    $comment = $filterPost->noTags('comment');\n    $newsId = $filterPost->getDigits('newsId');\n    $db->addComment($name, $comment, $newsId);\n    $this->_redirect(\"\/view\/$newsId\");\n  }\n  function newsAction()\n  {\n    \/* Add news. *\/\n    $filterPost = new Zend_InputFilter($_POST);\n    $db = Zend::registry('db');\n    $title = $filterPost->noTags('title');\n    $content = $filterPost->noTags('content');\n    $db->addNews($title, $content);\n    $this->_redirect('\/');\n  }\n  function __call($action, $arguments)\n  {\n    $this->_redirect('\/');\n  }\n}\n?>\n\n<\/pre>\n\n<p>因?yàn)橛脩粼谔峤槐韱魏蟊恢囟ㄏ?,這個(gè)controller不需要視圖。<\/p>\n<p>在AdminController.php,你要處理顯示管理界面和批準(zhǔn)新聞兩個(gè)action:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nclass AdminController extends Zend_Controller_Action\n{\n  function indexAction()\n  {\n    \/* Display admin interface. *\/\n    $db = Zend::registry('db');\n    $view = Zend::registry('view');\n    $view->news = $db->getNews('NEW');\n    echo $view->render('admin.php');\n  }\n  function approveAction()\n  {\n    \/* Approve news. *\/\n    $filterPost = new Zend_InputFilter($_POST);\n    $db = Zend::registry('db');\n    if ($filterPost->getRaw('password') == 'mypass') {\n      $db->approveNews($filterPost->getRaw('ids'));\n      $this->_redirect('\/');\n    } else {\n      echo 'The password is incorrect.';\n    }\n  }\n  function __call($action, $arguments)\n  {\n    $this->_redirect('\/');\n  }\n}\n?>\n\n<\/pre>\n\n<p>最后是ViewController.php:<\/p>\n\n<pre class='brush:php;toolbar:false;'>\n<?php\nclass ViewController extends Zend_Controller_Action\n{\n  function indexAction()\n  {\n    $this->_redirect('\/');\n  }\n  function __call($id, $arguments)\n  {\n    \/* Display news and comments for $id. *\/\n    $id = Zend_Filter::getDigits($id);\n    $db = Zend::registry('db');\n    $view = Zend::registry('view');\n    $view->news = $db->getNews($id);\n    $view->comments = $db->getComments($id);\n    $view->id = $id;\n    echo $view->render('view.php');\n  }\n}\n?>\n\n<\/pre>\n\n<p>雖然很簡(jiǎn)單,但我們還是提供了一個(gè)功能較全的新聞和評(píng)論程序。最好的地方是由于有較好的設(shè)計(jì),增加功能變得很簡(jiǎn)單。而且隨著Zend Framework越來(lái)越成熟,只會(huì)變得更好。<\/p>\n<p><strong>更多信息<\/strong><\/p>\n<p>這個(gè)教程只是討論了ZF表面的一些功能,但現(xiàn)在也有一些其它的資源可供參考。在http:\/\/framework.zend.com\/manual\/有手冊(cè)可以查詢,Rob Allen在http:\/\/akrabat.com\/zend-framework\/介紹了一些他使用Zend Framework的經(jīng)驗(yàn),而Richard Thomas也在http:\/\/www.cyberlot.net\/zendframenotes提供了一些有用的筆記。如果你有自己的想法,可以訪問(wèn)Zend Framework的新論壇:http:\/\/www.phparch.com\/discuss\/index.php\/f\/289\/\/。<\/p>\n<p><strong>結(jié)束語(yǔ)<\/strong><\/p>\n<p>要對(duì)預(yù)覽版進(jìn)行評(píng)價(jià)是很容易的事,我在寫這個(gè)教程時(shí)也遇到很多困難??偟膩?lái)說(shuō),我想Zend Framework顯示了承諾,加入的每個(gè)人都是想繼續(xù)完善它。<\/p>\n<p>更多關(guān)于zend相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Zend FrameWork框架入門教程》、《php優(yōu)秀開(kāi)發(fā)框架總結(jié)》、《Yii框架入門及常用技巧總結(jié)》、《ThinkPHP入門教程》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》、《php+mysql數(shù)據(jù)庫(kù)操作入門教程》及《php常見(jiàn)數(shù)據(jù)庫(kù)操作技巧匯總》<\/p>\n<p>I hope this article will be helpful to everyone’s PHP programming based on the Zend Framework framework. <\/p>\n\n\n<!--endmain-->\n\n<h4>Articles you may be interested in:<\/h4>\n<ul>\n<li>Zend Framework Tutorial - Zend_Db_Table_Rowset Usage Example Analysis<\/li>\n<li>Zend Framework Tutorial - Zend_Db_Table_Row Usage Example Analysis<\/li>\n<li>Zend Framework Detailed explanation of the usage of Zend_Db_Table in the tutorial <\/li>\n<li>Zend Framework tutorial Zend_Form component to implement form submission and display error prompts<\/li>\n<li>Zend Framework Smarty extension implementation method<\/li>\n<li>Zend Framework routing mechanism Code analysis<\/li>\n<li>Zend Framework implements a guestbook with basic functions (with demo source code download)<\/li>\n<li>Zend Framework implements the method of storing sessions in memcache<\/li>\n<li>Zend Framework paging class Detailed explanation of usage<\/li>\n<li>Zend Framework implementation of multi-file upload function example<\/li>\n<li>Environment configuration for getting started with Zend Framework and the first Hello World example (with demo source code download)<\/li>\n<li>Zend Framework tutorial How to connect to the database and perform add\/delete queries (with demo source code download)<\/li>\n<li>Detailed explanation of the Zend_Db_Table table association example in the Zend Framework tutorial<\/li>\n<\/ul>\n<p align=\"left\"><\/p>\n<div style=\"display:none;\">\n<span id=\"url\" itemprop=\"url\">http:\/\/www.bkjia.com\/PHPjc\/1113710.html<\/span><span id=\"indexUrl\" itemprop=\"indexUrl\">www.bkjia.com<\/span><span id=\"isOriginal\" itemprop=\"isOriginal\">true<\/span><span id=\"isBasedOnUrl\" itemprop=\"isBasedOnUrl\">http: \/\/www.bkjia.com\/PHPjc\/1113710.html<\/span><span id=\"genre\" itemprop=\"genre\">TechArticle<\/span><span id=\"description\" itemprop=\"description\">A classic tutorial for getting started with Zend Framework development, zendframework. This article tells the knowledge points related to getting started with Zend Framework development. Share it with everyone for your reference, the details are as follows: Zend Framework released...<\/span>\n<\/div>\n<div   id="377j5v51b"   class=\"art_confoot\"><\/div>"}	</script>
    	
    <meta http-equiv="Cache-Control" content="no-transform" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <script>var V_PATH="/";window.onerror=function(){ return true; };</script>
    </head>
    
    <body data-commit-time="2023-12-28T14:50:12+08:00" class="editor_body body2_2">
    	<link rel="stylesheet" type="text/css" href="/static/csshw/stylehw.css">
    <header>
        <div   id="377j5v51b"   class="head">
            <div   id="377j5v51b"   class="haed_left">
                <div   id="377j5v51b"   class="haed_logo">
                    <a href="http://www.miracleart.cn/" title="" class="haed_logo_a">
                        <img src="/static/imghw/logo.png" alt="" class="haed_logoimg">
                    </a>
                </div>
                <div   id="377j5v51b"   class="head_nav">
                    <div   id="377j5v51b"   class="head_navs">
                        <a href="javascript:;" title="Community" class="head_nava head_nava-template1">Community</a>
                        <div   class="377j5v51b"   id="dropdown-template1" style="display: none;">
                            <div   id="377j5v51b"   class="languagechoose">
                                <a href="http://www.miracleart.cn/article.html" title="Articles" class="languagechoosea on">Articles</a>
                                <a href="http://www.miracleart.cn/faq/zt" title="Topics" class="languagechoosea">Topics</a>
                                <a href="http://www.miracleart.cn/wenda.html" title="Q&A" class="languagechoosea">Q&A</a>
                            </div>
                        </div>
                    </div>
    
                    <div   id="377j5v51b"   class="head_navs">
                        <a href="javascript:;" title="Learn" class="head_nava head_nava-template1_1">Learn</a>
                        <div   class="377j5v51b"   id="dropdown-template1_1" style="display: none;">
                            <div   id="377j5v51b"   class="languagechoose">
                                <a href="http://www.miracleart.cn/course.html" title="Course" class="languagechoosea on">Course</a>
                                <a href="http://www.miracleart.cn/dic/" title="Programming Dictionary" class="languagechoosea">Programming Dictionary</a>
                            </div>
                        </div>
                    </div>
    
                    <div   id="377j5v51b"   class="head_navs">
                        <a href="javascript:;" title="Tools Library" class="head_nava head_nava-template1_2">Tools Library</a>
                        <div   class="377j5v51b"   id="dropdown-template1_2" style="display: none;">
                            <div   id="377j5v51b"   class="languagechoose">
                                <a href="http://www.miracleart.cn/toolset/development-tools" title="Development tools" class="languagechoosea on">Development tools</a>
                                <a href="http://www.miracleart.cn/toolset/website-source-code" title="Website Source Code" class="languagechoosea">Website Source Code</a>
                                <a href="http://www.miracleart.cn/toolset/php-libraries" title="PHP Libraries" class="languagechoosea">PHP Libraries</a>
                                <a href="http://www.miracleart.cn/toolset/js-special-effects" title="JS special effects" class="languagechoosea on">JS special effects</a>
                                <a href="http://www.miracleart.cn/toolset/website-materials" title="Website Materials" class="languagechoosea on">Website Materials</a>
                                <a href="http://www.miracleart.cn/toolset/extension-plug-ins" title="Extension plug-ins" class="languagechoosea on">Extension plug-ins</a>
                            </div>
                        </div>
                    </div>
    
                    <div   id="377j5v51b"   class="head_navs">
                        <a href="http://www.miracleart.cn/ai" title="AI Tools" class="head_nava head_nava-template1_3">AI Tools</a>
                    </div>
    
                    <div   id="377j5v51b"   class="head_navs">
                        <a href="javascript:;" title="Leisure" class="head_nava head_nava-template1_3">Leisure</a>
                        <div   class="377j5v51b"   id="dropdown-template1_3" style="display: none;">
                            <div   id="377j5v51b"   class="languagechoose">
                                <a href="http://www.miracleart.cn/game" title="Game Download" class="languagechoosea on">Game Download</a>
                                <a href="http://www.miracleart.cn/mobile-game-tutorial/" title="Game Tutorials" class="languagechoosea">Game Tutorials</a>
    
                            </div>
                        </div>
                    </div>
                </div>
            </div>
                        <div   id="377j5v51b"   class="head_search">
                    <input id="key_words"  onkeydown="if (event.keyCode == 13) searchs('en')" class="search-input" type="text" autocomplete="off" name="keywords" required="required" placeholder="Block,address,transaction,news" value="">
                    <a href="javascript:;" title="search"  onclick="searchs('en')"><img src="/static/imghw/find.png" alt="search"></a>
                </div>
                    <div   id="377j5v51b"   class="head_right">
                <div   id="377j5v51b"   class="haed_language">
                    <a href="javascript:;" class="layui-btn haed_language_btn">English<i class="layui-icon layui-icon-triangle-d"></i></a>
                    <div   class="377j5v51b"   id="dropdown-template" style="display: none;">
                        <div   id="377j5v51b"   class="languagechoose">
                                                    <a href="javascript:setlang('zh-cn');" title="簡(jiǎn)體中文" class="languagechoosea">簡(jiǎn)體中文</a>
                                                    <a href="javascript:;" title="English" class="languagechoosea">English</a>
                                                    <a href="javascript:setlang('zh-tw');" title="繁體中文" class="languagechoosea">繁體中文</a>
                                                    <a href="javascript:setlang('ja');" title="日本語(yǔ)" class="languagechoosea">日本語(yǔ)</a>
                                                    <a href="javascript:setlang('ko');" title="???" class="languagechoosea">???</a>
                                                    <a href="javascript:setlang('ms');" title="Melayu" class="languagechoosea">Melayu</a>
                                                    <a href="javascript:setlang('fr');" title="Fran?ais" class="languagechoosea">Fran?ais</a>
                                                    <a href="javascript:setlang('de');" title="Deutsch" class="languagechoosea">Deutsch</a>
                                                </div>
                    </div>
                </div>
                <span id="377j5v51b"    class="head_right_line"></span>
                                <div style="display: block;" id="login" class="haed_login ">
                        <a href="javascript:;"  title="Login" class="haed_logina ">Login</a>
                    </div>
                    <div style="display: block;" id="reg" class="head_signup login">
                        <a href="javascript:;"  title="singup" class="head_signupa">singup</a>
                    </div>
                
            </div>
        </div>
    </header>
    
    	
    	<main>
    		<div   id="377j5v51b"   class="Article_Details_main">
    			<div   id="377j5v51b"   class="Article_Details_main1">
    							<div   id="377j5v51b"   class="Article_Details_main1L">
    					<div   id="377j5v51b"   class="Article_Details_main1Lmain" id="Article_Details_main1Lmain">
    						<div   id="377j5v51b"   class="Article_Details_main1L1">Table of Contents</div>
    						<div   id="377j5v51b"   class="Article_Details_main1L2" id="Article_Details_main1L2">
    							<!-- 左側(cè)懸浮,文章定位標(biāo)題1 id="Article_Details_main1L2s_1"-->
    															<div   id="377j5v51b"   class="Article_Details_main1L2s ">
    									<a href="#A-classic-tutorial-for-getting-started-with-Zend-Framework-development-zendframework" title="A classic tutorial for getting started with Zend Framework development, zendframework" >A classic tutorial for getting started with Zend Framework development, zendframework</a>
    								</div>
    																<div   id="377j5v51b"   class="Article_Details_main1L2s ">
    									<a href="#Articles-you-may-be-interested-in" title="Articles you may be interested in:" >Articles you may be interested in:</a>
    								</div>
    														</div>
    					</div>
    				</div>
    							<div   id="377j5v51b"   class="Article_Details_main1M">
    					<div   id="377j5v51b"   class="phpgenera_Details_mainL1">
    						<a href="http://www.miracleart.cn/" title="Home"
    							class="phpgenera_Details_mainL1a">Home</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    												<a href="http://www.miracleart.cn/be/"
    							class="phpgenera_Details_mainL1a">Backend Development</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    												<a href="http://www.miracleart.cn/php-weizijiaocheng.html"
    							class="phpgenera_Details_mainL1a">PHP Tutorial</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    						<span>Zend Framework development introductory classic tutorial, zendframework_PHP tutorial</span>
    					</div>
    					
    					<div   id="377j5v51b"   class="Articlelist_txts">
    						<div   id="377j5v51b"   class="Articlelist_txts_info">
    							<h1 class="Articlelist_txts_title">Zend Framework development introductory classic tutorial, zendframework_PHP tutorial</h1>
    							<div   id="377j5v51b"   class="Articlelist_txts_info_head">
    								<div   id="377j5v51b"   class="author_info">
    									<a href="http://www.miracleart.cn/member/887227.html"  class="author_avatar">
    									<img class="lazy"  data-src="https://img.php.cn/upload/avatar/000/887/227/63bb7851c9547215.jpg" src="/static/imghw/default1.png" alt="WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB">
    									</a>
    									<div   id="377j5v51b"   class="author_detail">
    																			<a href="http://www.miracleart.cn/member/887227.html" class="author_name">WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB</a>
                                    										</div>
    								</div>
                    			</div>
    							<span id="377j5v51b"    class="Articlelist_txts_time">Jul 12, 2016 am	 08:56 AM</span>
    															<div   id="377j5v51b"   class="Articlelist_txts_infos">
    																			<span id="377j5v51b"    class="Articlelist_txts_infoss on">framework</span>
    																			<span id="377j5v51b"    class="Articlelist_txts_infoss ">zend</span>
    																			<span id="377j5v51b"    class="Articlelist_txts_infoss ">getting Started</span>
    																	</div>
    														
    						</div>
    					</div>
    					<hr />
    					<div   id="377j5v51b"   class="article_main php-article">
    						<div   id="377j5v51b"   class="article-list-left detail-content-wrap content">
    						<ins class="adsbygoogle"
    							style="display:block; text-align:center;"
    							data-ad-layout="in-article"
    							data-ad-format="fluid"
    							data-ad-client="ca-pub-5902227090019525"
    							data-ad-slot="3461856641">
    						</ins>
    						
    
    					<p></p>
    <h2 id="A-classic-tutorial-for-getting-started-with-Zend-Framework-development-zendframework">A classic tutorial for getting started with Zend Framework development, zendframework</h2>
    <p>This article talks about knowledge points related to getting started with Zend Framework development. Share it with everyone for your reference, the details are as follows: </p>
    <p>Zend Framework is released! Although still in the early stages of development, this tutorial highlights some of the best features available and guides you through building a simple program. </p>
    <p>Zend was the first to release ZF in the community. Based on the same idea, this tutorial was written to demonstrate the existing capabilities of ZF. Since this tutorial is posted online, I will update it as ZF changes so that it is as efficient as possible. </p>
    <p><strong>Requirements</strong></p>
    <p>Zend Framework requires PHP5. In order to make best use of the code in this tutorial, you will also need the Apache web server. Because the demonstration program (a news management system) uses mod_rewrite. </p>
    <p>The code for this tutorial is freely downloadable, so you can try it yourself. You can download the code from Brain Buld's website: http://brainbulb.com/zend-framework-tutorial.tar.gz. </p>
    <p><strong>Download ZF</strong></p>
    <p>When you start this tutorial, you need to download the latest version of ZF. You can use a browser to manually select the tar.gz or zip file to download from http://framework.zend.com/download, or use the following command: </p>
    
    <pre class='brush:php;toolbar:false;'>
    $ wget http://framework.zend.com/download/tgz
    $ tar -xvzf ZendFramework-0.1.2.tar.gz
    
    </pre>
    
    <p>Tip: Zend plans to provide its own PEAR channel to simplify downloads. </p>
    <p>Once you download the preview version, put the library directory somewhere convenient. In this tutorial, I renamed library to lib to have a concise directory structure: </p>
    <p><span style="color: #0000ff">app/<br />
    Views/<br />
    Controllers/<br />
    www/<br />
    .htaccess<br />
    Index.php<br />
    lib/</span></p>
    <p>The www directory is the document root directory, the controllers and views directories are empty directories that will be used later, and the lib directory comes from the preview version you downloaded. </p>
    <p><strong>Start</strong></p>
    <p>The first component I want to introduce is Zend_Controller. In many ways, it provides the foundation for the programs you develop, and it also partially determines that Zend Framework is more than just a collection of components. However, you need to put all the obtained requests into a simple PHP script before using it. This tutorial uses mod_rewrite. </p>
    <p>Using mod_rewrite is an art in itself, but luckily this particular task is surprisingly easy. If you are unfamiliar with mod_rewrite or Apache configuration in general, create a .htaccess file in the document root and add the following content: </p>
    
    <pre class='brush:php;toolbar:false;'>
    RewriteEngine on
    RewriteRule !/.(js|ico|gif|jpg|png|css)$ index.php
    
    </pre>
    
    <p><span style="color: #0000ff">Tip: One TODO project of Zend_Controller is to cancel the dependence on mod_rewrite. To provide a preview of the example, this tutorial uses mod_rewrite. </span></p>
    <p>If you add these contents directly to httpd.conf, you must restart the web server. But if you use a .htaccess file, you don't have to do anything. You can do a quick test by putting some specific text into index.php and accessing any path such as /foo/bar. If your domain name is example.org, visit http://example.org/foo/bar. </p>
    <p>You also need to set the path of the ZF library to include_path. You can set it in php.ini, or you can put the following content directly in your .htaccess file: </p>
    
    <pre class='brush:php;toolbar:false;'>
    php_value include_path "/path/to/lib"
    
    </pre>
    
    <p><strong>Zend</strong></p>
    <p>The Zend class contains a collection of frequently used static methods. Here is the only class you need to add manually: </p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    include 'Zend.php';
    &#63;>
    
    </pre>
    
    <p>Once you include Zend.php, you have included all the class methods of the Zend class. You can simply load other classes using loadClass(). For example, load the Zend_Controller_Front class: </p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    include 'Zend.php';
    Zend::loadClass('Zend_Controller_Front');
    &#63;>
    
    </pre>
    
    <p>include_path can understand the organization and directory structure of loadclass() and ZF. I use it to load all other classes. </p>
    <p><strong>Zend_Controller</strong></p>
    <p>Using this controller is very intuitive. In fact, I didn't use its extensive documentation when writing this tutorial. </p>
    <p>Tips: The documentation is currently available at http://framework.zend.com/manual/zend.controller.html. </p>
    <p>I initially used a front controller called Zend_Controller_Front. To understand how it works, place the following code in your index.php file: </p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    include 'Zend.php';
    Zend::loadClass('Zend_Controller_Front');
    $controller = Zend_Controller_Front::getInstance();
    $controller->setControllerDirectory('/path/to/controllers');
    $controller->dispatch();
    &#63;>
    
    </pre>
    
    <p>If you prefer object linking, you can use the following code instead: </p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    include 'Zend.php';
    Zend::loadClass('Zend_Controller_Front');
    $controller = Zend_Controller_Front::getInstance()
           ->setControllerDirectory('/path/to/controllers')
           ->dispatch();
    &#63;>
    
    </pre>
    
    <p>Now if you access /foo/bar, an error will occur. That’s right! It lets you know what's going on. The main problem is that the IndexController.php file cannot be found. </p>
    <p>Before you create this file, you should first understand how the government wants you to organize these things. ZF splits the access requests. If you are accessing /foo/bar, foo is the controller and bar is the action. Their default values ??are index.</p>
    <p>If foo is a controller, ZF will search for the FooController.php file in the controllers directory. Because this file does not exist, ZF falls back to IndexController.php. No results were found, so an error was reported. </p>
    <p>Next, create the IndexController.php file in the controllers directory (can be set with setControllerDirectory()): </p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    class IndexController extends Zend_Controller_Action 
    {
      public function indexAction()
      {
        echo 'IndexController::indexAction()';
      }
    }
    &#63;>
    
    </pre>
    
    <p>就如剛才說(shuō)明的,IndexController類處理來(lái)自index controller或controller不存在的請(qǐng)求。indexAction()方法處理action為index的訪問(wèn)。要記住的是index是controller和action的默認(rèn)值。如果你訪問(wèn)/,/index或/index/index,indexAction()方法就會(huì)被執(zhí)行。 (最后面的斜杠并不會(huì)改變這個(gè)行為。) 而訪問(wèn)其他任何資源只會(huì)導(dǎo)致出錯(cuò)。</p>
    <p>在繼續(xù)做之前,還要在IndexController加上另外一個(gè)有用的類方法。不管什么時(shí)候訪問(wèn)一個(gè)不存在的控制器,都要調(diào)用noRouteAction()類方法。例如,在FooController.php不存在的條件下,訪問(wèn)/foo/bar就會(huì)執(zhí)行noRouteAction()。但是訪問(wèn)/index/foo仍會(huì)出錯(cuò),因?yàn)閒oo是action,而不是controller.</p>
    <p>將noRouteAction()添加到IndexController.php:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    class IndexController extends Zend_Controller_Action 
    {
      public function indexAction()
      {
        echo 'IndexController::indexAction()';
      }
      public function noRouteAction()
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>例子中使用$this->_redirect('/')來(lái)描述執(zhí)行noRouteAction()時(shí),可能發(fā)生的行為。這會(huì)將對(duì)不存在controllers的訪問(wèn)重定向到根文檔(首頁(yè))。</p>
    <p>現(xiàn)在創(chuàng)建FooController.php:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    class FooController extends Zend_Controller_Action 
    {
      public function indexAction()
      {
        echo 'FooController::indexAction()';
      }
      public function barAction()
      {
        echo 'FooController::barAction()';
      }
    }
    &#63;>
    
    </pre>
    
    <p>如果你再次訪問(wèn)/foo/bar,你會(huì)發(fā)現(xiàn)執(zhí)行了barAction(),因?yàn)閎ar是action?,F(xiàn)在你不只支持了友好的URL,還可以只用幾行代碼就做得這么有條理??岚?!<br />
    你也可以創(chuàng)建一個(gè)__call()類方法來(lái)處理像/foo/baz這樣未定義的action。</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    class FooController extends Zend_Controller_Action 
    {
      public function indexAction()
      {
        echo 'FooController::indexAction()';
      }
      public function barAction()
      {
        echo 'FooController::barAction()';
      }
      public function __call($action, $arguments)
      {
        echo 'FooController:__call()';
      }
    }
    &#63;>
    
    </pre>
    
    <p>現(xiàn)在你只要幾行代碼就可以很好地處理用戶的訪問(wèn)了,準(zhǔn)備好繼續(xù)。</p>
    <p><strong>Zend_View</strong></p>
    <p>Zend_View是一個(gè)用來(lái)幫助你組織好你的view邏輯的類。這對(duì)于模板-系統(tǒng)是不可知的,為了簡(jiǎn)單起見(jiàn),本教程不使用模板。如果你喜歡的話,不妨用一下。</p>
    <p>記住,現(xiàn)在所有的訪問(wèn)都是由front controller進(jìn)行處理。因此應(yīng)用框架已經(jīng)存在了,另外也必須遵守它。為了展示Zend_View的一個(gè)基本應(yīng)用,將IndexController.php修改如下:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    Zend::loadClass('Zend_View');
    class IndexController extends Zend_Controller_Action 
    {
      public function indexAction()
      {
        $view = new Zend_View();
        $view->setScriptPath('/path/to/views');
        echo $view->render('example.php');
      }
      public function noRouteAction()
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>在views目錄創(chuàng)建example.php文件:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <html>
    <head>
      <title>This Is an Example</title>
    </head>
    <body>
      <p>This is an example.</p>
    </body>
    </html>
    
    </pre>
    
    <p>現(xiàn)在,如果你訪問(wèn)自己網(wǎng)站的根資源,你會(huì)看到example.php的內(nèi)容。這仍沒(méi)什么用,但你要清楚你要在以一種結(jié)構(gòu)和組織非常清楚的方式在開(kāi)發(fā)網(wǎng)絡(luò)應(yīng)用。</p>
    <p>為了讓Zend_View的應(yīng)用更清楚一點(diǎn),,修改你的模板(example.php)包含以下內(nèi)容:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <html>
    <head>
      <title><&#63;php echo $this->escape($this->title); &#63;></title>
    </head>
    <body>
      <&#63;php echo $this->escape($this->body); &#63;>
    </body>
    </html>
    
    </pre>
    
    <p>現(xiàn)在已經(jīng)添加了兩個(gè)功能。$this->escape()類方法用于所有的輸出。即使你自己創(chuàng)建輸出,就像這個(gè)例子一樣。避開(kāi)所有輸出也是一個(gè)很好的習(xí)慣,它可以在默認(rèn)情況下幫助你防止跨站腳本攻擊(XSS)。</p>
    <p>$this->title和$this->body屬性用來(lái)展示動(dòng)態(tài)數(shù)據(jù)。這些也可以在controller中定義,所以我們修改IndexController.php以指定它們:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    Zend::loadClass('Zend_View');
    class IndexController extends Zend_Controller_Action 
    {
      public function indexAction()
      {
        $view = new Zend_View();
        $view->setScriptPath('/path/to/views');
        $view->title = 'Dynamic Title';
        $view->body = 'This is a dynamic body.';
        echo $view->render('example.php');
      }
      public function noRouteAction()
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>現(xiàn)在你再次訪問(wèn)根目錄,應(yīng)該就可以看到模板所使用的這些值了。因?yàn)槟阍谀0逯惺褂玫?this就是在Zend_View范圍內(nèi)所執(zhí)行的實(shí)例。</p>
    <p>要記住example.php只是一個(gè)普通的PHP腳本,所以你完全可以做你想做的。只是應(yīng)努力只在要求顯示數(shù)據(jù)時(shí)才使用模板。你的controller (controller分發(fā)的模塊)應(yīng)處理你全部的業(yè)務(wù)邏輯。</p>
    <p>在繼續(xù)之前,我想做最后一個(gè)關(guān)于Zend_View的提示。在controller的每個(gè)類方法內(nèi)初始化$view對(duì)象需要額外輸入一些內(nèi)容,而我們的主要目標(biāo)是讓快速開(kāi)發(fā)網(wǎng)絡(luò)應(yīng)用更簡(jiǎn)單。如果所有模板都放在一個(gè)目錄下,是否要在每個(gè)例子中都調(diào)用setScriptPath()也存在爭(zhēng)議。</p>
    <p>幸運(yùn)的是,Zend類包含了一個(gè)寄存器來(lái)幫助減少工作量。你可以用register()方法把你的$view對(duì)象存儲(chǔ)在寄存器:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::register('view', $view);
    &#63;>
    
    </pre>
    
    <p>用registry()方法進(jìn)行檢索:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    $view = Zend::registry('view');
    &#63;>
    
    </pre>
    
    <p>基于這點(diǎn),本教程使用寄存器。 </p>
    <p><strong>Zend_InputFilter</strong></p>
    <p>本教程討論的最后一個(gè)組件是Zend_InputFilter。這個(gè)類提供了一種簡(jiǎn)單而有效的輸入過(guò)濾方法。你可以通過(guò)提供一組待過(guò)濾數(shù)據(jù)來(lái)進(jìn)行初始化。</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    $filterPost = new Zend_InputFilter($_POST);
    &#63;>
    
    </pre>
    
    <p>這會(huì)將($_POST)設(shè)置為NULL,所以就不能直接進(jìn)入了。Zend_InputFilter提供了一個(gè)簡(jiǎn)單、集中的根據(jù)特定規(guī)則過(guò)濾數(shù)據(jù)的類方法集。例如,你可以用getAlpha()來(lái)獲取$_POST['name']中的字母:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    /* $_POST['name'] = 'John123Doe'; */
    $filterPost = new Zend_InputFilter($_POST);
    /* $_POST = NULL; */
    $alphaName = $filterPost->getAlpha('name');
    /* $alphaName = 'JohnDoe'; */
    &#63;>
    
    </pre>
    
    <p>每一個(gè)類方法的參數(shù)都是對(duì)應(yīng)要過(guò)濾的元素的關(guān)鍵詞。對(duì)象(例子中的$filterPost)可以保護(hù)數(shù)據(jù)不被篡改,并能更好地控制對(duì)數(shù)據(jù)的操作及一致性。因此,當(dāng)你操縱輸入數(shù)據(jù),應(yīng)始終使用Zend_InputFilter。</p>
    <p>提示:Zend_Filter提供與Zend_InputFilter方法一樣的靜態(tài)方法。</p>
    <p><strong>構(gòu)建新聞管理系統(tǒng)</strong></p>
    <p>雖然預(yù)覽版提供了許多組件(甚至許多已經(jīng)被開(kāi)發(fā)),我們已經(jīng)討論了構(gòu)建一個(gè)簡(jiǎn)單程序所需要的全部組件。在這里,你會(huì)對(duì)ZF的基本結(jié)構(gòu)和設(shè)計(jì)有更清楚的理解。</p>
    <p>每個(gè)人開(kāi)發(fā)的程序都會(huì)有所不同,而Zend Framework試圖包容這些差異。同樣,這個(gè)教程是根據(jù)我的喜好寫的,請(qǐng)根據(jù)自己的偏好自行調(diào)整。</p>
    <p>當(dāng)我開(kāi)發(fā)程序時(shí),我會(huì)先做界面。這并不意味著我把時(shí)間都花在標(biāo)簽、樣式表和圖片上,而是我從一個(gè)用戶的角度去考慮問(wèn)題。因此我把程序看成是頁(yè)面的集合,每一頁(yè)都是一個(gè)獨(dú)立的網(wǎng)址。這個(gè)新聞系統(tǒng)就是由以下網(wǎng)址組成的:</p>
    <p><span style="color: #0000ff">/<br />
    /add/news<br />
    /add/comment<br />
    /admin<br />
    /admin/approve<br />
    /view/{id}</span></p>
    <p>你可以直接把這些網(wǎng)址和controller聯(lián)系起來(lái)。IndexController列出新聞,AddController添加新聞和評(píng)論,AdminController處理一些如批準(zhǔn)新聞之類的管理,ViewController特定新聞和對(duì)應(yīng)評(píng)論的顯示。</p>
    <p>如果你的FooController.php還在,把它刪除。修改IndexController.php,為業(yè)務(wù)邏輯以添加相應(yīng)的action和一些注釋:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    class IndexController extends Zend_Controller_Action 
    {
      public function indexAction()
      {
        /* List the news. */
      }
      public function noRouteAction()
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>接下來(lái),創(chuàng)建AddController.php文件:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    class AddController extends Zend_Controller_Action
    {
      function indexAction()
      {
        $this->_redirect('/');
      }
      function commentAction()
      {
        /* Add a comment. */
      }
      function newsAction()
      {
        /* Add news. */
      }
      function __call($action, $arguments)
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>記住AddController的indexAction()方法不能調(diào)用。當(dāng)訪問(wèn)/add時(shí)會(huì)執(zhí)行這個(gè)類方法。因?yàn)橛脩艨梢允止ぴL問(wèn)這個(gè)網(wǎng)址,這是有可能的,所以你要把用戶重定向到主頁(yè)、顯示錯(cuò)誤或你認(rèn)為合適的行為。</p>
    <p>接下來(lái),創(chuàng)建AdminController.php文件:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    class AdminController extends Zend_Controller_Action
    {
      function indexAction()
      {
        /* Display admin interface. */
      }
      function approveAction()
      {
        /* Approve news. */
      }
      function __call($action, $arguments)
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>最后,創(chuàng)建ViewController.php文件:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    Zend::loadClass('Zend_Controller_Action');
    class ViewController extends Zend_Controller_Action
    {
      function indexAction()
      {
        $this->_redirect('/');
      }
      function __call($id, $arguments)
      {
        /* Display news and comments for $id. */
      }
    }
    &#63;>
    
    </pre>
    
    <p>和AddController一樣,index()方法不能調(diào)用,所以你可以使用你認(rèn)為合適的action。ViewController和其它的有點(diǎn)不同,因?yàn)槟悴恢朗裁床攀怯行У腶ction。為了支持像/view/23這樣的網(wǎng)址,你要使用__call()來(lái)支持動(dòng)態(tài)action。</p>
    <p><strong>數(shù)據(jù)庫(kù)操作</strong></p>
    <p>因?yàn)閆end Framework的數(shù)據(jù)庫(kù)組件還不穩(wěn)定,而我希望這個(gè)演示可以做得簡(jiǎn)單一點(diǎn)。我使用了一個(gè)簡(jiǎn)單的類,用SQLite進(jìn)行新聞條目和評(píng)論的存儲(chǔ)和查詢。</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    class Database
    {
      private $_db;
      public function __construct($filename)
      {
        $this->_db = new SQLiteDatabase($filename);
      }
      public function addComment($name, $comment, $newsId)
      {
        $name = sqlite_escape_string($name);
        $comment = sqlite_escape_string($comment);
        $newsId = sqlite_escape_string($newsId);
        $sql = "INSERT
            INTO  comments (name, comment, newsId)
            VALUES ('$name', '$comment', '$newsId')";
        return $this->_db->query($sql);
      }
      public function addNews($title, $content)
      {
        $title = sqlite_escape_string($title);
        $content = sqlite_escape_string($content);
        $sql = "INSERT
            INTO  news (title, content)
            VALUES ('$title', '$content')";
        return $this->_db->query($sql);
      }
      public function approveNews($ids)
      {
        foreach ($ids as $id) {
          $id = sqlite_escape_string($id);
          $sql = "UPDATE news
              SET  approval = 'T'
              WHERE id = '$id'";
          if (!$this->_db->query($sql)) {
            return FALSE;
          }
        }
        return TRUE;
      }
      public function getComments($newsId)
      {
        $newsId = sqlite_escape_string($newsId);
        $sql = "SELECT name, comment
            FROM  comments
            WHERE newsId = '$newsId'";
        if ($result = $this->_db->query($sql)) {
          return $result->fetchAll();
        }
        return FALSE;
      }
      public function getNews($id = 'ALL')
      {
        $id = sqlite_escape_string($id);
        switch ($id) {
          case 'ALL':
            $sql = "SELECT id,
                    title
                FROM  news
                WHERE approval = 'T'";
            break;
          case 'NEW':
            $sql = "SELECT *
                FROM  news
                WHERE approval != 'T'";
            break;
          default:
            $sql = "SELECT *
                FROM  news
                WHERE id = '$id'";
            break;
        }
        if ($result = $this->_db->query($sql)) {
          if ($result->numRows() != 1) {
            return $result->fetchAll();
          } else {
            return $result->fetch();
          }
        }
        return FALSE;
      }
    }
    &#63;>
    
    </pre>
    
    <p>(你可以用自己的解決方案隨意替換這個(gè)類。這里只是為你提供一個(gè)完整示例的介紹,并非建議要這么實(shí)現(xiàn)。)</p>
    <p>這個(gè)類的構(gòu)造器需要SQLite數(shù)據(jù)庫(kù)的完整路徑和文件名,你必須自己進(jìn)行創(chuàng)建。</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    $db = new SQLiteDatabase('/path/to/db.sqlite');
    $db->query("CREATE TABLE news (
        id    INTEGER PRIMARY KEY,
        title  VARCHAR(255),
        content TEXT,
        approval CHAR(1) DEFAULT 'F'
      )");
    $db->query("CREATE TABLE comments (
        id    INTEGER PRIMARY KEY,
        name   VARCHAR(255),
        comment TEXT,
        newsId  INTEGER
      )");
    &#63;>
    
    </pre>
    
    <p>你只需要做一次,以后直接給出Database類構(gòu)造器的完整路徑和文件名即可:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    $db = new Database('/path/to/db.sqlite');
    &#63;>
    
    </pre>
    
    <p><strong>整合</strong></p>
    <p>為了進(jìn)行整合,在lib目錄下創(chuàng)建Database.php,loadClass()就可以找到它。你的index.php文件現(xiàn)在就會(huì)初始化$view和$db并存儲(chǔ)到寄存器。你也可以創(chuàng)建__autoload()函數(shù)自動(dòng)加載你所需要的類:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    include 'Zend.php';
    function __autoload($class)
    {
      Zend::loadClass($class);
    }
    $db = new Database('/path/to/db.sqlite');
    Zend::register('db', $db);
    $view = new Zend_View;
    $view->setScriptPath('/path/to/views');
    Zend::register('view', $view);
    $controller = Zend_Controller_Front::getInstance()
           ->setControllerDirectory('/path/to/controllers')
           ->dispatch();
    &#63;>
    
    </pre>
    
    <p>接下來(lái),在views目錄創(chuàng)建一些簡(jiǎn)單的模板。index.php可以用來(lái)顯示index視圖:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <html>
    <head>
     <title>News</title>
    </head>
    <body>
     <h1>News</h1>
     <&#63;php foreach ($this->news as $entry) { &#63;>
     <p>
      <a href="/view/<&#63;php echo $this->escape($entry['id']); &#63;>">
      <&#63;php echo $this->escape($entry['title']); &#63;>
      </a>
     </p>
     <&#63;php } &#63;>
     <h1>Add News</h1>
     <form action="/add/news" method="POST">
     <p>Title:<br /><input type="text" name="title" /></p>
     <p>Content:<br /><textarea name="content"></textarea></p>
     <p><input type="submit" value="Add News" /></p>
     </form>
    </body>
    </html>
    
    </pre>
    
    <p>view.php模板可以用來(lái)顯示選定的新聞條目:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <html>
    <head>
     <title>
      <&#63;php echo $this->escape($this->news['title']); &#63;>
     </title>
    </head>
    <body>
     <h1>
      <&#63;php echo $this->escape($this->news['title']); &#63;>
     </h1>
     <p>
      <&#63;php echo $this->escape($this->news['content']); &#63;>
     </p>
     <h1>Comments</h1>
     <&#63;php foreach ($this->comments as $comment) { &#63;>
     <p>
      <&#63;php echo $this->escape($comment['name']); &#63;> writes:
     </p>
     <blockquote>
      <&#63;php echo $this->escape($comment['comment']); &#63;>
     </blockquote>
     <&#63;php } &#63;>
     <h1>Add a Comment</h1>
     <form action="/add/comment" method="POST">
     <input type="hidden" name="newsId" 
      value="<&#63;php echo $this->escape($this->id); &#63;>" />
     <p>Name:<br /><input type="text" name="name" /></p>
     <p>Comment:<br /><textarea name="comment"></textarea></p>
     <p><input type="submit" value="Add Comment" /></p>
     </form>
    </body>
    </html>
    
    </pre>
    
    <p>最后,admin.php模板可以用來(lái)批準(zhǔn)新聞條目:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <html>
    <head>
     <title>News Admin</title>
    </head>
    <body>
     <form action="/admin/approve" method="POST">
     <&#63;php foreach ($this->news as $entry) { &#63;>
     <p>
      <input type="checkbox" name="ids[]"
      value="<&#63;php echo $this->escape($entry['id']); &#63;>" />
      <&#63;php echo $this->escape($entry['title']); &#63;>
      <&#63;php echo $this->escape($entry['content']); &#63;>
     </p>
     <&#63;php } &#63;>
     <p>
      Password:<br /><input type="password" name="password" />
     </p>
     <p><input type="submit" value="Approve" /></p>
     </form>
    </body>
    </html>
    
    </pre>
    
    <p>提示:為了保持簡(jiǎn)單,這個(gè)表單用密碼作為驗(yàn)證機(jī)制。</p>
    <p>使用到模板的地方,你只需要把注釋替換成幾行代碼。如IndexController.php就變成下面這樣:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    class IndexController extends Zend_Controller_Action 
    {
      public function indexAction()
      {
        /* List the news. */
        $db = Zend::registry('db');
        $view = Zend::registry('view');
        $view->news = $db->getNews();
        echo $view->render('index.php');
      }
      public function noRouteAction()
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>因?yàn)闂l理比較清楚,這個(gè)程序首頁(yè)的整個(gè)業(yè)務(wù)邏輯只有四行代碼。AddController.php更復(fù)雜一點(diǎn),它需要更多的代碼:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    class AddController extends Zend_Controller_Action
    {
      function indexAction()
      {
        $this->_redirect('/');
      }
      function commentAction()
      {
        /* Add a comment. */
        $filterPost = new Zend_InputFilter($_POST);
        $db = Zend::registry('db');
        $name = $filterPost->getAlpha('name');
        $comment = $filterPost->noTags('comment');
        $newsId = $filterPost->getDigits('newsId');
        $db->addComment($name, $comment, $newsId);
        $this->_redirect("/view/$newsId");
      }
      function newsAction()
      {
        /* Add news. */
        $filterPost = new Zend_InputFilter($_POST);
        $db = Zend::registry('db');
        $title = $filterPost->noTags('title');
        $content = $filterPost->noTags('content');
        $db->addNews($title, $content);
        $this->_redirect('/');
      }
      function __call($action, $arguments)
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>因?yàn)橛脩粼谔峤槐韱魏蟊恢囟ㄏ?,這個(gè)controller不需要視圖。</p>
    <p>在AdminController.php,你要處理顯示管理界面和批準(zhǔn)新聞兩個(gè)action:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    class AdminController extends Zend_Controller_Action
    {
      function indexAction()
      {
        /* Display admin interface. */
        $db = Zend::registry('db');
        $view = Zend::registry('view');
        $view->news = $db->getNews('NEW');
        echo $view->render('admin.php');
      }
      function approveAction()
      {
        /* Approve news. */
        $filterPost = new Zend_InputFilter($_POST);
        $db = Zend::registry('db');
        if ($filterPost->getRaw('password') == 'mypass') {
          $db->approveNews($filterPost->getRaw('ids'));
          $this->_redirect('/');
        } else {
          echo 'The password is incorrect.';
        }
      }
      function __call($action, $arguments)
      {
        $this->_redirect('/');
      }
    }
    &#63;>
    
    </pre>
    
    <p>最后是ViewController.php:</p>
    
    <pre class='brush:php;toolbar:false;'>
    <&#63;php
    class ViewController extends Zend_Controller_Action
    {
      function indexAction()
      {
        $this->_redirect('/');
      }
      function __call($id, $arguments)
      {
        /* Display news and comments for $id. */
        $id = Zend_Filter::getDigits($id);
        $db = Zend::registry('db');
        $view = Zend::registry('view');
        $view->news = $db->getNews($id);
        $view->comments = $db->getComments($id);
        $view->id = $id;
        echo $view->render('view.php');
      }
    }
    &#63;>
    
    </pre>
    
    <p>雖然很簡(jiǎn)單,但我們還是提供了一個(gè)功能較全的新聞和評(píng)論程序。最好的地方是由于有較好的設(shè)計(jì),增加功能變得很簡(jiǎn)單。而且隨著Zend Framework越來(lái)越成熟,只會(huì)變得更好。</p>
    <p><strong>更多信息</strong></p>
    <p>這個(gè)教程只是討論了ZF表面的一些功能,但現(xiàn)在也有一些其它的資源可供參考。在http://framework.zend.com/manual/有手冊(cè)可以查詢,Rob Allen在http://akrabat.com/zend-framework/介紹了一些他使用Zend Framework的經(jīng)驗(yàn),而Richard Thomas也在http://www.cyberlot.net/zendframenotes提供了一些有用的筆記。如果你有自己的想法,可以訪問(wèn)Zend Framework的新論壇:http://www.phparch.com/discuss/index.php/f/289//。</p>
    <p><strong>結(jié)束語(yǔ)</strong></p>
    <p>要對(duì)預(yù)覽版進(jìn)行評(píng)價(jià)是很容易的事,我在寫這個(gè)教程時(shí)也遇到很多困難??偟膩?lái)說(shuō),我想Zend Framework顯示了承諾,加入的每個(gè)人都是想繼續(xù)完善它。</p>
    <p>更多關(guān)于zend相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Zend FrameWork框架入門教程》、《php優(yōu)秀開(kāi)發(fā)框架總結(jié)》、《Yii框架入門及常用技巧總結(jié)》、《ThinkPHP入門教程》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》、《php+mysql數(shù)據(jù)庫(kù)操作入門教程》及《php常見(jiàn)數(shù)據(jù)庫(kù)操作技巧匯總》</p>
    <p>I hope this article will be helpful to everyone’s PHP programming based on the Zend Framework framework. </p>
    
    
    <!--endmain-->
    
    <h4 id="Articles-you-may-be-interested-in">Articles you may be interested in:</h4>
    <ul>
    <li>Zend Framework Tutorial - Zend_Db_Table_Rowset Usage Example Analysis</li>
    <li>Zend Framework Tutorial - Zend_Db_Table_Row Usage Example Analysis</li>
    <li>Zend Framework Detailed explanation of the usage of Zend_Db_Table in the tutorial </li>
    <li>Zend Framework tutorial Zend_Form component to implement form submission and display error prompts</li>
    <li>Zend Framework Smarty extension implementation method</li>
    <li>Zend Framework routing mechanism Code analysis</li>
    <li>Zend Framework implements a guestbook with basic functions (with demo source code download)</li>
    <li>Zend Framework implements the method of storing sessions in memcache</li>
    <li>Zend Framework paging class Detailed explanation of usage</li>
    <li>Zend Framework implementation of multi-file upload function example</li>
    <li>Environment configuration for getting started with Zend Framework and the first Hello World example (with demo source code download)</li>
    <li>Zend Framework tutorial How to connect to the database and perform add/delete queries (with demo source code download)</li>
    <li>Detailed explanation of the Zend_Db_Table table association example in the Zend Framework tutorial</li>
    </ul>
    <p align="left"></p>
    <div style="display:none;">
    <span id="url" itemprop="url">http://www.bkjia.com/PHPjc/1113710.html</span><span id="indexUrl" itemprop="indexUrl">www.bkjia.com</span><span id="isOriginal" itemprop="isOriginal">true</span><span id="isBasedOnUrl" itemprop="isBasedOnUrl">http: //www.bkjia.com/PHPjc/1113710.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description">A classic tutorial for getting started with Zend Framework development, zendframework. This article tells the knowledge points related to getting started with Zend Framework development. Share it with everyone for your reference, the details are as follows: Zend Framework released...</span>
    </div>
    <div   id="377j5v51b"   class="art_confoot"></div>
    
    
    						</div>
    					</div>
    					<div   id="377j5v51b"   class="wzconShengming_sp">
    						<div   id="377j5v51b"   class="bzsmdiv_sp">Statement of this Website</div>
    						<div>The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn</div>
    					</div>
    				</div>
    
    				<ins class="adsbygoogle"
         style="display:block"
         data-ad-format="autorelaxed"
         data-ad-client="ca-pub-5902227090019525"
         data-ad-slot="2507867629"></ins>
    
    
    
    				<div   id="377j5v51b"   class="AI_ToolDetails_main4sR">
    
    
    				<ins class="adsbygoogle"
            style="display:block"
            data-ad-client="ca-pub-5902227090019525"
            data-ad-slot="3653428331"
            data-ad-format="auto"
            data-full-width-responsive="true"></ins>
        
    
    
    					<!-- <div   id="377j5v51b"   class="phpgenera_Details_mainR4">
    						<div   id="377j5v51b"   class="phpmain1_4R_readrank">
    							<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
    								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									src="/static/imghw/hotarticle2.png" alt="" />
    								<h2>Hot Article</h2>
    							</div>
    							<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottom">
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796821119.html" title="Guide: Stellar Blade Save File Location/Save File Lost/Not Saving" class="phpgenera_Details_mainR4_bottom_title">Guide: Stellar Blade Save File Location/Save File Lost/Not Saving</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 weeks ago</span>
    										<span>By DDD</span>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796827210.html" title="Oguri Cap Build Guide | A Pretty Derby Musume" class="phpgenera_Details_mainR4_bottom_title">Oguri Cap Build Guide | A Pretty Derby Musume</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>2 weeks ago</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796828723.html" title="Agnes Tachyon Build Guide | A Pretty Derby Musume" class="phpgenera_Details_mainR4_bottom_title">Agnes Tachyon Build Guide | A Pretty Derby Musume</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>2 weeks ago</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796821436.html" title="Dune: Awakening - Advanced Planetologist Quest Walkthrough" class="phpgenera_Details_mainR4_bottom_title">Dune: Awakening - Advanced Planetologist Quest Walkthrough</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 weeks ago</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796821278.html" title="Date Everything: Dirk And Harper Relationship Guide" class="phpgenera_Details_mainR4_bottom_title">Date Everything: Dirk And Harper Relationship Guide</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 weeks ago</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    														</div>
    							<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
    								<a href="http://www.miracleart.cn/article.html">Show More</a>
    							</div>
    						</div>
    					</div> -->
    
    
    											<div   id="377j5v51b"   class="phpgenera_Details_mainR3">
    							<div   id="377j5v51b"   class="phpmain1_4R_readrank">
    								<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/hottools2.png" alt="" />
    									<h2>Hot AI Tools</h2>
    								</div>
    								<div   id="377j5v51b"   class="phpgenera_Details_mainR3_bottom">
    																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title">
    													<h3>Undress AI Tool</h3>
    												</a>
    												<p>Undress images for free</p>
    											</div>
    										</div>
    																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title">
    													<h3>Undresser.AI Undress</h3>
    												</a>
    												<p>AI-powered app for creating realistic nude photos</p>
    											</div>
    										</div>
    																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title">
    													<h3>AI Clothes Remover</h3>
    												</a>
    												<p>Online AI tool for removing clothes from photos.</p>
    											</div>
    										</div>
    																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title">
    													<h3>Clothoff.io</h3>
    												</a>
    												<p>AI clothes remover</p>
    											</div>
    										</div>
    																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173414504068133.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Video Face Swap" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_title">
    													<h3>Video Face Swap</h3>
    												</a>
    												<p>Swap faces in any video effortlessly with our completely free AI face swap tool!</p>
    											</div>
    										</div>
    																</div>
    								<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
    									<a href="http://www.miracleart.cn/ai">Show More</a>
    								</div>
    							</div>
    						</div>
    					
    
    
    					<div   id="377j5v51b"   class="phpgenera_Details_mainR4">
    						<div   id="377j5v51b"   class="phpmain1_4R_readrank">
    							<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
    								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									src="/static/imghw/hotarticle2.png" alt="" />
    								<h2>Hot Article</h2>
    							</div>
    							<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottom">
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796821119.html" title="Guide: Stellar Blade Save File Location/Save File Lost/Not Saving" class="phpgenera_Details_mainR4_bottom_title">Guide: Stellar Blade Save File Location/Save File Lost/Not Saving</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 weeks ago</span>
    										<span>By DDD</span>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796827210.html" title="Oguri Cap Build Guide | A Pretty Derby Musume" class="phpgenera_Details_mainR4_bottom_title">Oguri Cap Build Guide | A Pretty Derby Musume</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>2 weeks ago</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796828723.html" title="Agnes Tachyon Build Guide | A Pretty Derby Musume" class="phpgenera_Details_mainR4_bottom_title">Agnes Tachyon Build Guide | A Pretty Derby Musume</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>2 weeks ago</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796821436.html" title="Dune: Awakening - Advanced Planetologist Quest Walkthrough" class="phpgenera_Details_mainR4_bottom_title">Dune: Awakening - Advanced Planetologist Quest Walkthrough</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 weeks ago</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/1796821278.html" title="Date Everything: Dirk And Harper Relationship Guide" class="phpgenera_Details_mainR4_bottom_title">Date Everything: Dirk And Harper Relationship Guide</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 weeks ago</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    														</div>
    							<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
    								<a href="http://www.miracleart.cn/article.html">Show More</a>
    							</div>
    						</div>
    					</div>
    
    
    											<div   id="377j5v51b"   class="phpgenera_Details_mainR3">
    							<div   id="377j5v51b"   class="phpmain1_4R_readrank">
    								<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/hottools2.png" alt="" />
    									<h2>Hot Tools</h2>
    								</div>
    								<div   id="377j5v51b"   class="phpgenera_Details_mainR3_bottom">
    																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Notepad++7.3.1" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_title">
    													<h3>Notepad++7.3.1</h3>
    												</a>
    												<p>Easy-to-use and free code editor</p>
    											</div>
    										</div>
    																			<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/toolset/development-tools/93" title="SublimeText3 Chinese version" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Chinese version" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/toolset/development-tools/93" title="SublimeText3 Chinese version" class="phpmain_tab2_mids_title">
    													<h3>SublimeText3 Chinese version</h3>
    												</a>
    												<p>Chinese version, very easy to use</p>
    											</div>
    										</div>
    																			<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/toolset/development-tools/121" title="Zend Studio 13.0.1" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Zend Studio 13.0.1" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/toolset/development-tools/121" title="Zend Studio 13.0.1" class="phpmain_tab2_mids_title">
    													<h3>Zend Studio 13.0.1</h3>
    												</a>
    												<p>Powerful PHP integrated development environment</p>
    											</div>
    										</div>
    																			<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Dreamweaver CS6" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title">
    													<h3>Dreamweaver CS6</h3>
    												</a>
    												<p>Visual web development tools</p>
    											</div>
    										</div>
    																			<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
    											<a href="http://www.miracleart.cn/toolset/development-tools/500" title="SublimeText3 Mac version" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac version" />
    											</a>
    											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
    												<a href="http://www.miracleart.cn/toolset/development-tools/500" title="SublimeText3 Mac version" class="phpmain_tab2_mids_title">
    													<h3>SublimeText3 Mac version</h3>
    												</a>
    												<p>God-level code editing software (SublimeText3)</p>
    											</div>
    										</div>
    																	</div>
    								<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
    									<a href="http://www.miracleart.cn/ai">Show More</a>
    								</div>
    							</div>
    						</div>
    										
    
    					
    					<div   id="377j5v51b"   class="phpgenera_Details_mainR4">
    						<div   id="377j5v51b"   class="phpmain1_4R_readrank">
    							<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
    								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									src="/static/imghw/hotarticle2.png" alt="" />
    								<h2>Hot Topics</h2>
    							</div>
    							<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottom">
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/gmailyxdlrkzn" title="Where is the login entrance for gmail email?" class="phpgenera_Details_mainR4_bottom_title">Where is the login entrance for gmail email?</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/eyess.png" alt="" />
    											<span>8638</span>
    										</div>
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/tiezi.png" alt="" />
    											<span>17</span>
    										</div>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/java-tutorial" title="Java Tutorial" class="phpgenera_Details_mainR4_bottom_title">Java Tutorial</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/eyess.png" alt="" />
    											<span>1784</span>
    										</div>
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/tiezi.png" alt="" />
    											<span>16</span>
    										</div>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/cakephp-tutor" title="CakePHP Tutorial" class="phpgenera_Details_mainR4_bottom_title">CakePHP Tutorial</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/eyess.png" alt="" />
    											<span>1729</span>
    										</div>
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/tiezi.png" alt="" />
    											<span>56</span>
    										</div>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/laravel-tutori" title="Laravel Tutorial" class="phpgenera_Details_mainR4_bottom_title">Laravel Tutorial</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/eyess.png" alt="" />
    											<span>1580</span>
    										</div>
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/tiezi.png" alt="" />
    											<span>28</span>
    										</div>
    									</div>
    								</div>
    															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://www.miracleart.cn/faq/php-tutorial" title="PHP Tutorial" class="phpgenera_Details_mainR4_bottom_title">PHP Tutorial</a>
    									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/eyess.png" alt="" />
    											<span>1445</span>
    										</div>
    										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/tiezi.png" alt="" />
    											<span>31</span>
    										</div>
    									</div>
    								</div>
    														</div>
    							<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
    								<a href="http://www.miracleart.cn/faq/zt">Show More</a>
    							</div>
    						</div>
    					</div>
    				</div>
    			</div>
    							<div   id="377j5v51b"   class="Article_Details_main2">
    					<div   id="377j5v51b"   class="phpgenera_Details_mainL4">
    						<div   id="377j5v51b"   class="phpmain1_2_top">
    							<a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img
    									src="/static/imghw/index2_title2.png" alt="" /></a>
    						</div>
    						<div   id="377j5v51b"   class="phpgenera_Details_mainL4_info">
    
    													<div   id="377j5v51b"   class="phphistorical_Version2_mids">
    								<a href="http://www.miracleart.cn/faq/1796551949.html" title="Generate PPT with one click! Kimi: Let the 'PPT migrant workers' become popular first" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/000/164/172249729336303.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Generate PPT with one click! Kimi: Let the 'PPT migrant workers' become popular first" />
    								</a>
    								<a href="http://www.miracleart.cn/faq/1796551949.html" title="Generate PPT with one click! Kimi: Let the 'PPT migrant workers' become popular first" class="phphistorical_Version2_mids_title">Generate PPT with one click! Kimi: Let the 'PPT migrant workers' become popular first</a>
    								<span id="377j5v51b"    class="Articlelist_txts_time">Aug 01, 2024 pm	 03:28 PM</span>
    								<p class="Articlelist_txts_p">Kimi: In just one sentence, in just ten seconds, a PPT will be ready. PPT is so annoying! To hold a meeting, you need to have a PPT; to write a weekly report, you need to have a PPT; to make an investment, you need to show a PPT; even when you accuse someone of cheating, you have to send a PPT. College is more like studying a PPT major. You watch PPT in class and do PPT after class. Perhaps, when Dennis Austin invented PPT 37 years ago, he did not expect that one day PPT would become so widespread. Talking about our hard experience of making PPT brings tears to our eyes. "It took three months to make a PPT of more than 20 pages, and I revised it dozens of times. I felt like vomiting when I saw the PPT." "At my peak, I did five PPTs a day, and even my breathing was PPT." If you have an impromptu meeting, you should do it</p>
    							</div>
    														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
    								<a href="http://www.miracleart.cn/faq/737071.html" title="A Diffusion Model Tutorial Worth Your Time, from Purdue University" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/000/164/171245167345609.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="A Diffusion Model Tutorial Worth Your Time, from Purdue University" />
    								</a>
    								<a href="http://www.miracleart.cn/faq/737071.html" title="A Diffusion Model Tutorial Worth Your Time, from Purdue University" class="phphistorical_Version2_mids_title">A Diffusion Model Tutorial Worth Your Time, from Purdue University</a>
    								<span id="377j5v51b"    class="Articlelist_txts_time">Apr 07, 2024 am	 09:01 AM</span>
    								<p class="Articlelist_txts_p">Diffusion can not only imitate better, but also "create". The diffusion model (DiffusionModel) is an image generation model. Compared with the well-known algorithms such as GAN and VAE in the field of AI, the diffusion model takes a different approach. Its main idea is a process of first adding noise to the image and then gradually denoising it. How to denoise and restore the original image is the core part of the algorithm. The final algorithm is able to generate an image from a random noisy image. In recent years, the phenomenal growth of generative AI has enabled many exciting applications in text-to-image generation, video generation, and more. The basic principle behind these generative tools is the concept of diffusion, a special sampling mechanism that overcomes the limitations of previous methods.</p>
    							</div>
    														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
    								<a href="http://www.miracleart.cn/faq/1796504460.html" title="All CVPR 2024 awards announced! Nearly 10,000 people attended the conference offline, and a Chinese researcher from Google won the best paper award" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/465/014/171887658653689.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="All CVPR 2024 awards announced! Nearly 10,000 people attended the conference offline, and a Chinese researcher from Google won the best paper award" />
    								</a>
    								<a href="http://www.miracleart.cn/faq/1796504460.html" title="All CVPR 2024 awards announced! Nearly 10,000 people attended the conference offline, and a Chinese researcher from Google won the best paper award" class="phphistorical_Version2_mids_title">All CVPR 2024 awards announced! Nearly 10,000 people attended the conference offline, and a Chinese researcher from Google won the best paper award</a>
    								<span id="377j5v51b"    class="Articlelist_txts_time">Jun 20, 2024 pm	 05:43 PM</span>
    								<p class="Articlelist_txts_p">In the early morning of June 20th, Beijing time, CVPR2024, the top international computer vision conference held in Seattle, officially announced the best paper and other awards. This year, a total of 10 papers won awards, including 2 best papers and 2 best student papers. In addition, there were 2 best paper nominations and 4 best student paper nominations. The top conference in the field of computer vision (CV) is CVPR, which attracts a large number of research institutions and universities every year. According to statistics, a total of 11,532 papers were submitted this year, and 2,719 were accepted, with an acceptance rate of 23.6%. According to Georgia Institute of Technology’s statistical analysis of CVPR2024 data, from the perspective of research topics, the largest number of papers is image and video synthesis and generation (Imageandvideosyn</p>
    							</div>
    														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
    								<a href="http://www.miracleart.cn/faq/1796558557.html" title="AI in use | AI created a life vlog of a girl living alone, which received tens of thousands of likes in 3 days" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/887/227/172304241362236.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="AI in use | AI created a life vlog of a girl living alone, which received tens of thousands of likes in 3 days" />
    								</a>
    								<a href="http://www.miracleart.cn/faq/1796558557.html" title="AI in use | AI created a life vlog of a girl living alone, which received tens of thousands of likes in 3 days" class="phphistorical_Version2_mids_title">AI in use | AI created a life vlog of a girl living alone, which received tens of thousands of likes in 3 days</a>
    								<span id="377j5v51b"    class="Articlelist_txts_time">Aug 07, 2024 pm	 10:53 PM</span>
    								<p class="Articlelist_txts_p">Editor of the Machine Power Report: Yang Wen The wave of artificial intelligence represented by large models and AIGC has been quietly changing the way we live and work, but most people still don’t know how to use it. Therefore, we have launched the "AI in Use" column to introduce in detail how to use AI through intuitive, interesting and concise artificial intelligence use cases and stimulate everyone's thinking. We also welcome readers to submit innovative, hands-on use cases. Video link: https://mp.weixin.qq.com/s/2hX_i7li3RqdE4u016yGhQ Recently, the life vlog of a girl living alone became popular on Xiaohongshu. An illustration-style animation, coupled with a few healing words, can be easily picked up in just a few days.</p>
    							</div>
    														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
    								<a href="http://www.miracleart.cn/faq/1796544567.html" title="From bare metal to a large model with 70 billion parameters, here is a tutorial and ready-to-use scripts" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/465/014/172182321160025.png?x-oss-process=image/resize,m_fill,h_207,w_330" alt="From bare metal to a large model with 70 billion parameters, here is a tutorial and ready-to-use scripts" />
    								</a>
    								<a href="http://www.miracleart.cn/faq/1796544567.html" title="From bare metal to a large model with 70 billion parameters, here is a tutorial and ready-to-use scripts" class="phphistorical_Version2_mids_title">From bare metal to a large model with 70 billion parameters, here is a tutorial and ready-to-use scripts</a>
    								<span id="377j5v51b"    class="Articlelist_txts_time">Jul 24, 2024 pm	 08:13 PM</span>
    								<p class="Articlelist_txts_p">We know that LLM is trained on large-scale computer clusters using massive data. This site has introduced many methods and technologies used to assist and improve the LLM training process. Today, what we want to share is an article that goes deep into the underlying technology and introduces how to turn a bunch of "bare metals" without even an operating system into a computer cluster for training LLM. This article comes from Imbue, an AI startup that strives to achieve general intelligence by understanding how machines think. Of course, turning a bunch of "bare metal" without an operating system into a computer cluster for training LLM is not an easy process, full of exploration and trial and error, but Imbue finally successfully trained an LLM with 70 billion parameters. and in the process accumulate</p>
    							</div>
    														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
    								<a href="http://www.miracleart.cn/faq/709468.html" title="How to get help in Windows 11" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/465/014/171048363557241.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="How to get help in Windows 11" />
    								</a>
    								<a href="http://www.miracleart.cn/faq/709468.html" title="How to get help in Windows 11" class="phphistorical_Version2_mids_title">How to get help in Windows 11</a>
    								<span id="377j5v51b"    class="Articlelist_txts_time">Mar 15, 2024 pm	 02:20 PM</span>
    								<p class="Articlelist_txts_p">After getting used to the interface of previous versions of Windows, it may be challenging to adapt to Windows 11. But don’t worry, Windows 11 provides a wealth of help resources to help you master various functions more easily. This article will guide you how to use the tools that come with Windows 11 to obtain support so that you can quickly find official solutions when you encounter problems. Method 1: Use the “Getting Started” app Windows 11’s “Getting Started” app is a great mentor for beginners. It helps users easily complete the basic settings of the system and introduces new features concisely. Follow its guidance and you will quickly become familiar with this new operating system. 1Click the &quot;Start&quot; menu, find and click the &quot;Getting Started&quot; app, and select &quot;Get Started&quot;. Click</p>
    							</div>
    														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
    								<a href="http://www.miracleart.cn/faq/660870.html" title="PyCharm Community Edition Installation Guide: Quickly master all the steps" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/465/014/170631781359726.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PyCharm Community Edition Installation Guide: Quickly master all the steps" />
    								</a>
    								<a href="http://www.miracleart.cn/faq/660870.html" title="PyCharm Community Edition Installation Guide: Quickly master all the steps" class="phphistorical_Version2_mids_title">PyCharm Community Edition Installation Guide: Quickly master all the steps</a>
    								<span id="377j5v51b"    class="Articlelist_txts_time">Jan 27, 2024 am	 09:10 AM</span>
    								<p class="Articlelist_txts_p">Quick Start with PyCharm Community Edition: Detailed Installation Tutorial Full Analysis Introduction: PyCharm is a powerful Python integrated development environment (IDE) that provides a comprehensive set of tools to help developers write Python code more efficiently. This article will introduce in detail how to install PyCharm Community Edition and provide specific code examples to help beginners get started quickly. Step 1: Download and install PyCharm Community Edition To use PyCharm, you first need to download it from its official website</p>
    							</div>
    														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
    								<a href="http://www.miracleart.cn/faq/717976.html" title="A must-read for technical beginners: Analysis of the difficulty levels of C language and Python" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/887/227/171107406481267.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="A must-read for technical beginners: Analysis of the difficulty levels of C language and Python" />
    								</a>
    								<a href="http://www.miracleart.cn/faq/717976.html" title="A must-read for technical beginners: Analysis of the difficulty levels of C language and Python" class="phphistorical_Version2_mids_title">A must-read for technical beginners: Analysis of the difficulty levels of C language and Python</a>
    								<span id="377j5v51b"    class="Articlelist_txts_time">Mar 22, 2024 am	 10:21 AM</span>
    								<p class="Articlelist_txts_p">Title: A must-read for technical beginners: Difficulty analysis of C language and Python, requiring specific code examples In today's digital age, programming technology has become an increasingly important ability. Whether you want to work in fields such as software development, data analysis, artificial intelligence, or just learn programming out of interest, choosing a suitable programming language is the first step. Among many programming languages, C language and Python are two widely used programming languages, each with its own characteristics. This article will analyze the difficulty levels of C language and Python</p>
    							</div>
    													</div>
    
    													<a href="http://www.miracleart.cn/be/" class="phpgenera_Details_mainL4_botton">
    								<span>See all articles</span>
    								<img src="/static/imghw/down_right.png" alt="" />
    							</a>
    											</div>
    				</div>
    					</div>
    	</main>
    	<footer>
        <div   id="377j5v51b"   class="footer">
            <div   id="377j5v51b"   class="footertop">
                <img src="/static/imghw/logo.png" alt="">
                <p>Public welfare online PHP training,Help PHP learners grow quickly!</p>
            </div>
            <div   id="377j5v51b"   class="footermid">
                <a href="http://www.miracleart.cn/about/us.html">About us</a>
                <a href="http://www.miracleart.cn/about/disclaimer.html">Disclaimer</a>
                <a href="http://www.miracleart.cn/update/article_0_1.html">Sitemap</a>
            </div>
            <div   id="377j5v51b"   class="footerbottom">
                <p>
                    ? php.cn All rights reserved
                </p>
            </div>
        </div>
    </footer>
    
    <input type="hidden" id="verifycode" value="/captcha.html">
    
    
    
    
    		<link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' />
    	
    	
    	
    	
    	
    
    	
    	
    
    
    
    
    
    
    <footer>
    <div class="friendship-link">
    <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p>
    <a href="http://www.miracleart.cn/" title="国产av日韩一区二区三区精品">国产av日韩一区二区三区精品</a>
    
    <div class="friend-links">
    
    
    </div>
    </div>
    
    </footer>
    
    
    <script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
    </script>
    </body><div id="ic6ce" class="pl_css_ganrao" style="display: none;"><em id="ic6ce"></em><cite id="ic6ce"></cite><delect id="ic6ce"></delect><tbody id="ic6ce"></tbody><code id="ic6ce"></code><table id="ic6ce"></table><rt id="ic6ce"><code id="ic6ce"><s id="ic6ce"></s></code></rt><object id="ic6ce"></object><menu id="ic6ce"><tr id="ic6ce"><optgroup id="ic6ce"></optgroup></tr></menu><em id="ic6ce"></em><tbody id="ic6ce"></tbody><tr id="ic6ce"><blockquote id="ic6ce"><strike id="ic6ce"></strike></blockquote></tr><center id="ic6ce"><center id="ic6ce"><tr id="ic6ce"></tr></center></center><li id="ic6ce"></li><optgroup id="ic6ce"></optgroup><tfoot id="ic6ce"></tfoot><ul id="ic6ce"><button id="ic6ce"><delect id="ic6ce"></delect></button></ul><kbd id="ic6ce"><pre id="ic6ce"><blockquote id="ic6ce"></blockquote></pre></kbd><td id="ic6ce"></td><strong id="ic6ce"></strong><option id="ic6ce"></option><th id="ic6ce"><wbr id="ic6ce"><cite id="ic6ce"></cite></wbr></th><dl id="ic6ce"><s id="ic6ce"><small id="ic6ce"></small></s></dl><center id="ic6ce"></center><delect id="ic6ce"></delect><tfoot id="ic6ce"></tfoot><wbr id="ic6ce"><bdo id="ic6ce"><input id="ic6ce"></input></bdo></wbr><fieldset id="ic6ce"></fieldset><ul id="ic6ce"></ul><noframes id="ic6ce"></noframes><abbr id="ic6ce"></abbr><input id="ic6ce"></input><li id="ic6ce"></li><tr id="ic6ce"></tr><option id="ic6ce"></option><code id="ic6ce"><em id="ic6ce"><li id="ic6ce"></li></em></code><nav id="ic6ce"><abbr id="ic6ce"><abbr id="ic6ce"></abbr></abbr></nav><wbr id="ic6ce"></wbr><tfoot id="ic6ce"></tfoot><th id="ic6ce"></th><object id="ic6ce"></object><menu id="ic6ce"><code id="ic6ce"><optgroup id="ic6ce"></optgroup></code></menu><menu id="ic6ce"></menu><input id="ic6ce"></input><del id="ic6ce"></del><strong id="ic6ce"></strong><fieldset id="ic6ce"></fieldset><input id="ic6ce"><strong id="ic6ce"><nav id="ic6ce"></nav></strong></input><kbd id="ic6ce"></kbd></div>
    
    </html>