zoukankan      html  css  js  c++  java
  • zend create project prepare

    1.php ini

    安装pear

    设置include_path

    2.apache

    AllowOverride

    LoadModule rerwite去掉注释

    1. <VirtualHost *:80>
    2.     ServerName quickstart.local
    3.     DocumentRoot /path/to/quickstart/public
    4.  
    5.     SetEnv APPLICATION_ENV "development"
    6.  
    7.     <Directory /path/to/quickstart/public>
    8.         DirectoryIndex index.php
    9.         AllowOverride All
    10.         Order allow,deny
    11.         Allow from all
    12.     </Directory>
    13. </VirtualHost>

    host 127.0.0.1 quickstart.local

    3.

    zf create project newproject

    htaccess

    SetEnv APPLICATION_ENV development
           
          RewriteEngine On
          RewriteCond %{REQUEST_FILENAME} -s [OR]
          RewriteCond %{REQUEST_FILENAME} -l [OR]
          RewriteCond %{REQUEST_FILENAME} -d
          RewriteRule ^.*$ - [NC,L]
          RewriteRule ^.*$ index.php [NC,L]

    layout模板文件

    zf enable layout

    配置文件中加入resources.view[] =

    配置文件中加入

    resources.layout.layout = "layout"
     resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"

    application/layouts/scripts/layout.phtml
      1. <?php echo $this->doctype() ?>  
      2. <html>  
      3. <head>  
      4.     <?php echo $this->headTitle() ?>  
      5.     <?php echo $this->headLink() ?>  
      6.     <?php echo $this->headStyle() ?>  
      7.     <?php echo $this->headScript() ?>  
      8. </head>  
      9. <body>  
      10.     <?php echo $this->layout()->content ?>  
      11. </body>  
      12. </html> 
      13. 通过在booststrap文件中加入
        1. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap  
        2. {  
        3.     protected function _initView()  
        4.     {  
        5.         // Initialize view  
        6.         $view =   Zend_View();  
        7.         $view->doctype('XHTML1_STRICT');  
        8.         $view->headTitle('My First Zend Framework Application');  
        9.    
        10.         // Add it to the ViewRenderer  
        11.         $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(  
        12.             'ViewRenderer'  
        13.         );  
        14.         $viewRenderer->setView($view);  
        15.    
        16.         // Return it, so that it can be stored by the bootstrap  
        17.         return $view;  
        18.     }  

  • 相关阅读:
    Http和Socket连接区别
    解决TCP网络传输“粘包”问题
    c# 获取MAC IP TCP列表
    《你不常用的c#之四》:Array的小抽屉ArraySegment
    《你不常用的c#之三》:Action 之怪状
    《你不常用的c#之二》:略谈GCHandle
    c#中var关键字用法
    Combotree--别样的构建层级json字符串
    一周代码秀之[11.18~11.24 linq2xml面向对象]
    这个季节的这些时候
  • 原文地址:https://www.cnblogs.com/carlos-guo/p/3348397.html
Copyright © 2011-2022 走看看