本文整理汇总了PHP中DBObject::tableNameToClassName方法的典型用法代码示例。如果您正苦于以下问题:PHP DBObject::tableNameToClassName方法的具体用法?PHP DBObject::tableNameToClassName怎么用?PHP DBObject::tableNameToClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBObject
的用法示例。
在下文中一共展示了DBObject::tableNameToClassName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render($module, $model)
{
$rtn = "\n[[[\r\n \$prepopulate = (\$object->isNew() ? (isset(\$_POST['" . $this->name . "']) ? strip_tags(\$_POST['" . $this->name . "']) : '') : \$object->get" . DBObject::tableNameToClassName($this->name) . "() * 1000);\r\n \$alt_prepopulate = \$prepopulate;\r\n if (preg_match('/^\\d+\$/', \$prepopulate)) {\r\n \$alt_prepopulate = date('Y-m-d', \$prepopulate/1000);\r\n }\r\n]]]\n";
$id = get_random_string(5);
$rtn .= "\n<div id='{$id}' class='form-group'>\r\n <label class='col-sm-2 control-label' for='{$this->name}'>{$this->name} " . ($this->required ? $this->mandatory_field : '') . "</label>\r\n <div class='col-sm-10'>\r\n <div class='input-group'>\r\n <span class='input-group-addon'><i class='fa fa-calendar'></i></span>\r\n <input disabled='disabled' value='[[[ echo htmlentities(str_replace('\\'', '\"', \$alt_prepopulate)) ]]]' type='text' class='form-control altFormat' " . ($this->required ? ' required' : '') . " />\r\n <input value='[[[ echo htmlentities(str_replace('\\'', '\"', \$prepopulate)) ]]]' type='text' id='{$this->name}' name='{$this->name}' class='datepicker form-control' " . ($this->required ? ' required' : '') . " style='position: absolute; top:0; left: 0; z-index: -1' />\r\n </div>\r\n </div>\r\n</div>\r\n<div class='hr-line-dashed'></div>\r\n";
$rtn .= "\r\n <script type='text/javascript'>\r\n \$('#{$id} .datepicker').datepicker({\r\n " . (isset($this->options['dateFormat']) ? 'dateFormat: ' . "'" . $this->options['dateFormat'] . "'" : '') . "\r\n " . (isset($this->options['altFormat']) ? ',altField: "#' . $id . ' .altFormat", altFormat: "' . $this->options['altFormat'] . '"' : '') . "\r\n " . (isset($this->options['changeMonth']) ? ',changeMonth: ' . $this->options['changeMonth'] : '') . "\r\n " . (isset($this->options['changeYear']) ? ',changeYear: ' . $this->options['changeYear'] : '') . "\r\n " . (isset($this->options['yearRange']) ? ',yearRange: ' . "'" . $this->options['yearRange'] . "'" : '') . "\r\n });\r\n \$('#{$id} .input-group-addon').css('cursor', 'pointer').on('click', function(){\r\n \$('#{$id} .datepicker').datepicker('show');\r\n });\r\n </script>\r\n";
return $rtn;
}