Extending Controllers to avoid repetition


I was wondering if anybody else extends controllers for the following reason…

for example, i have an account object and it has child objects such as history, documents, ect…

in my history controller i extend from AccountBaseController… where AccountBaseController looks like this…

public $account;

function __construct($id,$module=null) {


    if (isset($_GET["account_id"])){

        $account = Account::model()->findByPk($_GET["account_id"]);

        if ($account===null){

            throw new Exception("There has been an error");


            $this->account = $account;





Does this seem like a reasonable approach?

Otherwise, in the history controller I find myself doing the following…

public function actionUpdate($account_id,$id)


      //code to save then



[color="#0000FF"]rather than…[/color]

public function actionUpdate($id)


      //code to save then