WPDKViewController::initWithView PHP Method

initWithView() public static method

Return an instance of WPDKViewController class. This static method create a view controller with a view.
public static initWithView ( string $id, string $title, WPDKView $view ) : boolean | WPDKViewController
$id string The unique id for this view controller
$title string The title of this view controller. This is displayed on top header
$view WPDKView A instance of WPDKView class. This will be a subview.
return boolean | WPDKViewController The view controller or FALSE if error
    public static function initWithView($id, $title, $view)
    {
        if (!is_object($view) || !is_a($view, 'WPDKView')) {
            return false;
        } else {
            $instance = new WPDKViewController($id, $title);
            $instance->view->addSubview($view);
        }
        return $instance;
    }