2017 © Pedro Peláez
 

library listing

Spiral Framework data listing on steroids

image

spiral/listing

Spiral Framework data listing on steroids

  • Monday, October 2, 2017
  • by wolfy-j
  • Repository
  • 3 Watchers
  • 1 Stars
  • 431 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 12 Versions
  • 2 % Grown

The README.md

Spiral Listing

License Build Status Scrutinizer Code Quality Coverage Status, (*1)

Install

Install module and register it:, (*2)

composer require spiral/listing
./spiral register spiral/listing 

Add bootloader to App.php:, (*3)

class App extends Core
{
    /**
     * List of classes and bootloaders to be initiated with your application.
     *
     * Attention, bootloader's bindings are compiled and cached, to reload application cache run
     * command "app:reload".
     *
     * @see \Spiral\Core\Bootloaders\Bootloader
     * @var array
     */
    protected $load = [
        // ...
        \Spiral\Listing\Bootloaders\ListingsBootloader::class,
        // ...
    ];
    // ...
}

Basic usage

Create view:, (*4)

<dark:use path="spiral:listing/*" prefix="listing:"/>

 




${context}

Create Listing instance and pass it to view:, (*5)

public function accountsListing(RecordSelector $selector) : Listing
{
    /** @var Listing $listing */
    $listing = $this->factory->make(Listing::class, [
        'selector' => $selector->distinct(),
    ]);

    $listing->addSorter('first_name', new BinarySorter('account.first_name'));
    $listing->addSorter('last_name', new BinarySorter('account.last_name'));

    $listing->addFilter(
        'first_name',
        new SearchFilter(['account.first_name' => SearchFilter::LIKE_STRING])
    );

    $listing->addFilter(
        'last_name',
        new SearchFilter(['account.last_name' => SearchFilter::LIKE_STRING])
    );

    $defaultState = new StaticState('last_name', [], SorterInterface::ASC);

    $listing
        ->setDefaultState($defaultState->withNamespace('accounts'))
        ->setNamespace('accounts');

    return $listing;
}

public function indexAction(AccountsSource $source) : string
{
    $listing = $this->accounts->accountsListing($source->find());

    return $this->views->render('keeper:accounts/list', [
        'listing' => $listing,
    ]);
}

The Versions

02/10 2017

dev-master

9999999-dev

Spiral Framework data listing on steroids

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

02/10 2017

v0.9.5

0.9.5.0

Spiral Framework data listing on steroids

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

02/10 2017

dev-vvval-patch-1

dev-vvval-patch-1

Spiral Framework data listing on steroids

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

05/06 2017

dev-feature/node-package

dev-feature/node-package

Spiral Framework data listing on steroids

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

11/04 2017

v0.9.4

0.9.4.0

Spiral Framework data listing on steroids

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

11/04 2017

v0.9.3

0.9.3.0

Spiral Framework data listing on steroids

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

06/04 2017

v0.9.2

0.9.2.0

Spiral Framework data listing on steroids

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

16/03 2017

v0.9.1

0.9.1.0

Spiral Framework data listing on steroids

  Sources   Download

MIT

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

14/03 2017

v0.9.0

0.9.0.0

Spiral Framework data listing on steroids

  Sources   Download

The Requires

 

The Development Requires

by Anton Titov / Wolfy-J

16/01 2017

dev-input_state_namespace

dev-input_state_namespace

Spiral Framework data listing on steroids

  Sources   Download

The Requires

 

by Anton Titov / Wolfy-J

01/12 2016

v0.1.3

0.1.3.0

Spiral Framework data listing on steroids

  Sources   Download

The Requires

 

by Anton Titov / Wolfy-J

01/12 2016

v0.1.2

0.1.2.0

Spiral Framework data listing on steroids

  Sources   Download

The Requires

 

by Anton Titov / Wolfy-J