Solved

Zend Framework - Index.php

Posted on 2012-04-03
2
545 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now