Skip to content
Jonathonbyrd edited this page Apr 1, 2011 · 1 revision

The functions controller allows any developer to maintain a simple MVC structure within wordpress. The controller will loop through all registered paths looking for the models and then the views. If the controller locates the model, it will load the model and not the view.



Set Controller Path

This is used for defining a new location for models and views. The plugin root is default, overridden by the theme root.
set_controller_path( $name );

$name
The path to the new folder you're registering.



Get Show View

Enter the name of the view that you would like to display. This works like the php function 'register' and calls the view into a variable. Returning the view contents.
get_show_view( $name, $args );

$name
The file name within the model or view folders



Show View

Echos the get_show_view contents.
show_view( $name, $args );

$name
The path to the new folder you're registering.

$args
Send anything that you want to your model or view files.



Do Require Once

This function is used to call a specific plugin file. Allows you to do this and not worry about dynamic file paths.
do_require_once( $name );

$name
The path to the new folder you're including.