Skip to content
This repository was archived by the owner on Aug 29, 2017. It is now read-only.

Commit

Permalink
Merge pull request #1 from GawainLynch/master
Browse files Browse the repository at this point in the history
Bolt 2 clean ups
  • Loading branch information
bobdenotter committed Oct 17, 2014
2 parents 5567ac0 + ba0a8a6 commit 1e60322
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 35 deletions.
31 changes: 5 additions & 26 deletions Extension.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,19 @@
<?php
// Testing Snippets extension for Bolt

namespace TestSnippets;
namespace Bolt\Extension\Bolt\TestSnippets;

use Bolt\Extensions\Snippets\Location as SnippetLocation;

class Extension extends \Bolt\BaseExtension
{

function info() {

$data = array(
'name' =>"Snippets Tester",
'description' => "A developer extension to add snippets to all available locations in a sensible HTML document.",
'author' => "Bob den Otter",
'link' => "http://bolt.cm",
'version' => "1.1",
'required_bolt_version' => "1.0",
'highest_bolt_version' => "1.0",
'type' => "Twig function",
'first_releasedate' => "2012-10-10",
'latest_releasedate' => "2013-01-27",
);

return $data;

}

public function getName()
{
return "Test Snippets";
}

function initialize() {

public function initialize()
{
$this->insertSnippet(SnippetLocation::START_OF_HEAD, 'callback', "startofhead");
$this->insertSnippet(SnippetLocation::START_OF_HEAD, "<!-- inserted string snippet startofhead -->");

Expand Down Expand Up @@ -68,9 +48,8 @@ function initialize() {
$this->insertSnippet(SnippetLocation::AFTER_HTML, "<!-- inserted string snippet afterhtml -->");
}


function callback($var) {

public function callback($var)
{
$html = "<!-- snippet inserted via callback with parameter '$var'.. -->";

return new \Twig_Markup($html, 'UTF-8');
Expand Down
11 changes: 3 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bolt/TestSnippets",
"description": "",
"name": "bolt/testsnippets",
"description": "A developer extension to add snippets to all available locations in a sensible HTML document.",
"type": "bolt-extension",
"keywords": [],
"require": {
Expand All @@ -18,12 +18,7 @@
"init.php"
],
"psr-4": {
"TestSnippets\\": ""
}
},
"extra": {
"branch-alias": {
"dev-master": "1.7.*"
"Bolt\\Extension\\Bolt\\TestSnippets\\": ""
}
}
}
2 changes: 1 addition & 1 deletion init.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

use TestSnippets\Extension;
use Bolt\Extension\Bolt\TestSnippets\Extension;

$app['extensions']->register(new Extension($app));

0 comments on commit 1e60322

Please sign in to comment.