public static function build($title, $fields = [])
    {
        // Get instance
        $metabox = self::getInstance();

        // Check fields
        if (empty($fields)) {
            throw new FieldException(Translate::t('metabox.errors.no_fields'));
        }

        // Define ID
        $id = Helpers::urlize($title);

        // Set details
        $metabox->getModel()->setTitle($title);
        $metabox->getModel()->setFields($fields);

        // Get field
        return $metabox;
    }
public static function build($title, $fields = [])
    {
        // Get instance
        $metabox = self::getInstance();

        // Check fields
        if (empty($fields)) {
            throw new FieldException(Translate::t('metabox.errors.no_fields'));
        }

        // Define ID
        $id = Helpers::urlize($title);

        // Set details
        $metabox->getModel()->setTitle($title);
        $metabox->getModel()->setFields($fields);

        // Get field
        return $metabox;
    }
public static function build ( $ title , $ fields = [ ] ) { // Get instance $ metabox = self :: getInstance ( ) ; // Check fields if ( empty ( $ fields ) ) { throw new FieldException ( Translate :: t ( 'metabox.errors.no_fields' ) ) ; } // Define ID $ id = Helpers :: urlize ( $ title ) ; // Set details $ metabox -> getModel ( ) -> setTitle ( $ title ) ; $ metabox -> getModel ( ) -> setFields ( $ fields ) ; // Get field return $ metabox ; }
Build Metabox component.

@param string    $title
@param array     $fields
Build Metabox component .