vinou / site-builder
PHP library to generate template based webpages with dynamic content from the Vinou Plattform
Requires
- php: >=7.2
- bramus/router: *
- erusev/parsedown: ^1.7
- gumlet/php-image-resize: ^1.9
- mustangostang/spyc: ^0.5.1
- phpmailer/phpmailer: ^6.0
- s1syphos/php-simple-captcha: ^2.3
- thepixeldeveloper/sitemap: ^5.1
- twig/extensions: 1.*
- twig/twig: 2.*
- vinou/api-connector: ^3.0.0
- vinou/translations: 3.*
- dev-master
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.9.11
- 2.9.10
- 2.9.9
- 2.9.8
- 2.9.7
- 2.9.6
- 2.9.5
- 2.9.4
- 2.9.3
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.4
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.12
- 1.2.11
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-release/2.X
- dev-develop
- dev-optional_mail_delivery
- dev-optimized_captcha
- dev-+548_optimize_external_order_payment_methods
- dev-development
This package is auto-updated.
Last update: 2024-12-12 08:16:06 UTC
README
The Vinou Site-Builder is a PHP library that easily combine a basic php routing configured in a routes.yml file with Twig template rendering. The library also provides the possible to call libraries as data processors and pipe the result directly within the twig template.
Table of contents
Typical project structure
This example project structur can be found inside the repository in the Example/Project folder
Installation (via typical project structure)
This installation guide is based on our preferred project structure. This structure is developed over years and adopted from many OSS projects. Special thanks are going to the great TYPO3 community that we are participating over years and delivers a great knowhow and share ideas over years.
1. Setup project structure
composer require vinou/site-builder cp -R vendor/vinou/site-builder/Examples/Project/config ./ cp -R vendor/vinou/site-builder/Examples/Project/web ./
2. Modify your installation
Required modifications!
- Fill in your Vinou AuthId and token in config/settings.yml you can find them in your Vinou-Office
- Fill in your mail server credentials in config/mail.yml
Optional but typical modifications
- Configure Vinou API-Connector via Vinou constants
- Add basic but needed routes in config/routes.yml
Route configuration
1. General route parameters
2. Load sitemap configuration for route
PLEASE NOTICE: to use sitemap parameters your route must contain a variable placeholder
wines/{path_segment}: template: 'Wines/detail.twig' pageTitle: 'Wine detail page' public: true sitemap: function: getWinesAll params: lazy: false pageSize: 500 dataKey: 'wines' dataProcessing: wine: getWine
3. Use dataProcessing
The main principle is that you can define a key that is filled by the result of the function that is called within a specific processor. If no processor is set the Vinou API-Connector is used by default.
SHORTHAND NOTICE: If you don't need any additional function configuration and want to call an API-Connector function you can define a key directly with the function name
Example shorthand calls for wines and wineries
wines/{path_segment}: template: 'Wines/Detail.twig' pageTitle: 'wine detail page' public: true dataProcessing: wines: getWinesAll wineries: getWineriesAll
Example advanced config to combine wines and bundles into one items array
wines/{path_segment}: template: 'Wines/Detail.twig' pageTitle: 'wine detail page' public: true dataProcessing: wines: getWinesAll bundles: getBundlesAll items: processor: 'formatter' function: 'mergeData' useRouteData: FALSE useData: - wines - bundles wineries: getWineriesAll
4. Registered processors
5. Register your own processor
Create your own processor
<?php namespace YourVendor\YourNamespace\Processors; class YourProcessor extends \Vinou\SiteBuilder\Processors\AbstractProcessor { public function dataMagic ($data = NULL) { $formattedData = $data; // transform your data here or do other stuff return $formattedData; } }
Go to your index.php and load the processor before SiteBuilder instantiation
require_once __DIR__ . '/Path/to/YourProcessor.php';
Than use your processor directly in your route config
your-route-with-processor: template: 'Pages/template.twig' pageTitle: 'Page title' public: true dataProcessing: templatekey: class: '\YourVendor\YourNamespace\Processors\YourProcessor' funtion: 'dataMagic'
Classlist
Provider
This Library is developed by the Vinou GmbH.
Vinou GmbH
Mombacher Straße 68
55122 Mainz
E-Mail: kontakt@vinou.de
Phone: +49 6131 6245390