PHP Analytics

Quickstart Guide

After having installed the library, you can create your first table report. Let’s check how to do this.

Create your pivot

Since you defined your own cube, let’s see how to display a pivot on this cube.
- You add a few lines of code inside the view you want the pivot to be displayed.
- As the pivot makes some ajax queries, you add a zend controller action to handle the queries.
That’s it !

Controller

class myController extends Zend_Controller_Action
{
public function ajaxAction()
{
Zend_Controller_Action_HelperBroker::addPrefix(
'OlapNavigator_Controller_Action_Helper'
);
$this->ajaxPivot($this->getRequest());
}
}

View

<?php $this->headScript()->appendFile('/js/lib/Pivot.js'); ?>
<div id="pivot_container">
</div>
<script type="text/javascript">
new Pivot({
url: '/my/ajax',
cube: 'cube name',
columns: ‘dimension name’,
rows: "dimension name"
});
</script>

This shows you a basic usage of the JavaScript component. You will find more to come in the API.