Controllers

Identicon Image
Dennis Iversen
16-Feb-2011 12:30:39
0 Comments

With our model it is very easy to create controllers with just one line of code. There is not much that these controllers do. You could place more code in these files, but we didn't for this module. They all just have one static call to our simpleBlog object. Our index controller (index.php) was created when we created our module files. It will look like this:

<?php

blogSimple
::indexController();

Our controller for viewing an entry will look like this (in view.php):

<?php

blogSimple
::viewController();

And for the add controller (we create an add.php file in blog_simple folder that looks like this):

<?php

blogSimple
::addController();

For editing our an entry (we create an edit.php file):

<?php

blogSimple
::updateController();

And for deleting an entry:

For editing our entry (we create a delete.php file):

<?php

blogSimple
::deleteController();

Comments