<?php
class DUserOverview extends CWidget
{
public $companyID;
public $_data;
/**
* Renders the detail view.
* This is the main entry of the whole detail view rendering.
*/
public function run()
{
$_data = Users::model()->find('company='.$companyID);
if(isset($_data))
echo $_data->ID;
else
echo "nope";
}
}
?>
When I try to use the widget with the following code:
Only if it’s coming from “outside” (e.g. GET/POST parameter). If the value is generated in your code, parameter binding only adds unnecessary overhead.