0

Recently I've started to use Zend framework next to my own framework. The solution at this moment for instance for the module "partner" having a rewrite condition in htaccess like

RewriteCond %{REQUEST_URI} ^./partner/?(.)
//redirect to build ZF
RewriteRule ^.*$ public/partner/index.php

// and the bootstrap files are

//index.php for Zend set_include_path(APPLICATION_PATH . '../../../library/php/');
include_once 'Zend/Loader/Autoloader.php';

//index.php for own framework set_include_path(get_include_path() . PATH_SEPARATOR . 'library/php/');

Is it possible to use Zend components just like it would with PEAR components?

Or the question with different perspective
Am I required to choose one of the two MVC patterns to go along with?

At the end I want to be able to use any library/framework for any module.

1 Answer 1

2

You can use ZF components similar to PEAR stuff. The only thing you will need to do is set the include path so, that ZF's requires will function:

set_include_path('path/to/library' . PATH_SEPARATOR . get_include_path())

where path/to/library contains the Zend directory.

At this point you can either initialize the ZF autoloader, or use require_once to load any classes you want to use.

Sign up to request clarification or add additional context in comments.

1 Comment

I will try this //load zend include_once 'Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance(); //load own framework components and use own MVC function_exists("__autoload") || require_once('Loader.php'); $view = new View(); $controller = $view->createController(); $controller->render();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.