Download the PHP package c975l/site-bundle without Composer

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

SiteBundle

SiteBundle does the following:

SiteBundle dedicated web page.

SiteBundle API documentation.

Bundle installation

 Step 1: Download the Bundle

Use Composer to install the library

 Step 2: Configure the Bundle

v2.0+ of c975LSiteBundle uses c975L/ConfigBundle to manage configuration parameters. Use the Route "/site/config" with the proper user role to modify them.

Upgrading from v1.x? Check UPGRADE.md

 Step 3: Enable the Routes

Then, enable the routes by adding them to the config/routes.yaml file of your project:

 Step 4: install assets to web folder

Install assets by running

It will create a link from folder Resources/public/ in your web folder. These files are used in the layout.html.twig.

 How to use

You must create a file named layout.html.twig in your app/Resources/views/ that extends @c975LSite/layout.html.twig, so simply add this {% extends '@c975LSite/layout.html.twig' %} at its top.

SiteBundle use the following variables which are page-based, meaning that they change for each page. If you want to use them, simply declare them on each page that extend your app/Resources/views/layout.html.twig.

Note: If you use c975L/PageEdit the variables are already passed to layout.html.twig.

 Override a block

You can override any block in the template, to do so, simply add the following in your app/Resources/views/layout.html.twig:

Have a look at Resources/views/layout.html.twig, to see all available blocks.

 Disable a block

To disable a block, simply add the following in your app/Resources/views/layout.html.twig:

Have a look at Resources/views/layout.html.twig, to see all available blocks.

 Use the display variable

In your app/Resources/views/layout.html.twig you can use the following to include (or not) templates:

if display is not defined, hten it's define to html.

 Matomo javascript

You can easily add a call to matomo by adding the following in your app/Resources/views/layout.html.twig:

 CookieConsent

You can easily add a call to CookieConsent by adding the following in your app/Resources/views/layout.html.twig

 Alternate languages

You can define the meta <link rel="alternate" hreflang="YOUR_LANGUAGE" href="URL_WITH_ALTERNATE_LANGUAGE"> by setting a languagesAlt array in your app/Resources/views/layout.html.twig

It will replace the current language by the ones set in languagesAlt using the following scheme https://example.com/LANGUAGE/pages/XXX.

Having this array set, you can also use navbarLanguagesDropdownMenu.html.twig in your navbar to display a dropdown menu to select available languages.

 ogImage

You can define an ogImage to use on page basis, with the following code:

 Animations

There's a css file in public/css/ that you can link to to use some animations

 Error pages

You can also use the templates for common error pages. For this, you need to follow How to Customize Error Pages to create the structure app/Resources/TwigBundle/views/Exception and files for each type of error. Of course you can still stop at the level of overidding TwigBundle/Exception, but if you want to use the pre-defined error templates, do the following:

The types of error covered by SiteBundle are:

In each file copy/paste the following code:

 Add stylesheets

To add stylesheets, simply add the following in your app/Resources/views/layout.html.twig:

 Add javascripts

To add javascripts, simply add the following in your app/Resources/views/layout.html.twig:

 Full layout example

You can use this full layout example as a basis for your project:

 Use pre-defined models

There are two ways to use the pre-defined models, include or embed, both are based on country an language: {% include '@c975LSite/models/COUNTRY/LANGUAGE/terms-of-sales.html.twig' %}. You can see an example below for Terms of sale for France in fr (french).

If you have a multlingual website you can call by ommitting the language {% include '@c975LSite/models/COUNTRY/terms-of-sales.html.twig' %}, SiteBundle will check if your current language is available and will display it, or will display the default language if not.

Use whole file (include)

You want to use the whole file, place this code in your template:

 Select blocks (embed)

You want to select the displayed blocks, place this code in your template. Note that you have to specify the language in the embed function:

 Available models

You can find below a table containing all the models available per country and language. Feel free to update them, add translations or countries. By convention files are named using "-" with the english name.

Model France
Cookies fr
Copyright fr
Legal notice fr
Privacy policy fr
Tems of sales fr
Tems of use fr

To facilitate reading, models are also available in Markdown format. If you do a modification, you can use Command php bin/console models:twig2md to convert Twig models templates to their Markdown equivalent.

If this project help you to reduce time to develop, you can sponsor me via the "Sponsor" button at the top :)

AssetController

You can use this route to serve an asset file, by using the following code in your Twig template: {{ path('asset_file', {'file': 'your/path/your_file.ext[.ext2]'}) }}.

file name can contain uppercase, lowercase, accented letters, "-", "_", "/", "\", only spaces are not allowed. You can also use 2 file extensions.

This will be helpful if you want to give access to your assets to registered users. You simply need to add - { path: ^/your/path, roles: ROLE_USER } to config/packages/security.yaml > access_controlpart. And you can add an http basic authentication on the asset folder itself.

DownloadController

You can use this route to force the download of an asset file, by using the following code in your Twig template: {{ path('download_file', {'file': 'your/path/your_file.ext[.ext2]'}) }}.

file name can contain uppercase, lowercase, accented letters, "-", "_", "/", "\", only spaces are not allowed. You can also use 2 file extensions.

This will be helpful in case of text files like json or whatever.nt to give access to your assets to registered users. You can also protect your route by adding - { path: ^/your/path, roles: ROLE_USER } to config/packages/security.yaml > access_controlpart. And you can add an http basic authentication on the download folder itself.

Twig Components

Some Twig components are available, check templates/components to see them. An example of use is in each component file.


All versions of site-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
c975l/config-bundle Version *
c975l/includelibrary-bundle Version *
c975l/services-bundle Version *
symfony/form Version *
symfony/framework-bundle Version *
symfony/ux-twig-component 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 c975l/site-bundle contains the following files

Loading the files please wait ....