Layout of ZendFramework

Source: Internet
Author: User
Tags zend framework
: This article mainly introduces Layout of ZendFramework. For more information about PHP tutorials, see Layout. To display different views in the same layout, we can write a layout template file and use layout. phtml is saved in the Index. specifies the location of the file in php.

  1. Require_ Once 'zend/Layout. php ';
  2. Zend_Layout: startMvc (array ('layoutpath' => '../application/default/layouts '));

In the layout file, we can specify the style file and JavaScript script file to be used by the webpage.

  1. "Text/html; charset = utf-8"/>
  2. $ Request = Zend_Controller_Front: getInstance ()-> getRequest ();
  3. $ This-> headTitle ('use view' in the view ')
  4. -> HeadTitle ($ request-> getModuleName ())
  5. -> HeadTitle ($ request-> getActionName ())
  6. -> HeadTitle ($ request-> getControllerName ())
  7. -> SetSeparator ('| ');
  8. Echo $ this-> headTitle ();
  9. $ This-> headLink ()-> appendStylesheet ($ this-> baseUrl. "/css/style.css? 1.1.9 ")
  10. -> AppendStylesheet ($ this-> baseUrl. "/css/demo.css? 1.1.9 ");
  11. Echo $ this-> headLink ();
  12. $ This-> headScript ()-> appendFile ($ this-> baseUrl. "/js/jquery-1.2.6.js? 1.1.9 ")
  13. -> AppendFile ($ this-> baseUrl. "/js/jquery. datePicker. js? 1.1.9 ")
  14. -> AppendFile ($ this-> baseUrl. "/js/demo. js? 1.1.9 ");
  15. Echo $ this-> headScript ();
  16. ?>
  17. Partial ('header. phtml', 'default');?>
  18. Partial ('leftside. phtml', 'default');?>
  19. Layout ()-> content;?>
  20. Partial ('footer. phtml', 'default');?>

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

The above introduces Layout of Zend Framework, including The require content, and hopes to help friends who are interested in PHP tutorials.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.