Product support

Get help in the plugin support forum.


Useful for more complex data manipulation and rendering.


This plugin provides data structure implementations which are useful for everyday programming tasks. The game plan is to eventually add components for displaying contents of the data structures directly as well as for generating data structures from form data. However, these structures can be used directly programmatically when building your own plugins.

If you find any bugs or problems in any of my data structures, please let me know. Thanks.


  • Grid
  • List
  • Enum (In Progress)

Planned Structures

  • Tree
  • Heap
  • Structure
  • Stack
  • Queue


Creates a grid like data structure, useful for transitioning data to an UI.

  • Takes in a 1-dimensional collection and is able to automatically format it into a grid of items.
  • Can automatically output sizings for creating row and columns with CSS libraries like Bootstrap and Material CSS.
  • Abstract the sizing further to allow compatbility with more grid CSS libraries


Creates a list of data useful for data manipulation.

  • Expands upon the existing OctoberCMS collection
  • Allows for a limit to the list
  • Create the ability to drop the first entered items if the list exceeds its capacity on a list.push operation
  • Intelligent merging
  • Create a core for the stack and queue data structures to build off (Extends).


Useful to abstract away state based String comparisons

  • Enum


The tree data structure will be useful for searching, sorting, heaps, and organization.

  • B-tree
  • B-search tree
  • Tree
  • AVL Tree
  • Expression Tree


The heap is used for efficient finding min, maxes, and sorting.

  • Min/Max heap
  • Min heap
  • Max heap
  • Heap sorting


A play off of C++ structures. Allows for creation of a data structure with X fields.

  • Basic structures. Think of models without the need for a database


Great for parsing and reversing orders

  • Stack


An expanded List data structure. Tailored to maintain order.

  • Queue
  • Priority queue


  1. Install the Clake.DataStructutres plugin.
  2. You're done :)


Include the class file for the data structure you would like to use. So far, you can use the Enum, Grid, and Lists data structures. A detailed description of what these do can be found on the overview page.


First initialize the grid with some properties. Then, call the gridify method and pass it some data. From there you can retrieve rows of data, specific row&cols of data and automatically calculated responsive CSS style sizings.

This will create a grid with 3 columns and as many rows as it needs to fit all the data. Then, it will split $data up into each slot in the grid from left to right, top to bottom.

$grid = Grid::init(3, 0)->gridify($data);

This will get the piece of data in row 2 and column 3.

$piece = $grid->getIndex(3, 2);

This will return an array of responsive CSS style measurements for small, medium, and large screens. Useful for libraries like Bootstrap and MaterialCSS.

$style = $grid->getAllColStyleSize();
<div class="col-sm-$style['s'] col-md-$style['m'] col-lg-$style['l']">Column 1</div>
<div class="col-sm-$style['s'] col-md-$style['m'] col-lg-$style['l']">Column 2</div>
<div class="col-sm-$style['s'] col-md-$style['m'] col-lg-$style['l']">Column 3</div>


First, create a new list and pass it some data.

$list = new List($data);
$list2 = List::create($data);

Enable/Disable automatic list size limiting. This if off by default.


Set the limit of the list. This will also turn on limiting.


Push more data onto the list. This will chop off the first in data to the list if limiting is turned on.


Retrieve the list. Limits the list if limiting is turned on.


Get the whole list regardless of limiting.



You MUST extend the Enum class to create an Enum.

class eAppStates extends Clake\DataStructures\Classes\Enum
    $enum = ["LOADING", "STARTING", "EXITING"];

Create an Enum instance

$appState = eAppStates::LOADING();

Change what the Enum instance is set as and returns the Enum instance


Compares two Enums for equality

$appState2 = eAppState::LOADING();
    echo "The app states are equal";

First version of DataStructures

Dec 15, 2016