Solved

Zend Framework - Index.php

Posted on 2012-04-03
2
555 Views
Last Modified: 2012-08-14
So...I'm doing my first Zend Framework project and the index.PHP code is as such

"<?php

// Define path to application directory
set_include_path(implode(PATH_SEPARATOR, array(
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
            ->run();"

When I build the project it comes up on the index.phtml page....

Where in that "index.php" code does it direct to the "/application/views/scripts/index/index.phtml"?

I'm trying to understand how that gets routed and can't figure it out.

Thanks
0
Comment
Question by:ProdigyOne2k
  • 2
2 Comments
 
LVL 14

Accepted Solution

by:
Scott Madeira earned 500 total points
ID: 37804290
The .phtml is part of the view (the V in MVC) and the index.php is the controller.  The view is invoked through $application - the instance of ZEND_APPLICATION.

Here is a quick-start link to get you started... http://framework.zend.com/manual/en/zend.application.quick-start.html

Note that ZEND Framework is fairly complicated.  I suggest watching some tutorials or reading some books.  It isn't a trivial exercise.
0
 
LVL 14

Expert Comment

by:Scott Madeira
ID: 37804293
Also, I would also suggest that you run your project through your IDE (Netbeans, Eclipse, Zend Studio, etc.) in debugging mode so that you can step through all the classes and see how it all fits together.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Find out what you should include to make the best professional email signature for your organization.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question