本文整理汇总了PHP中CFormModel::init方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormModel::init方法的具体用法?PHP CFormModel::init怎么用?PHP CFormModel::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFormModel
的用法示例。
在下文中一共展示了CFormModel::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
$this->GAD_728x90 = SiteVariable::model()->findByPk('GAD_728x90')->value;
$this->GAD_336x280 = SiteVariable::model()->findByPk('GAD_336x280')->value;
$this->GAD_728x15 = SiteVariable::model()->findByPk('GAD_728x15')->value;
}
示例2: init
public function init()
{
$this->folderFiles = Yii::app()->getModule('exchange1c')->folderFiles;
$this->readFileProducts = Yii::app()->getModule('exchange1c')->readFileProducts;
$this->readFileCategory = Yii::app()->getModule('exchange1c')->readFileCategory;
return parent::init();
}
示例3: init
public function init()
{
$this->getFromMemory();
$criteria = new CDbCriteria();
$criteria->order = "communication_port asc, communication_type asc";
$stations = Station::model()->findAll($criteria);
if (count($stations) > 0) {
foreach ($stations as $station) {
switch ($station->communication_type) {
case 'direct':
case 'sms':
$connection_type = $station->communication_port;
break;
case 'tcpip':
$connection_type = $station->communication_esp_ip . ':' . $station->communication_esp_port;
break;
case 'gprs':
$connection_type = 'poller:' . $station->station_id_code;
break;
case 'server':
$connection_type = 'tcp:' . $station->communication_esp_ip . ':' . $station->communication_esp_port;
break;
}
$this->all_sources[$connection_type] = $connection_type;
}
}
return parent::init();
}
示例4: init
public function init()
{
if (file_exists($this->getSavePath() . $this->fileName)) {
$this->setAttributes(unserialize(file_get_contents($this->getSavePath() . $this->fileName)));
}
return parent::init();
}
示例5: init
public function init()
{
foreach ($this->getConfig() as $config) {
$this->config[$config->key] = $config->value;
}
parent::init();
}
示例6: init
public function init() {
if (file_exists(Yii::app()->basePath . '/data/version'))
$this->_sversion = file_get_contents(Yii::app()->basePath . '/data/version');
else
$this->_sversion = "3.0";
return parent::init();
}
示例7: init
public function init()
{
$yiidatetimesec = Yii::app()->locale->getDateFormat('yiidatetimesec');
$phpdatetime = Yii::app()->locale->getDateFormat('phpdatetimes');
$this->from_date = date($phpdatetime, CDateTimeParser::parse('01/01/' . date('Y') . ' 00:00:00', $yiidatetimesec));
$this->to_date = date($phpdatetime);
return parent::init();
}
示例8: init
public function init()
{
$this->required_tables['settings'] = array('settings', 'station', 'station_group', 'station_group_destination', 'station_calculation', 'station_calculation_variable', 'station_sensor', 'station_sensor_feature', 'sensor_handler', 'sensor_handler_default_feature');
$this->not_critical_tables['settings'] = array('schedule_report', 'schedule_report_to_station', 'schedule_report_destination', 'ex_schedule_report', 'ex_schedule_report_destination');
$this->depends_tables = array('schedule_report_to_station' => array('schedule_report', 'schedule_report_destination'));
$this->required_tables["user_settings"] = array("user", "access_user", "access_global");
// $this->_logger = LoggerFactory::getFileLogger('exportAdminSettings');
parent::init();
}
示例9: init
public function init()
{
// PHP 5.4 only ;(
/*array_map(function($item){
$this->{$item} = param($item);
}, self::$settings);*/
$this->loadSettings();
parent::init();
}
示例10: init
public function init()
{
parent::init();
foreach ($this->getAttributes() as $prop => $value) {
if ($attr = SiteVariable::model()->findByPk($prop)) {
$this->{$prop} = $attr->value;
}
}
}
示例11: init
public function init()
{
// Intercept this controller
Yii::app()->interceptor->intercept($this);
// Fire Event
if ($this->hasEventHandler('onInit')) {
$this->onInit(new CEvent($this));
}
return parent::init();
}
示例12: init
public function init()
{
$sql = "SELECT `station_id`, CONCAT(`station_id_code`, ' - ', `display_name`) AS `name`\n FROM `" . Station::model()->tableName() . "`\n WHERE `station_type` = 'rain' ORDER BY `station_id_code` ";
$stations = CStubActiveRecord::getDbConnect(true)->createCommand($sql)->queryAll();
if ($stations) {
$this->stations = CHtml::listData($stations, 'station_id', 'name');
}
$this->getFromMemory();
return parent::init();
}
示例13: init
public function init()
{
$cur_time = time();
$some_time_ago = $cur_time - 86400;
$sql = "SELECT `station_id`, CONCAT(`station_id_code`, ' - ', `display_name`) AS `name`\n FROM `" . Station::model()->tableName() . "`\n ORDER BY `station_id_code` ";
$stations = CStubActiveRecord::getDbConnect(true)->createCommand($sql)->queryAll();
if ($stations) {
$this->all_stations = CHtml::listData($stations, 'station_id', 'name');
}
$this->date_from = date('m/d/Y', $some_time_ago);
$this->date_to = date('m/d/Y', $cur_time);
$this->time_from = date('H:i', $some_time_ago);
$this->time_to = date('H:i', $cur_time);
return parent::init();
}
示例14: init
public function init()
{
$cur_time = strtotime(date('Y-m-d H:i:s'));
$some_time_ago = $cur_time - 7200;
$this->all_stations = Station::getList('all', false);
$this->date_from = date('m/d/Y', $some_time_ago);
$this->date_to = date('m/d/Y', $cur_time);
$this->time_from = date('H:i', $some_time_ago);
$this->time_to = date('H:i', $cur_time);
$this->interval = 30;
if ($this->all_stations) {
foreach ($this->all_stations as $key => $value) {
$this->stations[$value['station_id']] = $value['station_id_code'] . ' ' . $value['display_name'];
}
}
$this->do_import = 0;
$this->station_id = $this->all_stations[0]['station_id'];
return parent::init();
}
示例15: init
public function init()
{
$this->getFromMemory();
$this->all_stations = Station::getList('rain');
$handler = array();
SensorDBHandler::handlerWithFeature($handler, 'rg');
$features = array_shift($handler)->features;
if ($this->all_stations) {
foreach ($this->all_stations as $key => $value) {
$this->all_stations[$key]['filter_limit_max'] = round($features['rain']->filter_max / 60 * $this->rate_volume, 2);
$this->all_stations[$key]['filter_limit_min'] = round($features['rain']->filter_min / 60 * $this->rate_volume, 2);
$this->all_stations[$key]['filter_limit_diff'] = round($features['rain']->filter_diff / 60 * $this->rate_volume, 2);
// $this->all_stations[$key]['filter_limit_max'] = round(($value['filter_limit_max']/60) * $this->rate_volume,2);
// $this->all_stations[$key]['filter_limit_min'] = round(($value['filter_limit_min']/60) * $this->rate_volume,2);
// $this->all_stations[$key]['filter_limit_diff'] = round(($value['filter_limit_diff']/60) * $this->rate_volume,2);
$this->stations[$value['station_id']] = $value['station_id_code'] . ' - ' . $value['display_name'];
}
}
return parent::init();
}