I know this is quite silly to ask, I oftentimes see this term on the documentation but I still don't get enlightened by such contexts I encounter. What is the difference between "resources" and "libraries". In my assumption I made the conclusion that they are just set of loaded classes. I would like to make sure if I am correct. But I do not comprehend why they included the functionality of the Zend_Cache, Zend_Translate, Zend_Dojo etc. on the Zend_Application_Resource. Thank you very much and please excuse my English.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
In Zend Framework, resource term used in the context of zf application to denote the followings like:
- cachemanager
- db
- multidb
- frontController
- layout
- locale
- log
- mail
- modules
- navigation
- router
- session
- translate adapter resource
- useragent
- view etc.
Syntax: Zend_Application_Resource_ResourceName
Sample resource loading description:
Zend_Application_Resource_Modules
Zend_Application_Resource_Modules is used to initialize your application modules. If your module has a Bootstrap.php file in its root, and it contains a class named _Module_Bootstrap_ (where "Module" is the module name), then it will use that class to bootstrap the module.
By default, an instance of _Zend_Application_Module_Autoloader_ will be created for the module, using the module name and directory to initialize it.
Since the Modules resource does not take any arguments by default, in order to enable it via configuration, you need to create it as an empty array. In INI(application.ini) style configuration, this looks like:
In XML style configuration, this looks like:
Using a standard PHP array, simply create it as an empty array:
can check out More Here
Resources are objects you initialise during bootstrap via your configuration file and are generally available to your entire application.
There are a set of built-in resources as described here - http://framework.zend.com/manual/en/zend.application.available-resources.html
You can also provide your own.
A library is a collection of classes that you may use in your application. Objects are generally instantiated when required.