21490 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 304 Views |
-
Integrating Zend classes to Silverstripe

16 July 2012 at 6:34am
Hello,
I'm would like to know how to integrate Zend libraries to Silverstripe? I would appreciate if somebody has a proper example.
Best regards.
-
Re: Integrating Zend classes to Silverstripe

16 July 2012 at 7:29pm
Normally you can just put the libraries in a folder (our standard is to use thirdparty) and use a require() call. Several modules (including the core framework) include thirdparty (and specifically Zend) classes like this
A couple examples:
SS Config - https://github.com/silverstripe/sapphire/blob/master/core/manifest/ConfigManifest.php#L179
Twitter module - http://svn.rentbox.co.nz/public/twitter/trunk/ -
Re: Integrating Zend classes to Silverstripe

17 July 2012 at 9:17pm
Thanks!
btw. where is "the right place" to globally include the Zend Framework into SilverStripe? Embedding just in a controller file?
-
Re: Integrating Zend classes to Silverstripe

18 July 2012 at 4:39am
For the frontend, the Page_Controller init() function is one of those places...
-
Re: Integrating Zend classes to Silverstripe

18 July 2012 at 5:35pm Last edited: 18 July 2012 5:36pm
You should include it when you need it. If you only need it for 1 small function, include it in that function, otherwise you can include it in your _config.php file (so it's available early on) the issue with init() is that it is only called as part of the controller request process for *that* controller.
| 304 Views | ||
|
Page:
1
|
Go to Top |


