You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// set a setting after the initialization$myLibrary->setSetting('key3', 'value3');
// access setting by keyecho$myLibrary->setting('key1'); // value1// choose a default value if key doesn't existecho$myLibrary->setting('noexist', 'foo'); // foo
Data methods
// clear all data$myLibrary->clearData();
// set data$myLibrary->setData('index1', $data['index1']);
$myLibrary->setData('index2', $data['index2']);
// access data by keyecho$myLibrary->data('index1/a1'); // v1// choose a default value if key doesn't existecho$myLibrary->data('noexist', 'bar'); // bar// choose a default value if key doesn't exist of it exists but it's emptyecho$myLibrary->dataElse('noexist', 'bar'); // bar// get all data$data = $myLibrary->getData();
Other methods
// get an array representation of the library$array = $myLibrary->toArray(); // ['data'=> [...], 'settings' => [...]]