How It Works

Overview:

  • This plugin allows you to build MVC based web applications in WordPress

 

Plugin Install:

  • From the administrative side of WordPress, go to Plugins -> Add New
  • Click the ‘Upload Plugin’ button and select the zipped folder containing the Gear Framework

 

Plugin Settings:

  • From the administrative side of WordPress, go to Gear Framework -> Settings
  • You may define the location of your app and it’s public files, but by default they will be located in /wp-content/gf-app

 

Install Application File Structure:

  • From the administrative side of WordPress, go to Gear Framework -> Settings
  • Click ‘Install Now’

 

Creating Pages and MVC Files:

  • From the administrative side of WordPress, go to Gear Framework -> Add Page
  • You may be as specific with this form as you like, but by default, you only have to enter a page title, and the rest will be automated
  • Doing this will create a WordPress page, a model file, a view file, and a controller file
  • The page will only contain a shortcode, linking it to the model, view, and controller files
  • You can alter the page as much as you want, and so long as you leave the shortcode somewhere, your application will run

 

Shortcodes [gf-mvc):

  • The shortcode has four attributes that can be used for linking a page to your application
    • ‘m’ – Defines an exact model to use ex. [gf-mvc m=’example’)
    • ‘v’ – Defines an exact view to use
    • ‘c’ – Defines an exact controller to use
    • ‘mvc’ – Defines an exact model, view, and controller to use
  • By default, the model, view, and controller that is used is based on the page slug.

 

Up Next: File and Folder Conventions