Make an index file for a Zend Framework project
December 23rd, 2008This video covers the code found in the Zend Quickstart guide for creating the bootstrap file. I create the index.php file which will handle all the browser requests to the Zend Framework.

Hi. Thanks, It’s more interesting then read documentation
But, maybe ‘APPLICATION_ENVIRONMENT’ define in ‘index.php’ because this constant will work and using in all project.
And in end ‘index.php’ error in close tag – ‘html’.
And maybe you on ‘line number’ in NetBeanst – this easy commenting.
hmm… i got afew qns…
- how do i know what goes into the bootstrapper and what goes into the index file? they seem to be something like an init function
- since $frontController is unset why bother to set properties in it? isit becos its something like setting those things into Zend_Controller_Front “static object”?
- frontController in index and bootstrapper are different… i dun really understand this …
- any differences bet APPLICATION_PATH in bootstrap.php and index.php. they are set to different values index uses realpath()
Hi iceangel89,
– bootstrapping is something that should be the same for requests from the command line (say a cron job invoking parts of your ZF app or unit tests). the Index file is more concerned with web requests. This definition is still a little muddy (the latest version of the ZF template in Zend Studio even has an “initialize” php file). Bootstrapping has been a bit of sore spot for the ZF in terms of standardization. Zend_Application (in the incubator) is aiming to resolve these issues.
- the front controller is the landing point for your app before it gets routed to a particular controller in a Zend MVC application. we unset the variable so that there’s no variable collisions. ZF folks are pretty dogmatic about making sure there are no global variables lying around. Static variables are used as a way of keeping variables associated with a class, rather than just floating in php space without any owner.
- for your last two points, I agree that there’s a lack of clarity here in the quickstart guide. I would stick to the conventions for now and let the dust settle, unless I’m missing something in my tutorial…
Hi, i think it will be good if there’s tutorials about ZF 1.8. i think the bootstrapping and the index page is still the most confusing
there’s plenty of confusion about those two parts of the Zend Framework, but I think I’ll wait until the dust settles over at Zend before making any videos explaining how it works.
hello jon
I set all the DIRECTORY structure in WAMP but i m still getting the error
Notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in C:\wamp\www\zc\library\Zend\Loader.php on line 207
Warning: require(../application/bootsrap.php) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\zc\public\index.php on line 16
Fatal error: require() [function.require]: Failed opening required ‘../application/bootsrap.php’ (include_path=’C:\wamp\www\zc\public/../library;.;C:\php5\pear’) in C:\wamp\www\zc\public\index.php on line 16
will you please help me to sort out the problem ..
my folder structure is
c:\wamp\www\zc\application
c:\wamp\www\zc\library
c:\wamp\www\zc\public\index.php
Hi Lokesh, I suggest looking at my most video with the 1.8 version of the Zend Framework. Things have changed quite a bit when it comes to bootstrapping and setting up your Zend Framework application. The episode from last week should be a little more helpful to get you up and running.
Best!
Jon
Hi Jon,
Thanks a lot for your great videos! They’re realy much helpfull. Keep the awesome work up!
Have a nice day.
Harry
Just one little thing. You must write error_reporting(E_ALL | E_STRICT) instead of error_reporting(E_ALL || E_STRICT).
very fine good help
Hey Jon,
Outstanding videos!
BUT: as a total beginner, I have no clue where to start.
the only “order” in this site is that tag cloud on the right side. (or am i missing something?)
can you please suggest a list of videos to watch? (first: this, then this…)
Thanks,
Ron
Hey Ron,
I would suggest starting with the introduction to 1.8: http://www.zendcasts.com/introduction-to-zend-18-a-look-at-zend_tool-and-bootstrapping/2009/05/
that should get you up and running. If you still have questions, post them on the forum – http://www.zendcasts.com/forum and we’ll try and answer em there!
best,
-
Jon
Hi there,
I think there is something missing here, because I always getting 404 pages, because the public folder where the actual index.php is placed is not referenced whether in a .htaccess or httpd.conf file
r. Sandor