Zend çerçevesinde resources.layout ile ilgili sorun

0 Cevap php

Ben ZF acemi değilim.

Ben görmek mümkün duyuyorum http://localhost/square/public.

Then I added var/www/square/layouts and master.phtml in the directory. I have the following /var/www/square/application/configs/appliction.ini

Ben aynı sayfayı ziyaret ettiğinizde, bir şey görünmüyor.

Ben burada yanlış ne yapıyorum?

Şimdiden teşekkürler.

application.ini

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules = ""
resources.layout.layoutPath = APPLICATION_PATH "/layouts"
resources.layout.layout = "master"


[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

Not:

  1. I set up a virtual host, so I can see it in http://square.localhost, if I take out resources.layout.layoutPath = APPLICATION_PATH "/layouts" resources.layout.layout = "master"

  2. Ben APPLICATION_PATH yankı zaman ben eklemek yoksa / var / www / kare / uygulama / modules / default / views / scripts / index / index.phtml içinde, / var / www / kare / uygulama çıkışlar

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

  3. Ben tüm dizinlere tüm dosyalar için 666 ve 777 verdik.

Güncelleme:

Hata mesajları şunlardır

Fatal error: Uncaught exception 'Zend_Controller_Router_Exception' with message 'Route home is not defined' in /var/www/square/library/Zend/Controller/Router/Rewrite.php:318 Stack trace:

0 /var/www/square/library/Zend/Controller/Router/Rewrite.php(464): Zend_Controller_Router_Rewrite->getRoute('home')

1 /var/www/square/library/Zend/View/Helper/Url.php(49): Zend_Controller_Router_Rewrite->assemble(Array, 'home', false, true)

2 [internal function]: Zend_View_Helper_Url->url(Array, 'home')

3 /var/www/square/library/Zend/View/Abstract.php(342): call_user_func_array(Array, Array)

4 /var/www/square/application/layouts/master.phtml(15): Zend_View_Abstract->__call('url', Array)

5 /var/www/square/application/layouts/master.phtml(15): Zend_View->url(Array, 'home')

6 /var/www/square/library/Zend/View.php(108): include('/var/www/square...')

7 /var/www/square/library/Zend/View/Abstract.php(880): Zend_View->_run('/var/www/square...')

8 /var/www/square/library/Zend/Layout.php(796): Zend_View_Abstract->render('master.phtml')

9 in /var/www/square/library/Zend/Controller/Router/Rewrite.php on line 318

2 güncelleyin.

Ben Zendframework Bir Başlangıç ​​Kılavuzu adında bir kitap okuyorum.

Ben master.phtml de şu var

<!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" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <base href="/" />
    <link rel="stylesheet" type="text/css" href="/css/master.css" />
  </head>
  <body>
    <div id="header">
      <div id="logo">
        <img src="/images/logo.gif" />
      </div>

      <div id="menu">
        <a href="<?php echo $this->url(array(), 'home'); ?>">HOME</a>
        <a href="<?php echo $this->url(array('page' => 'services'), 'static-content'); ?>">SERVICES</a>
        <a href="#">CONTACT</a>
      </div>
    </div>

    <div id="content">
      <?php echo $this->layout()->content ?>
    </div>

    <div id="footer">
      <p>Created with <a href="http://framework.zend.com/">Zend Framework</a>. Licensed under <a href="http://www.creativecommons.org/">Creative Commons</a>.</p>
    </div>    
  </body>
</html>

Ben dışarı yorumladı ve şimdi bir sayfa gösterir.

 <a href="<?php // echo $this->url(array(), 'home'); ?>">HOME</a>
 <a href="<?php // echo $this->url(array('page' => 'services'), 'static-content'); ?>">SERVICES</a>

0 Cevap