|
1 | | -wordpress-factory |
2 | | -================= |
3 | | - |
4 | | -#Inspiration |
5 | | -Its very hard for Object-Oriented Developers (Or Developers who uses MVC Frameworks) to develop wordpress plugins due to the difference on the framework and platform. So, i created this little bootstrap framework that would easily help developers to create their own plugin easily. |
6 | | - |
7 | | -##components added |
8 | | - -Twig |
9 | | - -Autoloader |
10 | | - -probably eloquent? or a good schema builder |
11 | | - -storage |
12 | | - -base_path() |
13 | | - -cache_path() |
14 | | - -storage_path() |
15 | | - -dd() |
16 | | - -a well fixed documentation |
17 | | - |
| 1 | +Wordpress Factory By SourceScript |
| 2 | +=== |
| 3 | +A Well Placed Elegant Wordpress Factory Generated to you by [SourceScript Innovations](http://sourcescript.ph/img/logo.png). The Wordpress Factory is a boilerplate plugin that would allow the developer to use 3rd party classes easily. Not only that you could use 3rd party classes easily, The developer now can autoload's his/her own classes from other frameworks easily. No more procedural development on wordpress plugins, and no more hard-coding development on wordpress plugins. |
18 | 4 |
|
| 5 | +This plugin is <> with <3 for the Open Source Community. |
| 6 | + |
19 | 7 | #Installation |
20 | | -You could easily install the plugin plainly. Each component requires a ```config.php```. Since this is a pre-beta plugin framework, there are a little bit of ```offf-issues``` |
21 | | - |
22 | | -##File Structure |
23 | | -The File structure is composed of the ```Core``` class. |
24 | | - |
25 | | - -functions/classes/Core |
26 | | - -functions/classes/Options |
27 | | - |
28 | | -Each class requires its own ```config.php``` that is found depending on its namespace. for example, ```\Core\Core``` has its ```config.php``` on ```config\Core\Core\config.php``` |
29 | | - |
30 | | -##Initialization |
31 | | -initialization or bootstrapping happened under ```functions.php``` and autoloads each objects with the use of ```CADBootstrap```. |
32 | | - |
33 | | -##Basic Example |
34 | | -###Generating A View Component |
35 | | -Generating a Views Component is as easy as generating it in your own favorite frameworks. With the use of Twig Templating Engine, Wordpress Factory can generate a template easy as |
| 8 | +You are required first and foremost to download [The Composer](http://getcomposer.org/download). After you have downloaded and installed this plugin. all you have to do is run 'php composer.phar install --prefer-dist' |
| 9 | +You will be then given one beautiful placed folder ```app``` this folder has two folders inside, the ```functions``` and the ```views``` the ```functions``` component will harbor all of your autoloaded class files (with / without) namespaces. While the ```views``` folder (you guessed it right) harbors all the template files generated by Twig. Yes, Awesome isn't it! We use twig! on Wordpress! |
| 10 | +##Configurations |
| 11 | +All configuration shall be manifested under ```app.php```. |
| 12 | +###Configuring the Options Page |
| 13 | +Is it hard to create your own options page WITH elegance on wordpress? Now its autoloaded for you, all you have to do is open and edit ```app.php``` it houses a 'options'. These would hold the 4 required files. |
| 14 | + |
| 15 | +If editing the files are too much of a burden, you open the ```functions/OptionsPage.php``` and edit it yourself. The Views component is autoloaded already under ```views/options/options.html.twig```. |
| 16 | + |
| 17 | +#Calling The Views Component |
| 18 | +We Have graciously wrapped Twig for you. |
| 19 | +all you have to do is |
36 | 20 | ```php |
37 | | -echo \Core\ViewCore::make('options/options.tpl')->load(); |
| 21 | + echo View::factorize('options/options.html.twig')->load(); |
38 | 22 | ``` |
39 | | -The Views folder houses all required fields |
40 | | -###Queueing and Registering scripts |
| 23 | + |
| 24 | +You may add parameters |
41 | 25 | ```php |
42 | | -\Assets\AdminAsset::load()->queue(); //for backend |
43 | | -\Assets\FrontAsset::load()->queue(); //for Frontend |
| 26 | + echo View::factorize('options/options.html.twig')->load(['title'=>'Options Title', 'content'=>'content']); |
44 | 27 | ``` |
45 | | -###With Config Php |
46 | | -####Creating an Options Page |
47 | | -There is already an options page generated in ```functions\classes\Options\Page\OptionsPage``` |
48 | 28 |
|
| 29 | +#Adding more packages |
| 30 | +You may add your own packages with the use of composer. After downloading the composer file you may easily autoload it with ```app.php``` just add your folder like so. |
49 | 31 | ```php |
50 | | -//notice that the optionspage already extended \Core\Core to have the generic requirements of the plugins page |
51 | | - |
52 | | -public function init() |
53 | | -{ |
54 | | - if(is_admin()) { |
55 | | - self::factorize(); |
56 | | - } |
57 | | -} |
58 | | -``` |
| 32 | + 'libs' => array( |
| 33 | + 'MyLib' => base_path().'/../vendor/sourcescript/wf-core-framework/src', //add your own file |
| 34 | + ), |
| 35 | +``` |
| 36 | +#Made With Love Using |
| 37 | + -Symfony |
| 38 | + -Twig |
0 commit comments