瀏覽代碼

[ZF-6977]zf.sh create project generates wrong HTML in views/script/index/index.phtml

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@15995 44c647ce-9c0f-0410-b52a-842ac1e357ba
yoshida@zend.co.jp 16 年之前
父節點
當前提交
ea11f974e7
共有 1 個文件被更改,包括 49 次插入50 次删除
  1. 49 50
      library/Zend/Tool/Project/Context/Zf/ViewScriptFile.php

+ 49 - 50
library/Zend/Tool/Project/Context/Zf/ViewScriptFile.php

@@ -30,7 +30,7 @@ require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
  *
  * A profile is a hierarchical set of resources that keep track of
  * items within a specific project.
- * 
+ *
  * @category   Zend
  * @package    Zend_Tool
  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
@@ -38,17 +38,17 @@ require_once 'Zend/Tool/Project/Context/Filesystem/File.php';
  */
 class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Context_Filesystem_File
 {
-    
+
     /**
      * @var string
      */
     protected $_filesystemName = 'view.phtml';
-    
+
     /**
      * @var string
      */
     protected $_forActionName = null;
-    
+
     /**
      * @var string
      */
@@ -63,7 +63,7 @@ class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Cont
     {
         return 'ViewScriptFile';
     }
-    
+
     /**
      * init()
      *
@@ -80,11 +80,11 @@ class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Cont
         } else {
             throw new Exception('Either a forActionName or scriptName is required.');
         }
-        
+
         parent::init();
         return $this;
     }
-    
+
     /**
      * getPersistentAttributes()
      *
@@ -93,18 +93,18 @@ class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Cont
     public function getPersistentAttributes()
     {
         $attributes = array();
-        
+
         if ($this->_forActionName) {
-            $attributes['forActionName'] = $this->_forActionName;      
+            $attributes['forActionName'] = $this->_forActionName;
         }
-        
+
         if ($this->_scriptName) {
             $attributes['scriptName'] = $this->_scriptName;
         }
-        
+
         return $attributes;
     }
-    
+
     /**
      * getContents()
      *
@@ -113,44 +113,44 @@ class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Cont
     public function getContents()
     {
         $contents = '';
-        
+
         if ($this->_filesystemName == 'error.phtml') {  // should also check that the above directory is forController=error
             $contents .= <<<EOS
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> 
-<html xmlns="http://www.w3.org/1999/xhtml"> 
-<head>  
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
-  <title>Zend Framework Default Application</title> 
-</head> 
-<body> 
-  <h1>An error occurred</h1> 
-  <h2><?= \$this->message ?></h2> 
-
-  <? if ('development' == APPLICATION_ENV): ?> 
-  
-  <h3>Exception information:</h3> 
-  <p> 
-      <b>Message:</b> <?= \$this->exception->getMessage() ?> 
-  </p> 
-
-  <h3>Stack trace:</h3> 
-  <pre><?= \$this->exception->getTraceAsString() ?> 
-  </pre> 
-
-  <h3>Request Parameters:</h3> 
-  <pre><? var_dump(\$this->request->getParams()) ?> 
-  </pre> 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <title>Zend Framework Default Application</title>
+</head>
+<body>
+  <h1>An error occurred</h1>
+  <h2><?= \$this->message ?></h2>
+
+  <? if ('development' == APPLICATION_ENV): ?>
+
+  <h3>Exception information:</h3>
+  <p>
+      <b>Message:</b> <?= \$this->exception->getMessage() ?>
+  </p>
+
+  <h3>Stack trace:</h3>
+  <pre><?= \$this->exception->getTraceAsString() ?>
+  </pre>
+
+  <h3>Request Parameters:</h3>
+  <pre><? var_dump(\$this->request->getParams()) ?>
+  </pre>
   <? endif ?>
-  
-</body> 
+
+</body>
 </html>
-            
+
 EOS;
         } elseif ($this->_forActionName == 'index' && $this->_resource->getParentResource()->getAttribute('forControllerName') == 'index') {
-            
+
             $contents =<<<EOS
 <style>
-    
+
     a:link,
     a:visited
     {
@@ -171,7 +171,7 @@ EOS;
         border: 2px solid #444444;
         overflow: hidden;
     }
-    
+
     div#more-information
     {
         background-image: url(http://framework.zend.com/images/bkg_body-bottom.gif);
@@ -181,26 +181,25 @@ EOS;
 </style>
 <center>
     <div id="welcome">
-        <center>
         <br />
-        <h1>Welcome to the <span id="zf-name">Zend Framework!</span><h1 />
-        <h3>This is your project's main page<h3 /><br /><br />
+        <h1>Welcome to the <span id="zf-name">Zend Framework!</span></h1>
+        <h3>This is your project's main page</h3><br /><br />
         <div id="more-information">
             <br />
             <img src="http://framework.zend.com/images/PoweredBy_ZF_4LightBG.png" /><br /><br />
             Helpful Links: <br />
-            <A href="http://framework.zend.com/">Zend Framework Website</a> |
-            <A href="http://framework.zend.com/manual/en/">Zend Framework Manual</a>
+            <a href="http://framework.zend.com/">Zend Framework Website</a> |
+            <a href="http://framework.zend.com/manual/en/">Zend Framework Manual</a>
         </div>
     </div>
 </center>
 EOS;
-            
+
         } else {
             $contents = '<br /><br /><center>View script for controller <b>' . $this->_resource->getParentResource()->getAttribute('forControllerName') . '</b>'
                 . ' and script/action name <b>' . $this->_forActionName . '</b></center>';
         }
         return $contents;
     }
-    
+
 }