I want to get value in array format with various keys for the method.
Class File
<?php
class Hooks
{
private $version = '1.4';
public $hook = array();
public function __construct(){ }
public function get_item_hook()
{
//bla bla bla
$this->hook['foo'] = 'resulting data for foo';
$this->hook['foo1'] = 'resulting data for foo1';
$this->hook['foo2'] = 'resulting data for foo2';
return $this->hook;
}
public function get_item2_hook()
{
//bla bla bla
$this->hook['another'] = 'resulting data for another';
$this->hook['another1'] = 'resulting data for another1';
$this->hook['another2'] = 'resulting data for another2';
return $this->hook;
}
}
?>
Code FIle
<?php
// this is in another file
include ('path to above class file');
$hook = new Hooks;
$hook->get_item_hook();
//now how can I get value of $this->hook array()???
$hook->get_item2_hook();
//now how can I get value of $this->hook array()???
?>