Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

Classes:data

Avaq edited this page Mar 22, 2012 · 4 revisions

class \classes\Data

This is the class that is used for almost any multidimensional data within Tuxion.Framework. It is used for storage and manipulation of data, but also for Models and as a templating-language.

Usage

$data = Data(['foo' => 'bar']);
echo $data->foo; //bar

$data = Data('foo', 'bar');
echo $data[0]; //foo

$data[0]->set('baz');
$data->each(function(){
  echo $this.' | ';
});
//"baz | bar | "

echo $data->join(' | '); //"baz | bar"

The above example demonstrated a few of the methods available in instances of this class. See below for a list of all methods.

Methods

Getters

idx($index)

Returns the node present at given $index.

extract($input=null)

The extract function accepts different $input types to return a childnode, most importantly; an array to create a chain ['user', 'name'] = ->user->name.

get($as=null)

Returns the actual value of a node. Optionally returns it $as the given type.

Clone this wiki locally