私も検証$type
し、使用しますget/set
。
private function somfunc($sql) {
// query and return result set as an array
}
private function mytype($type) {
switch ($type)
case topic: $sql="......";
return sql;
}
public function display($type) {
// switch case to require template
// call somefunc and mytype here
}
安全でない場合、コードを改善するにはどうすればよいですか?