24 lines
425 B
PHP
24 lines
425 B
PHP
|
<?php
|
||
|
|
||
|
namespace itguild\forms\form\traits;
|
||
|
|
||
|
trait CreateParams
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @param array $data
|
||
|
* @return string
|
||
|
*/
|
||
|
public function createParams(array $data = []): string
|
||
|
{
|
||
|
$paramsString = "";
|
||
|
foreach($data as $key => $param){
|
||
|
if(is_string($param)){
|
||
|
$paramsString .= $key . "='" . $param . "'";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return $paramsString;
|
||
|
}
|
||
|
|
||
|
}
|