jasteele123

concrete5 block controller dump

May 27th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. class MyCustomBlockController extends BlockController {
  2.     public $cobj;
  3.     protected $btTable = 'btMyCustom';
  4.     protected $btInterfaceWidth = '500';
  5.     protected $btInterfaceHeight = '365';
  6.    
  7.     public function __construct($obj = null) {
  8.         $cobj = Page::getCurrentPage();
  9.         if (is_object($cobj)) {
  10.             $this->cobj = $cobj;
  11.         } elseif(is_object($obj) && strtolower(get_class($obj))=="block") {
  12.             $this->bID = $obj->bID;
  13.             $this->cobj = $obj->getBlockCollectionObject();
  14.         }
  15.         parent::__construct($obj);
  16.    
  17.         // comment this out, output should really only happen in the block View (view.php)
  18.         $reflect = new ReflectionClass($this->cobj);
  19.         $methods = $reflect->getMethods();
  20.         dump($methods, '$cobj Methods');
  21.         dump($this->cobj, '$this->cobj');
  22.         }
  23.    
  24.     private function dump($val, $title='') {
  25.         echo '<pre>'. ($title ? '<strong>'. $title. '</strong>: ' : ''). print_r($val, 1). '</pre>';
  26.     }
  27. }
Add Comment
Please, Sign In to add comment