From 72c1a09539a70ef0cf8b6d1a7d8a498218fa3dbf Mon Sep 17 00:00:00 2001 From: Kaspar Rosin Date: Mon, 17 Jan 2022 15:35:33 +0200 Subject: [PATCH] update docs --- CHANGELOG.md | 12 ++++++++++++ README.md | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5062f6c..46194da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.5.0] - 2021-01-10 + +### Changed + +- `nova_get_settings` returns keys that are not defined [#96](https://github.com/optimistdigital/nova-settings/pull/96) + - Previously keys, that were not defined, were not returned. + - Key value will be `null` unless a default value is provided. + +### Added + +- `nova_get_settings` now accepts `[key => value]` array of defaults. [#96](https://github.com/optimistdigital/nova-settings/pull/96) + ## [3.4.0] - 2021-01-10 ### Changed diff --git a/README.md b/README.md index bfd402b..d03e8ae 100644 --- a/README.md +++ b/README.md @@ -142,9 +142,9 @@ Text::make('A text field') ### Helper functions -#### nova_get_settings(\$keys = null) +#### nova_get_settings(\$keys = null, \$defaults = []) -Call `nova_get_settings()` to get all the settings formated as a regular array. If you pass in `$keys` as an array, it will return only the keys listed. +Call `nova_get_settings()` to get all the settings formated as a regular array. Additionally, you can pass a `key => value` array as a second argument: `nova_get_settings(['some_key], ['some_key' => 'default_value'])`. #### nova_get_setting(\$key, \$default = null)