[SOLVED] Widget parameters problem

I have written a widget and am passing a parameter to it but I keep getting "Undefined variable: designations"

Widget code:




<?php

class Designation_Logo_Small extends CWidget

{

  var $designations;


  public function init() {

  } // public function init()


  public function run() {

    $this->render('designation_logos_small', $designations);

  } // public function run()

} // class Designation_Logo_Small



Called like this:


  

$designations = array('c' => true, 

                      'r' => true, 

                      's' => true, 

                      'm' => false

                     );

$this->widget('designation_logo_small', array('designations' => $designations));



What am I doing wrong here? This widget is being called from another widget’s view, could that be part of the problem?




<?php

class Designation_Logo_Small extends CWidget

{

  public $designations;


  public function init() {

  } // public function init()


  public function run() {

    $this->render('designation_logos_small', $this->designations);

  } // public function run()

} // class Designation_Logo_Small



I think it’s because you are referencing designations like a local variable.

Yes, you are right, but I still get the error.

Nope, changed it to public and still same error.

Got it to work like this:




<?php

class Designation_Logo_Small extends CWidget

{

  public $designations;


  public function init() {

  } // public function init()


  public function run() {

    $this->render('designation_logos_small', array('designations' => $this->designations));

  } // public function run()

} // class WelcomeBlock