NikkiLoveGod Posted December 30, 2010 Share Posted December 30, 2010 Hi all, I'm at the verge of my skills with the next dilemma, and need help from fine ppl like you. I need to build a highly flexible reporting system that has a "default" way of forming a report, and then there's a possibility for overwriting the default way. The main idea is that I have a default definition file that says something like <?php $datas = array("category" => array(array("type" => "value", "value" => "this_value"), array("type" => "value", "value" => "another_value")), "another_category" => array(...)); ?> and I include this definition file in a report file, which then includes a second file, a datafetcher which is then somehow supposed to get that value with a defined way. The trick is, that I might have 100 of these variables, and some of them, or all of them, have to be redefinable by another included file, another datafetcher. These customized datafetchers are there because I might want to create a same report to multiple targets which varies in their datas locations. Ofcourse there's other "types" also, like "filters", which gets the same data as the normal "value" types, but filters it somehow. I'm having hard time figuring out how to do this. How should I get the value for "this_value" and "another_value". Idea is to get an array looks something like this: <?php $datas = array('category' => array('this_value' => 1234, 'another_value' => 4321), ....); ?> So it should first take into account what type the value is, then start building it accordingly, and then what value it is so it know what to get. Both of these should be overwritable. Should the way to get the data be some functions like this_value(); another_value();? Then how would I take the type in account? Or overwriting as I can't redeclare functions (procedural). Or maybe some switch -conditional that has the case's included in order? Im probably sending very confusing message here, but I am confused If you could give me your 2cents and point me to the right direction, it would be awesome! Or some reference data where I can learn more would be cool too. Quote Link to comment https://forums.phpfreaks.com/topic/222965-reporting-system-with-dynamic-dataretrieval/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.