Download the PHP package zenstruck/content-bundle without Composer

On this page you can find all versions of the php package zenstruck/content-bundle. 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 content-bundle

Information

Build Status

This Bundle allows for various content-types using Doctrine2's Inheritance (see http://www.doctrine-project.org/docs/orm/2.1/en/reference/inheritance-mapping.html for more information). It allows for all your content-types to inherit from a single Node. The problem with Doctrine2's implementation is it requires you set all your inherited Entities in the top most Entity. With this Bundle they are setup in your config.yml.

Configuration

  1. Create a Node class:

  2. Create one or more content-type Entities (extending from your Node entity):

    Note: They can also extend eachother (BlogPost->Page->Node)

  3. Add your node class and any new content-types to your config.yml:

    Note: in the above example the machine name of class BlogPost is blog_post. This naming convention is important.

  4. (optional) To use the controller that this bundle provides activate it in your config.yml:

  5. (optional) If you used the controller in step 4, add the routing:

Reference

Manager

There is a manager class that is available from the service container via the id zenstruck_content.manager.

Breadcrumbs

The manager contains a function called getAncestors(Node $node). This returns an array of Ancestor nodes based on the path of the current Node given.

For instance, if you pass a node with path foo/bar/baz it will return an array of nodes with path's foo and foo/bar if they exist and in that order.

Usage

Inheritance Type

By default Doctrine2's Class Table Inheritance is used. This means each content-type extending from Node is it's own table linking back to the base node table. There is also the option of using Class Table Inheritance. All content types will be stored in the same table.

You can enable this in your config.yml:

Template

To provide your own templates set the default_template option in your config.yml:

Note: the default template name must be node.

InheritedUniqueEntity constraint

This bundles comes with a custom UniqueEntity validation constraint. The default Doctrine one has problems with inheritance. It only checks the values of entities within it's current scope and children. For instance if you have this structure: BlogPost->Page->Node and place the default Doctrine UniqueEntity constraint on a field in Page. Saving a BlogPost with a field that is the same as one in Page will not cause the constraint to become invalid.

The InheritedUniqueEntity constraint packaged with this bundle does.

Usage

The following demonstrates adding a UniqueEntity constraint on the body field of the Page entity. All classes that inherit from Page will have this constraint in the Page scope.

Sitemap Generation

This bundle comes with a Sitemap Generator for use with DpnXmlSitemapBundle

Usage

  1. Install and configure DpnXmlSitemapBundle
  2. Enable sitemap generator in your config.yml:

  3. By default, the generator uses the findAll method on the Node's entity manager. To use a different method change it in your config.yml:

The sitemap should be available at /sitemap.xml.

Full Default Configuration


All versions of content-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/symfony Version 2.*
doctrine/orm Version 2.*
doctrine/doctrine-bundle Version *
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 zenstruck/content-bundle contains the following files

Loading the files please wait ....