What to do when you want to update your Bolt CMS from bolt.cm
I've found the page on the offical website omits important details
Init.php:
<?php
use Bolt\Extension\YOURNAME\YOUREXTENSION\Extension;$app['extensions']->register(new Extension($app));
Extension.php:
<?php
namespace Bolt\Extension\YOURNAME\EXTENSIONNAME;
use Bolt;
class Extension extends \Bolt\BaseExtension
{
public function getName() {
return "EXTENSIONNAME";
}function info() {
$data = array(
'name' =>"EXTENSIONNAME",
'description' => "DESCRIPTION",
'author' => "A. Wildi",
'link' => "http://example.ch",
'version' => "1.0",
'required_bolt_version' => "2.0",
'highest_bolt_version' => "3.9",
'type' => "Twig function",
'first_releasedate' => "2012-10-10",
'latest_releasedate' => "2016-03-09",
);return $data;
}
function initialize() {
$this->addTwigFunction('helloWorld', 'twigHelloWorld');
}
function twigHelloWorld($name) {
$html = "Hello, ". $name ."!";
return new \Twig_Markup($html, 'UTF-8');
}}
I hope this helps.
Need help with Bolt? Need a Bolt extension, a custom Online Shop with the same design as your bolt site? Contact me under me at andreaswildi com to see my references and we'll define the requirements and price for the whole project.
I've recently started working on a per project basis in order to become location independent.
Headhunters: Please don't contact me unless your client offers 100% remote working.
Keywords:
Schweizer Bolt CMS Hilfe, Bolt CMS