I tested last couple of days Zend_Application, resources autoloading,
aso. I tried to re-work the entire structure of app to be modular as
much as possible.
After i cleaned up all the bugs (mostly due to rewriting names of model)
i found that nothing is rendered to browser. Before were of course errors :)
So i started to remove most of code to see why nothing is displayed. No,
it's not an error, error displaying is enabled and no error into php
errors log...
Have no ideea what's left so code shuold work (aka: render views,
layouts as supposed):
//index.php
if( getenv('APPLICATION_ENVIRONMENT') !== false)
define('APPLICATION_ENVIRONMENT',
getenv('APPLICATION_ENVIRONMENT'));
else
define('APPLICATION_ENVIRONMENT', 'production');
define('PUBLIC_PATH', realpath(dirname(__FILE__)));
define('BASE_PATH', realpath(dirname(dirname(__FILE__))));
define('APPLICATION_PATH', BASE_PATH . '/application');
define('MODULE_PATH', APPLICATION_PATH . '/modules');
set_include_path(
BASE_PATH . '/library/dasprid' . PATH_SEPARATOR
.BASE_PATH . '/library/incubator' . PATH_SEPARATOR
.BASE_PATH . '/library' . PATH_SEPARATOR
. get_include_path()
);
require 'Zend/Application.php';
$application = new Zend_Application(APPLICATION_ENVIRONMENT,
APPLICATION_PATH . '/config/config.ini');
$application->bootstrap();
$application->run();
//config.ini
[development]
bootstrap = APPLICATION_PATH "/Bootstrap.php"
phpSettings.display_errors = true
phpSettings.error_reporting = 8191
[production : development]
phpSettings.display_errors = false
phpSettings.error_reporting = 771
//bootstrap
<?php
require_once 'Zend/Application/Bootstrap/Base.php';
class Bootstrap extends Zend_Application_Bootstrap_Base
{
public function _initFrontController()
{
$this->front = Zend_Controller_Front::getInstance();
$this->front->throwExceptions(false);
$this->front->returnResponse(true);
$this->front->addModuleDirectory( MODULE_PATH );
Zend_Layout::startMvc(
array(
'layoutPath' => MODULE_PATH . '/default/layouts/scripts',
'layout' => 'layout'
)
);
}
public function run()
{
$this->front->dispatch();
}
}
//controllers and views in place
So i am not sure why nothing is rendered... I am missing something ?
--
Best regards,
Cristian Bichis
www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com
没有评论:
发表评论