Model or Controller

Hi,

I have a class that does tax calculations and has to be accessed by the controllers.

My question is, what and how do I create it. If I use gii and want to create a module then I need a database table. What is the best to do in this scenario?

Your assistance would be appreciated.

take care of conventions: http://www.yiiframework.com/doc/guide/1.1/en/basics.convention

then just import your class in your controller or model


Yii::import('path.to.my.Class');

Hi,

Thanx for the reply, how do I call the function because $this->Calculation($arr) does not work.




//TaxCalculator class in directory extensions/myClasses/TaxCalculator.php

Yii::import('ext.myClasses.TaxCalculator');

$calculator = new TaxCalculator();

$calculator->calculate();



Thank you, this was very helpful!!