跪求php大侠,不懂可以帮忙顶下
php中将业务处理跟逻辑区分开,分别由这些control,tpl,php共同实现一个页面!!!
现在类中的code
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
class HR {
function __construct(){}
public static function get_emp_list($cid){//我一般用静态函数
return DB::getAll('select * from erp_employee where cid='.DB::quote($cid));
//DB为数据库操作类
}
}
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
public function default_action(){
$hr = new HR;
$empid = "S0001";
[color=#FF0000]$info = $hr->get_emp_list($empid);[/color] //[[color=#0000FF]这个怎么知道Info里有啥啊[/color]?]
$args=array('arg1' => $empid,'arg2' => 'aaaaaaaaa');
//$args['empinfo'] = $info;
$this->show_page('index',$args);
}
public function show_page($tpl,$data=null,$return=false){
if(!is_null($data) && is_array($data)){
foreach($data as $key=>$item)[code=PHP]
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
<div class="sContent">
<dl>
<dt>员工流水号</dt>
<dd><ul><li><a href[color=#FF0000]=""><{$arg1}></[/color]a></li></ul></dd>
</dl>
<dl>
<dt>昵称</dt>
<dd[color=#FF0000]><{$arg2}></[/color]dd>
</dl>
</div>
<?php print <<<EOT <div class="sContent">
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号