Möchte man eine Contao Erweiterung in mehreren Projekten einsetzen und/oder der Allgemeinheit zur Verfügung stellen, legt man dazu am besten ein Bundle an und veröffentlicht es auf Packagist. Dann lässt sich die Erweiterung einfach über Composer oder den Contao Manager installieren. Dieses Tutorial beschreibt wie das unter Verwendung des Skeleton Bundles funktioniert. Dabei wird ein Bundle erstellt, das ein Inhaltselement erzeugt, das "Hello World" ausgibt. Folgendes werden wir machen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Deployer; | |
require 'recipe/common.php'; | |
// Project name | |
set('application', 'enovate.co.uk'); | |
// Project repository | |
set('repository', 'git@githosting.com:enovatedesign/project.git'); |
Mit der folgenden Anleitung wird ein lokales Contao 4 Bundle angelegt, das ein Inhaltselement mit der Ausgabe "Hello World" erzeugt.
Das Bundle wird nicht über Composer installiert, sondern einfach in die Anwendung gelegt. Es wird nicht das AppBundle verwendet, sondern ein eigener Vendor und Bundle Name.
Der Vendor Name für das Beispiel ist "Acme" der Bundle Name "TestBundle". Diese Strings müssen bei einem eigenen Bundle entsprechend ersetzt werden.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creates a new promise that automatically resolves after some timeout: | |
Promise.delay = function (time) { | |
return new Promise((resolve, reject) => { | |
setTimeout(resolve, time) | |
}) | |
} | |
// Throttle this promise to resolve no faster than the specified time: | |
Promise.prototype.takeAtLeast = function (time) { | |
return new Promise((resolve, reject) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Map CSV file to array | |
$rows = array_map('str_getcsv', file('data.csv')); | |
$header = array_shift($rows); | |
$data = array(); | |
foreach ($rows as $row) | |
{ | |
$data[] = array_combine($header, $row); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A helper file for Laravel 5, to provide autocomplete information to your IDE | |
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18. | |
* | |
* @author Barry vd. Heuvel <barryvdh@gmail.com> | |
* @see https://github.com/barryvdh/laravel-ide-helper | |
*/ | |
namespace { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This set of mixins allows you to create margin and padding classes dynamically. | |
// In html, you would specify <div class="mr20-xs">Content</div> to give you margin-right: 20px | |
// It is based on the responsive capabilities of Bootstrap. <div class="mr20-sm"> would give you | |
// 20 pixels of right margin on screens small and larger. | |
// Mixin control | |
// .make-margins(@breakpoint, @size, @decrement) | |
// @breakpoint: To be used with Bootstrap. Must supply breakpoints: xs, sm, md or lg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
apt-get update | |
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make | |
mkdir -p /etc/php7/conf.d | |
mkdir -p /etc/php7/cli/conf.d | |
mkdir /usr/local/php7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function( $ ) { | |
console.log("start"); | |
$( '#form-add-setting' ).on( 'submit', function() { | |
//..... | |
//show some spinner etc to indicate operation in progress | |
//..... | |
console.log("Submitting"); | |
$.post( | |
$( this ).prop( 'action' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Define the servers | |
*/ | |
server('production-web', '<your server url>') | |
->path('<path to the project on your server>') | |
->user('<user on the server>') | |
->pubKey(); | |
/* |
NewerOlder