build(); } /** * And then pass the container with all items to the viewer */ switch ( $type ) { case 'html': return new Html( $config, $container ); // break; case 'json': return new Json( $config, $container ); // break; case 'object': return (object) $container; // break; case 'array': return (array) $container->all(); // break; default: throw new InvalidArgumentException( sprintf( 'Unknown %s format given', $type ) ); break; } } }