Changeset 128 for trunk/trax/vendor/trax/action_controller.php
- Timestamp:
- 02/05/06 23:31:53 (6 years ago)
- Files:
-
- 1 modified
-
trunk/trax/vendor/trax/action_controller.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/action_controller.php
r120 r128 187 187 $GLOBALS['current_controller_path'] = "$this->added_path/$this->controller"; 188 188 $GLOBALS['current_controller_name'] = $this->controller; 189 $GLOBALS['current_action_name'] = $this->action; 189 190 $GLOBALS['current_controller_object'] =& $this->controller_object; 190 191 } … … 340 341 341 342 function execute_before_filters() { 342 if(count($this-> before_filters) > 0) {343 foreach($this-> before_filters as $filter_function) {343 if(count($this->controller_object->before_filters) > 0) { 344 foreach($this->controller_object->before_filters as $filter_function) { 344 345 if(method_exists($this->controller_object, $filter_function)) { 345 346 $this->controller_object->$filter_function(); … … 364 365 365 366 function execute_after_filters() { 366 if(count($this-> after_filters) > 0) {367 foreach($this-> after_filters as $filter_function) {367 if(count($this->controller_object->after_filters) > 0) { 368 foreach($this->controller_object->after_filters as $filter_function) { 368 369 if(method_exists($this->controller_object, $filter_function)) { 369 370 $this->controller_object->$filter_function(); … … 375 376 function add_after_filter($filter_function_name) { 376 377 if(is_string($filter_function_name) && !empty($filter_function_name)) { 377 if(!in_array($filter_function_name, $this-> after_filters)) {378 $this-> after_filters[] = $filter_function_name;378 if(!in_array($filter_function_name, $this->controller_object->after_filters)) { 379 $this->controller_object->after_filters[] = $filter_function_name; 379 380 } 380 381 } elseif(is_array($filter_function_name)) { 381 if(count($this-> after_filters) > 0) {382 $this-> after_filters = array_merge($this->after_filters, $filter_function_name);382 if(count($this->controller_object->after_filters) > 0) { 383 $this->controller_object->after_filters = array_merge($this->controller_object->after_filters, $filter_function_name); 383 384 } else { 384 $this-> after_filters = $filter_function_name;385 $this->controller_object->after_filters = $filter_function_name; 385 386 } 386 387 } … … 388 389 389 390 function add_helper($helper_name) { 390 if(!in_array($helper_name, $this-> helpers)) {391 $this-> helpers[] = $helper_name;391 if(!in_array($helper_name, $this->controller_object->helpers)) { 392 $this->controller_object->helpers[] = $helper_name; 392 393 } 393 394 }
