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 is how it should look | |
news: | |
name: News | |
singular_name: Article | |
slug: latest | |
fields: | |
title: | |
type: text | |
class: large |
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 | |
// | |
// this file sits in public/index.php | |
require_once "../vendor/autoload.php"; | |
$configuration = new Bolt\Configuration\Standard(dirname(__DIR__)); | |
$configuration->setPath("web","public"); | |
$configuration->setPath("files","public/files"); | |
$configuration->setPath("themebase","public/theme"); |
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
pages: | |
name: Pages | |
singular_name: Page | |
field_defaults: &defaults | |
title: | |
type: text | |
class: large | |
slug: | |
type: slug | |
uses: title |
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
$app->initialize(); | |
$app['upload'] = $app->extend('upload', function ($handler, $app) { | |
if ($app['request']->get('contenttype') == 'pages') { | |
$handler->addRule('size', ['size' => '100K'], '{label} uploads are limited to {size}', 'Page Image'); | |
} | |
return $handler; | |
}); | |
$app->run(); |
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 | |
// in Myapp/Provider/ControllerProvider.php | |
namespace Myapp\Provider; | |
use Silex\ServiceProviderInterface; | |
use Silex\Application; | |
use Myapp\Routing\ControllerResolver | |
/** |
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
# 1. composer.json | |
{ | |
"name": "ross/myproject", | |
"description": "My Project", | |
"license": "proprietary", | |
"require": { | |
"bolt/bolt": "~2.1", | |
.... other requirements |
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 Boorj\Bolt; | |
use Bolt\Configuration\Standard; | |
use Symfony\Component\HttpFoundation\Request; | |
class Configuration extends Standard | |
{ | |
/** |
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 My\Custom\Controller; | |
use Bolt\Controllers\Frontend as BoltFrontend; | |
class Frontend extends BoltFrontend { | |
public function record(Request $request, $contenttypeslug, $slug = '') | |
{ | |
parent::record($request, $contenttypeslug, $slug); |
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
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
VirtualDocumentRoot /home/%1/public | |
UseCanonicalName Off | |
SetEnv ENV production | |
<Directory /home/> | |
Options Indexes FollowSymLinks MultiViews | |
Require all granted | |
</Directory> |
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 | |
public function parseResizedImages($text) { | |
$doc = new DOMDocument(); | |
@$doc->loadHTML($text); | |
$tags = $doc->getElementsByTagName('img'); | |
foreach ($tags as $tag) { | |
if (substr($tag->getAttribute("src"),0,7) == "/files/") { | |
if ($wid = $tag->getAttribute("width")) { | |
$pathParts = pathinfo($tag->getAttribute("src")); |