Open-Source PHP Framework - Designed for rapid development of performance-oriented scalable applications

Wiki Component

API >> mvc >> components >> wiki
Any action or entire controller can be made into a wiki section. The wiki edit screen will use the WYSIWYG textarea if you have the TinyMCE package installed, otherwise it will default to a standard textarea that accepts HTML markup and has a WYSIWYG-preview window below it.

Action wiki

To convert any action into a wiki simply return from the action method:
So your action would look like:
public function discussion() {

If this where in a controller called "pizza" then any page at or under would be powered by the wiki, eg.:
Take note that:
  • Pages are NOT case-sensitive so both of these will go to the same page:
  • You do not need to create a view for actions that use the wiki() method of this component, if you do it will be ignored.

Wiki appearance

The content of the wiki can be controller by CSS ID wikibody
If you would like to be able to modify the appearance of the wiki page you can swap the wiki() method of this component with the getWiki() method:
This method requires you to create a view and include somewhere in the view:
You can also hide the search box via:
load::element('wiki', array('hideSearch' => true));
And then place it wherever you like via:
The search can be styled via the CSS ID wikisearch eg.:
#wikisearch {float: right; margin-left: 10px; width: 210px;}

Wiki page modification access-control

It is up to your own code-logic to determine who can edit a wiki page, the single argument accepted by both wiki() and getWiki() is a Boolean determining if the wiki should be read-only or to enable editing as well as viewing/reverting to historical pages. The default is to enable editing. A typical usage for a page to be edited by superuser administrators only would be:
public function usageInstructions() { 

Controller wiki

Turning an entire controller into a wiki is the same as just an action, except the URL parameters are reduced by one level and you need to enable the optionalAction controller directive, your entire controller class would like:
class pizzaController {
optionalAction true;
    public function 
index() {

The same URLs in the first example would now be:

Reverting to a previous version

Visit any page on your wiki and click the history link at the top (you must have page-editing enabled for the link to appear) and then click an older version. When the historical version loads click edit and then save the page (it will become the newest version.)