]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/controller/class_BaseController.php
NullFilter class added, partial filter for accepting rules added
[shipsimu.git] / inc / classes / main / controller / class_BaseController.php
index 607e042af3541c0177bf87c042d6ee5c40ba3e23..409ded2b9eba7a60ee8893b1818947fce167013b 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
- * A generic controller class
+ * A generic controller class. You should extend this base class if you want to
+ * write your own controller. You get the advantage that you can use the pre and
+ * post filters.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -51,14 +53,13 @@ class BaseController extends BaseFrameworkSystem {
                $this->removeSystemArray();
 
                // Initialize both filter chains
-               $this->preFilterChain  = FilterChain::createFilterChain();
-               $this->postFilterChain = FilterChain::createFilterChain();
+               $this->preFilterChain  = ObjectFactory::createObjectByConfiguredName('filter_chain');
+               $this->postFilterChain = ObjectFactory::createObjectByConfiguredName('filter_chain');
        }
 
        /**
         * Getter for a command resolver instance
         *
-        * @
         * @return      $resolverInstance       An instance of a command resolver class
         */
        public final function getResolverInstance () {
@@ -105,6 +106,7 @@ class BaseController extends BaseFrameworkSystem {
         * @return      void
         */
        protected function executePreFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute all pre filters
                $this->preFilterChain->processFilters($requestInstance, $responseInstance);
        }
 
@@ -116,6 +118,7 @@ class BaseController extends BaseFrameworkSystem {
         * @return      void
         */
        protected function executePostFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute all post filters
                $this->postFilterChain->processFilters($requestInstance, $responseInstance);
        }
 }