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.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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.
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/
Thanks!
btw. where is "the right place" to globally include the Zend Framework into SilverStripe? Embedding just in a controller file?
For the frontend, the Page_Controller init() function is one of those places...
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.