Skip to content

Instantly share code, notes, and snippets.

<?php
class ProductFormBuilder extends FormBuilderBuilder
{
// Relax.. Pyro has automated this for you. Override as needed.
}
@RyanThompson
RyanThompson / b2tob3.md
Last active April 15, 2016 15:34
Migrating Beta2 to Beta3
  • First install a clean copy of PyroCMS Beta3 for reference.
  • Next update the composer.json file of your B2 install with that of the B3 install.
  • Mark your B2 install as INSTALLED=false.
  • composer update to bring in all the new goodies.
  • Add placeholder, warning, instructions to streams_fields_translations table.
  • Mark all streams in streams_streams as trashable=1 according to fresh install's table.
  • Add deleted_at (DATETIME) to all stream entry tables where the stream is marked trashable above.
  • Rename the stream groups to menus in streams_streams.
  • Rename the table navigation_groups to navigation_menus.
  • Rename the column group_id to menu_id in navigation_links.
#! Disable selinux first.
cd /
find . -print0 | xargs -0 -n 1 setfattr -h -x security.selinux
<?php
class ProductTableBuilder extends TableBuilder
{
protected $filters = [
'name',
'status'
];
Getting Started:
- Installation
- Configuration
- Artisan Commands
@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;
}
@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 / 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 / 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 / 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)
{