?
Solved

Zend Framework - Index.php

Posted on 2012-04-03
2
Medium Priority
?
577 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 2000 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

839 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