Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Easily implement the Presenter pattern to keep your views clean

Notifications You must be signed in to change notification settings

machuga/codeigniter-presenter-spark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Presenter Spark

Presenter is designed to allow you to implement the presenter pattern easily in your CodeIgniter views.

Installation

Sparks Manager

In your shell, navigate to the root of your CodeIgniter project and run

php tools/spark install presenter

Manually

  • Navigate to your CodeIgniter project's 'sparks' folder
  • Extract the presenter spark here, ensure it is named 'presenter'

Additionally

Be sure to create a directory named 'presenters' in your application folder

How To

You may choose to either autoload the spark, or load it manually via

$this->load->spark('presenter/<version_number>');

To load the presenter, use:

$this->presenter->load('user', $user)

The second parameter is optional, and may be loaded as an individual instance later via:

$user_presenter = new User_Presenter($user);

Conventionally, if you have a 'User' model, you would name the presenter 'User_Presenter', and the file name 'user_presenter.php'. For clarification, it is assumed that the presenter will be named the same as your model, and the file name will be all lowercase.

Examples coming soon!

Contact and Credit

This spark was created and is maintained by Matthew Machuga, is hosted on GitHub, and is made possible by the GetSparks team. Please support their project!

About

Easily implement the Presenter pattern to keep your views clean

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages