WPDKViewController::__construct PHP Method

__construct() public method

Create an instance of WPDKViewController class
public __construct ( string $id, string $title ) : WPDKViewController
$id string The unique id for this view controller
$title string The title of this view controller. This is displayed on top header
return WPDKViewController
    public function __construct($id, $title)
    {
        $this->id = sanitize_title($id);
        $this->title = $title;
        $this->view = new WPDKView($id . '-view-root', array('wrap'));
        $this->viewHead = new WPDKHeaderView($id . '-header-view', $this->title);
        $this->view->addSubview($this->viewHead);
    }

Usage Example

Esempio n. 1
0
 /**
  * Create an instane of WPDKjQueryTabsViewController class
  *
  * @brief Construct
  *
  * @param string             $id         A lowercase id used in HTML markup
  * @param string             $title      The view controller title
  * @param WPDKjQueryTabsView $view       An instance of WPDKjQueryTabView class
  *
  * @return WPDKjQueryTabsViewController
  */
 public function __construct($id, $title, $view)
 {
     parent::__construct($id, $title);
     $this->view->addSubview($view);
 }