Skip to content

Instantly share code, notes, and snippets.

@RyanThompson
RyanThompson / coding-standards-example.php
Last active June 22, 2016 18:52
An example of the coding standards by AnomalyLabs.
<?php namespace Acme;
/**
* Class FooBar
*
* @link http://anomaly.is/foo-bar
* @author AnomalyLabs, Inc. <[email protected]>
* @author Ryan Thompson <[email protected]>
* @package Acme
*/
@RyanThompson
RyanThompson / suggested-class-structure.txt
Last active August 29, 2015 14:24
This is the suggested addon structure for Streams Platform packages and addons.
src/
Foo/FooModel
Foo/FooCollection // Transformed collection for FooModel
Foo/FooPresenter // Transformed presenter for FooModel
Foo/FooObserver // Observers can not be transformed
Foo/Table/FooTableBuilder // Assumes Foo/FooModel for $model property
Foo/Table/FooTableColumns // Handler for FooTableBuilder->columns
Foo/Form/FooFormBuilder // Assumes Foo/FooModel for $model property
Foo/Form/FooFormSections // Handler for FooFormBuilder->sections
@RyanThompson
RyanThompson / how-to-override-a-resolving-method.php
Created July 6, 2015 23:28
Resolving methods usually support class transformation. You can also override them like this.
<?php namespace Acme;
use Anomaly\Streams\Platform\Entry\EntryModel;
class FooModel extends EntryModel
{
/**
* Return a new model collection.
*
@RyanThompson
RyanThompson / property-handler-definition.php
Last active August 29, 2015 14:24
How to use property handlers.
<?php namespace Acme\Foo\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class FooFormBuilder extends FormBuilder
{
/**
* Define your property normally.
*/
@RyanThompson
RyanThompson / property-handler-with-property-closure-example.php
Created July 6, 2015 23:51
Here is an example of a property handler using a closure that will later be evaluated.
<?php namespace Acme\Foo\Form;
class FooFormFields
{
/**
* Handle the form fields.
*/
public function handle(FooFormBuilder $builder)
{
@RyanThompson
RyanThompson / property-normalization-example.php
Last active August 29, 2015 14:24
An example of property normalization and overriding.
<?php namespace Acme\Foo\Table;
use Anomaly\Streams\PlatTable\Ui\Table\TableBuilder;
class FooTableBuilder extends TableBuilder
{
/**
* The table buttons.
*/
@RyanThompson
RyanThompson / composer-create-project-pryocms-3.0.txt
Created July 7, 2015 05:15
Create a new PyroCMS 3.0 project via composer create-project.
composer create-project pyrocms/pyrocms {directory} 3.0 --prefer-dist
@RyanThompson
RyanThompson / pretty-urls.htaccess
Created July 7, 2015 05:19
Pretty URLs for Apache .htacces
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
@RyanThompson
RyanThompson / pretty-urls.conf
Created July 7, 2015 05:20
Pretty URLs for NGINX configuration files.
location / {
try_files $uri $uri/ /index.php?$query_string;
}
Getting Started:
- Installation
- Configuration
- Artisan Commands