pageon / stitcher-core

High performance, static websites for PHP developers
MIT License
147 stars 6 forks source link

WalkableArray helper #4

Closed brendt closed 7 years ago

brendt commented 7 years ago

Arrays are used a lot within Stitcher for configuration and data files. An array helper should be added to be able to easily find and manipulate nested properties, like so:

$config = new WalkableArray($decodedConfigFile);

$property = $config->get('directories.src');

// or

$property = $config['directories.public'];

A try-out of this functionality can be found here: https://github.com/brendt/random-scripts/tree/master/array-finder