smarty 颜色选择框扩展
* Name: color_options * Input: * - name (optional) - string default "color" * - selected (optional) - string default not set * @author andsky * @param array * @param Smarty * @return string */ function smarty_function_color_options($params, &$smarty) { $name = empty( $params['name'] ) ? 'color' : $params['name']; $colors=array( "skyblue", "royalblue", "blue", "darkblue", "orange", "orangered", "crimson", "red", "firebrick", "darkred", "green", "limegreen", "seagreen", "teal", "deeppink", "tomato", "coral", "purple", "indigo", "burlywood", "sandybrown", "sienna", "chocolate", "silver" ); $_html_result = ''....