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 | |
class Deprecated | |
{ | |
/** | |
* Shortcut for triggering a deprecation warning for a method. | |
* | |
* Example: | |
* class Foo | |
* { |
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['upload'] = $app->share( | |
$app->extend( | |
'upload', | |
function ($uploadHandler) { | |
$uploadHandler->addRule('size', ['max' => '2M']) | |
return $uploadHandler; | |
} | |
) |
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 MyApp\Twig; | |
use Twig_Extension; | |
use Twig_SimpleFilter; | |
class TwigExtension extends Twig_Extension | |
{ | |
public $app; |
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 Bundle\Site; | |
use Bolt\Storage\Entity\Content; | |
use Bolt\Extension\SimpleExtension; | |
use Bolt\Events\StorageEvent; | |
use Bolt\Events\StorageEvents; | |
/** | |
* Site bundle extension loader. |
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['upload'] = $app->share( | |
$app->extend( | |
'upload', | |
function ($uploadHandler) { | |
$uploadHandler->setSanitizerCallback( | |
function ($filename) { | |
// Do things with filename string here. | |
return $filename; | |
} | |
); |
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 | |
fields: | |
title: | |
type: text | |
class: large | |
group: content | |
slug: | |
type: 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
<?php | |
namespace MyNewApp\Command; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Bolt\Application; |
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 MyApp\Response; | |
use Symfony\Component\HttpFoundation\Response; | |
class CsvResponse extends Response | |
{ | |
protected $data; |
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
paths: | |
web: public | |
themebase: public/theme | |
files: public/files | |
view: public/bolt-public/view | |
extensions: | |
- MyextOne\LocalExtensionOne | |
- MyextTwo\LocalExtensionTwo | |
- MyextThree\LocalExtensionThree |
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
(function($) { | |
$.belowthefold = function(element, settings) { | |
var fold = $(window).height() + $(window).scrollTop(); | |
return fold <= $(element).offset().top - settings.threshold; | |
}; | |
$.abovethetop = function(element, settings) { | |
var top = $(window).scrollTop(); | |
return top >= $(element).offset().top + $(element).height() - settings.threshold; |
NewerOlder