This evening I brought my blog up to date. I added email notifications for new comments. This has become necessary because a spam robot has already spammed me several times.
Unfortunately, I only noticed later that Ralf Eggert had published almost the same functionality in his Zend Framework tutorial. But that doesn't matter, since I am now taking a slightly different approach anyway, and you learn the most when you program something yourself.
When a new comment is added to the blog now, an activation code is generated and stored in the database along with the comment. This code is then sent to me by email using the Zend_Mail component. The email contains a URL pointing to the CommentController. When the URL is opened, the comment is activated and displayed under the corresponding article.
I also made a few structural changes. The blog is now divided into a frontend and a backend module.
This is now possible thanks to the changes to the controller. Here are the necessary changes in my bootstrap file:
$controllerDirectories = array(); foreach ($config->module as $moduleName => $modulePath) { $controllerDirectories[$moduleName] = $modulePath; } $controller->setControllerDirectory($controllerDirectories); $controller->setParam('useModules', true);
The directories are loaded through the configuration.
Here are the necessary changes in my configuration:
; Controller settings module.frontend = ../application/controllers/frontend module.backend = ../application/controllers/backend
For a more detailed description of modules, see Ralf Eggert's tutorial at this link.
http://www.ralfeggert.de/2006/12/30/zend-framework-controller-in-
unterverzeichnissen-verwalten/