Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to switch on Zend Framework with existing php project
    text
    copied!<p>I have an application which I want to convert to Zend Application. I have to continue by doing next tasks in zend but previous pages should work as they are working. Existing php project is a simple php project with very simple directory structure and all files are in one folder. </p> <p>I created a zend project(test) separately and put all existing project files in public folder. I set to local host that points to <strong>test/public</strong> folder when use <strong>test.dev</strong>. When I use <strong>test.dev</strong> in browser then <strong>index.php</strong> of existing project is called and existing project's initial page is shown. Now I created a controller(person) and action(index). Now when I use <strong>test.dev/person/index</strong> then existing project content is shown first and then in the end of the page <strong>person/index</strong>(controller/action) content is shown.</p> <p>I want if there is controller and action in url then it should show only zend project files content and when there is a file in url then it should show that file simply.</p> <p>my <strong>test/public/index.php</strong> file is like this at the moment.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; This is existing project's index content. &lt;/body&gt; &lt;/html&gt; &lt;?php // Define path to application directory defined('APPLICATION_PATH') || 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(), ))); // Determine the protocol to use (http or https). if (APPLICATION_ENV == 'production') { define('HTTP_PROT', 'https://'); } else { define('HTTP_PROT', 'http://'); } /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application-&gt;bootstrap() -&gt;run(); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload