-
Notifications
You must be signed in to change notification settings - Fork 10
DevelopControllers
In the controllers, the rdf data is extractracted, processed, merged, and so on. Here you write the variables to the content object, what is rendered via the templates.
Preamble: myfoafpressextensions is your folder on the same level with the foafpressapp folder.
$ cd /var/www/yourfoafpressfolder
$ mkdir myfoafpressextensions
This is only a short example, using the controller for foaf:Group resources. You can get help at the mailing list [email protected].
E.g the controller for foaf:Group resources, myfoafpressextensions/controllers/foaf/Group.php:
<?php
require_once './../foafpressapp/core/controllers/foaf/Group.parent.php';
class Foaf_Group_Controller extends Foaf_Group_Controller_Parent
{
// doing stuff, create, extend, overwrite methods
}
?>
Same with foaf/Person.php, doap/Project.php, etc ... it is not necessary to use the parent controller from Foafpress but it is recommended.
$c['plugin']['folder'][] = dirname(__FILE__).'/myfoafpressextensions/controllers/';
That's all!
It's not necessary to copy the whole controller scope, e.g. if you don't have foaf/Person.php in your controller folder, Foafpress falls back to its own default controller.