Download the PHP package b13/container without Composer

On this page you can find all versions of the php package b13/container. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package container

CI

EXT:container - A TYPO3 Extension for creating nested content elements

Features

Why did we create another "Grid" extension?

At b13 we've been long supporters and fans of gridelements, which we are thankful for and we used it in the past with great pleasure.

However, we had our pain points in the past with all solutions we've evaluted and worked with. These are our reasons:

Installation

Install this extension via composer req b13/container or download it from the TYPO3 Extension Repository and activate the extension in the Extension Manager of your TYPO3 installation.

Once installed, add a custom content element to your sitepackage or theme extension (see "Adding your own container element").

Adding your own container element

  1. Register your custom container in your sitepackage or theme extension in Configuration/TCA/Overrides/tt_content.php as new Content Type
  2. Add TypoScript and your Fluid Template for frontend rendering
  3. Add an icon in Resources/Public/Icons/<CType>.svg

See EXT:container_example for a simple example of a custom container.

Registration of Container Elements

This is an example to create a 2 column container. The code snippet goes into a file in your sitepackage or theme extension in the folder Configuration/TCA/Overrides/. The file can have any name but it is good practice to name it according to the database table it relates to. In this case this would be tt_content.php.

Methods of the ContainerConfiguration Object

Method name Description Parameters Default
setIcon icon file, or existing icon identifier string $icon 'EXT:container/Resources/Public/Icons/Extension.svg'
setGridTemplate Template for grid string $gridTemplate 'EXT:container/Resources/Private/Templates/Container.html'
setGridPartialPaths / addGridPartialPath Partial root paths for grid array $gridPartialPaths / string $gridPartialPath ['EXT:backend/Resources/Private/Partials/', 'EXT:container/Resources/Private/Partials/']
setGridLayoutPaths Layout root paths for grid array $gridLayoutPaths []
setSaveAndCloseInNewContentElementWizard saveAndClose for new content element wizard bool $saveAndCloseInNewContentElementWizard true
setRegisterInNewContentElementWizard register in new content element wizard bool $registerInNewContentElementWizard true
setGroup Custom Group (used as optgroup for CType select, and as tab in New Content Element Wizard). If empty "container" is used as tab and no optgroup in CType is used. string $group 'container'
setDefaultValues Default values for the newContentElement.wizardItems array $defaultValues []

Notes:

TypoScript

The TypoScript is necessary to define the rendering of the container in the frontend. Normally you will place it in your sitepackage or theme extension near the place where you define other stuff regarding your content elements. templateRootPaths must be adapted to reflect the path of the html files in your sitepackage or theme extension.

// default/general configuration (will add 'children_<colPos>' variable to processedData for each colPos in container
tt_content.b13-2cols-with-header-container < lib.contentElement
tt_content.b13-2cols-with-header-container {
    templateName = 2ColsWithHeader
    templateRootPaths {
        10 = EXT:container_example/Resources/Private/Templates
    }
    dataProcessing {
        100 = B13\Container\DataProcessing\ContainerProcessor
    }
}

// if needed you can use ContainerProcessor with explicitly set colPos/variable values
tt_content.b13-2cols-with-header-container < lib.contentElement
tt_content.b13-2cols-with-header-container {
    templateName = 2ColsWithHeader
    templateRootPaths {
        10 = EXT:container_example/Resources/Private/Templates
    }
    dataProcessing {
        200 = B13\Container\DataProcessing\ContainerProcessor
        200 {
            colPos = 200
            as = children_200
        }
        201 = B13\Container\DataProcessing\ContainerProcessor
        201 {
            colPos = 201
            as = children_201
        }
    }
}

Options for DataProcessing

Option Description Default Parameter
contentId id of container to to process current uid of content element $cObj->data['uid'] | ?int
colPos colPos of children to to process empty, all children are processed (as children_<colPos>) | ?int
as variable to use for proceesedData (only if colPos is set) | children | ?string
skipRenderingChildContent do not call ContentObjectRenderer->render() for children, (renderedContent in child will not exist) | empty | ?int

Template

The html template file goes in the folder that you have defined in your TypoScript above (see templateRootPaths). It's important to name it exacly as defined in templateName in TypoScript, in this case 2ColsWithHeader.html. The file name is case-sensitive!

With explicit colPos defined use {children_200|201} as set in the example above

Concepts

CLI commands

There's several CLI commands to check/fix the integrity of the containers and their children.

TODOs / Proofments

Extension Tests and Coding Guidelines

You can run our test suite for this extension yourself:

See Tests/README.md how to run the tests local (like github-actions runs the tests).

To assure coding guidelines are fullfilled:

Credits

This extension was created by Achim Fritz in 2020 for b13 GmbH, Stuttgart.

Find examples, use cases and best practices for this extension in our container blog series on b13.com.

Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.


All versions of container with dependencies

PHP Build Version
Package Version
Requires typo3/cms-backend Version ^11.5 || ^12.4 || ^10.4
doctrine/dbal Version ~2.13.1 || ~3.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package b13/container contains the following files

Loading the files please wait ....