How to Set Up a Zend Layout in NetBeans
The Zend Framework offers PHP programmers a fully object-oriented PHP development framework. This framework offers support for multiple databases and template interfaces, as well as mailbox systems and support for hardware interaction. While Zend offers a full-featured IDE called Zend Studio for a nominal fee, users might want to use their own development environments. Fortunately, you can link the Zend Framework to the NetBeans development environment to program Zend PHP applications.
Instructions
-
-
1
Download and install the Zend Framework from framework.zend.com.
-
2
Find your php.include file, and place the following in it:
'include_path = ".;C:phpincludes"' //for Windows
'include_path = ".:/php/includes"' //for Linux -
-
3
Append the following code (including the semicolon) to the end of the include_path line to link to the Zend library. The exact location of this library may differ from operating system to operating system:
;C:phpZendZendFrameworklibrary"' //Windows Library location
-
4
Click Tools in the NetBeans menu bar, then select Options. In the Options window, select the PHP option. Inside the PHP options pane, select the Zend tab. You should see a text box that reads Zend Script. Click the "Browse" button and navigate to the zf.bat file located in your Zend directory (for Windows) or the zf.sh file (for Mac or Linux); this file is usually in the Zend\ZendFramework directory. Then click "Register Provider" to include the Zend Framework in NetBeans.
-
5
Create the directory applications/layout/scripts in the Zend directory, and create the file layout.phtml in that directory. Copy this example code into that file to set up a basic Zend layout:
<?php echo $this->doctype() ?>
<html>
<head>
<?php echo $this->headTitle() ?>
<?php echo $this->headLink() ?>
<?php echo $this->headStyle() ?>
<?php echo $this->headScript() ?>
</head>
<body>
<?php echo $this->layout()->content ?>
</body>
</html>
-
1