Zend Framework 1.12.3, part 1 – First application

Today I do my first Zend application in PHP in Netbans IDE. I describe this how You may do it step by step.
First open Netbeans IDE. Then choose from menu File->New Project.
a01In wizard window choose in category PHP and in Projects  PHP Application.
43In another step write in Project Name field any name, in my it is PhpZendProj.
a02Click Next button.
Next window You leave unchanged and click Next button.
a03In next window with list of fameworks, select Zend PHP Web Framework option and click Finish button.
46On the left side You view structure of Zend application.
a04The important are two folders: controllers and views. In views in scripts node are files with view gets from controller. All view files have the same name as their folder and controller name. Example IndexConroller.php is the index controller. This controller have in node view index folder within index.phtml file.
Let print on the web site string: “Zend Project”. In this case You double click on index.phtml. In Editor You will see the opened index.phtml file.
a05Delete all code in this file and paste this:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>It is my first web side</title>
</head>
<body>
<h1>Zend Project</h1>
</body>
</html>

a06Save file(choose from menu File->Save or type on keyboard Ctrl+S).Click on green icon:
a07Wait a moment. The browser run. In address bar You see http://localhost/PhpZendProj/
If You don’t see your website, like that:
a08it is mean that Yuo don’t run Apache server. Open xampp Control Panel, if your server it is, and click Start next to Apache label and try again run Your application.
Oh, this time You see folders.
a09But You would like see string: “Zend Project”. What’s wrong? You must set in this project path to index.dhtml file. So right click on project node and choose Set configuration and then Cusomize.
a10You view Project Properties wizard, in it in Project URL field add public folder on the end path.
a11You may click run icon in Netbeans. In this time You see website with Zend Project string.
a12

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.