简体   繁体   中英

how to include file in zend framework view?

I am newbie to the zend framework.

I want to know how to includes files in zend framework views .

I am using index.phtml to show the data in zend framework.

index.phtml contains some php pages like:

require_once ('/_incl/functions.php');
include('../functions.php');

Now I want to know where I put these files and call to index.phtml page.

What I can do to include these files, means where is the right place to keep all these files, and call from index.phtml page.

I totally understand how it feels to be a newbie. No, you do not INCLUDE anything. If there is something you want to happen but have no option for it in zend, you make your own library and structure the class names accordingly. For example: Zend_Form_Element is a class which is Zend / Form / Element.php

What you do is, make a class file and then, compile it.

To get started I would recommend going through this tutorial on tutsplus.

http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch/

So, make a controller , make views, pass values from controller and then echo it in views.

Try to follow the rule-book rather writing codes in traditional method. :)

Hope you learn faster :)

I have simple way to include file in zend view page.

Just create one folder named 'include' inside public folder and store the file which you want to include.

After that write the following line in above the page where you want to include the file.

**include_once "./<include folder name>/<include file name>.php";**

Thanks......p2c

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM