Resource Compiler

The Resource class is an helper class that is used for some important operations within the framework. These operations are listed and discussed below:

  • Loading Static Files
  • Loading Template Files
  • Loading Meta Tags
  • Loading Flash messages

Loading static resources

The primary function of Resource class is to group urls of static files into different resource groups which can be imported later into web pages. The urls supplied are either validated (relative urls) or unvalidated (domain urls) and then resolved into an http protocol format that is recognizable by the web application. In this way, local urls becomes availables in both local (offline) and remote (online) environments. As a general rule, all static urls are are placed into the global resource folder res. This enables the Resource class to locate and import them from their respective directories within that res folder. During importation, urls are converted into their respective scripts which will properly include relative files into the project application. More information about grouping and importation of static resources are provided here.

Loading template files

Loading template files is one of the secondary functions of the resource class. The Resource class has a great relationship with the template Compiler class. This secondary function is utilized by the Window class thereby, providing it with template loading extended features Learn more

Loading meta tags

The meta tags is compiled by the Meta class which uses predefined properties to generate meta tags which can be included into the web page. The Resource compiler class can be configured to automatically add configured meta tags into the web page. This configurations are defined within the icore/filemeta.php file. Once enabled, the meta tags will be automatically added at the first importation of static resource files. Learn more.

Loading flash messages

The other secondary function of Resource class is that it is used to load flash messages or notifications. Flashes notifications are messages that are generated and loaded and viewed once in a web application. This feature is powered by the combined effect of Notice class along with the session data storage system. Although, the Notice class is mainly designed to handle this feature, the Resource class however, provides static methods that makes it easier to quickly set up flash messages. Learn more.