Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eviweb/fuelphp-modinit
Modinit package for fuelphp
https://github.com/eviweb/fuelphp-modinit
Last synced: about 1 month ago
JSON representation
Modinit package for fuelphp
- Host: GitHub
- URL: https://github.com/eviweb/fuelphp-modinit
- Owner: eviweb
- License: mit
- Created: 2012-10-04T21:24:16.000Z (about 12 years ago)
- Default Branch: develop
- Last Pushed: 2012-10-12T09:28:58.000Z (about 12 years ago)
- Last Synced: 2023-03-25T11:44:17.565Z (almost 2 years ago)
- Language: PHP
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Fuel PHP Modinit Package
========================This package adds some features to initialize modules automatically.
Three ways to make a module compliant; one does not exclude the others.
######_Case 1:_
1. create at the root of the module directory a file named ``bootstrap.php``
2. place initialization code in it
######_Case 2:_
1. create at the root of the module directory a file named as the module,
2. add the module namespace as described in the [manual](http://docs.fuelphp.com/general/modules.html
"Fuel PHP Modules Documentation"),
3. create a function named ``__init``
4. place initialization code in it
######_Case 3:_
1. create in the _./classes_ directory a class named as as the module,
2. add the module namespace as described in the [manual](http://docs.fuelphp.com/general/modules.html
"Fuel PHP Modules Documentation"),
3. create a static method named ``_init`` as described in the [manual](http://docs.fuelphp.com/general/classes.html
"Fuel PHP Classes Documentation")
4. place initialization code in itTo illustrate cases 2 and 3, here follow two examples :
> Assumed the module is named _mymodule_, its namespace will automatically be __\\Mymodule__
>
> ######_Case 2:_
> create a file named ``./mymodule.php``
> add the code :
>> namespace Mymodule;
>> function __init()
>> {
>> // place your initilization code here
>> }
>
> ######_Case 3:_
> create a file named ``./classes/mymodule.php``
> add the code :
>> namespace Mymodule;
>> class Mymodule
>> {
>> public static function _init()
>> {
>> // place your initilization code here
>> }
>> }
>
__These examples assume that the module is referenced in the ``always_load.modules`` option of the application config file.__
To inizialize a module loaded manually, call this package method ``Initializer::init()`` with the name of the module as argument, like this :
> \evidev\fuelphp\modinit\Initializer::init('mymodule');