简体   繁体   中英

Generating statistics using PHP and Zend Framework

I want to build a statistics generator that should be able to use intervals such as hour, day, week, month etc and group on different levels such as customer, campaign, project. I first built this as a standard action function in a controller but I feel I might actually want to break this out and make it a class and make it reusable. Are there any good standards for building these type of statistics generators in a general way?

Add data collections, set interval and set grouping and a start and end date feels like the usage I would be needing.

Check out http://www.phpclasses.org/ for built classes but if your using zend framework i thin you mean the word model not class if your using an MVC your building a model

O and for statics use your views and just use google analytics its pointless trying to build one better

Two best solution Using Google Analytics Class

Google Analytics View Helper

or Piwik

I do not believe that this should be a Zend Framework question, it's to abstract of a problem and has nothing to do with the MVC framework you're using, just the M part, because the problem you are trying to solve is tied to your data model.

You can take a look at how Doctrine and Propel handle adding criteria to the queries, that could be a good place to start.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM