Is there any way to use more than 1 bootstrap class in Zend Framework?
It should sound workaround or something l开发者_如何学运维ike, but I'll tell you what:
I chose to have a separated "project" with every library I could use. It's like a global library which I included Zend library, Doctrine ORM, JQuery, Blueprint CSS, etc. Then I set the include path. Nothing wrong.
The problem is: I'd like to have also a global bootstrap class inside the library folder and an individual bootstrap class on each project I create for individual use.
I don't know how to set more than 1 bootstrap class. Is it possible?
The easiest way i can think of is of make youre own base bootstrap class and extend that instead of the default Zend one. so instead of
//application/Bootstrap.php
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
// project specific
}
you would have:
// application/Bootstrap.php
<?php
class Bootstrap extends YourNamespace_Bootstrap
{
// project specific
}
// library/YourNamespace/Bootstrap.php
<?php
class YourNamespace_Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
// library specific
}
精彩评论