classes/Fields/Listing.php
public function controller($controller)
    {

        // Instantiate a string controller
        if (is_string($controller)
            && class_exists($controller)
            && is_subclass_of($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = $controller;
            $this->controller = new $controller;

            // Apply the parent if one was set
            if ($this->parent_item && $this->controller) {
                $this->controller->parent($this->parent_item);
            }

        // Or, validate a passed controller instance
        } elseif (is_object($controller)
            && is_a($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = get_class($controller);
            $this->controller = $controller;
        }

        // Chain
        return $this;
    }
public function controller($controller)
    {

        // Instantiate a string controller
        if (is_string($controller)
            && class_exists($controller)
            && is_subclass_of($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = $controller;
            $this->controller = new $controller;

            // Apply the parent if one was set
            if ($this->parent_item && $this->controller) {
                $this->controller->parent($this->parent_item);
            }

        // Or, validate a passed controller instance
        } elseif (is_object($controller)
            && is_a($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = get_class($controller);
            $this->controller = $controller;
        }

        // Chain
        return $this;
    }
public function controller ( $ controller ) { // Instantiate a string controller if ( is_string ( $ controller ) && class_exists ( $ controller ) && is_subclass_of ( $ controller , 'Bkwld\Decoy\Controllers\Base' ) ) { $ this -> controller_name = $ controller ; $ this -> controller = new $ controller ; // Apply the parent if one was set if ( $ this -> parent_item && $ this -> controller ) { $ this -> controller -> parent ( $ this -> parent_item ) ; } // Or, validate a passed controller instance } elseif ( is_object ( $ controller ) && is_a ( $ controller , 'Bkwld\Decoy\Controllers\Base' ) ) { $ this -> controller_name = get_class ( $ controller ) ; $ this -> controller = $ controller ; } // Chain return $ this ; }
Replace the controller

@param  Bkwld\Decoy\Controllers\Base | string $controller
@return Field                                 This field
Replace the controller