Exemple #1
0
        public static IHtmlContent LayerUiEditor(this IHtmlHelper helper, string name, object value, string placeholder = "", EInputType inputType = EInputType.text, bool require = false)
        {
            var id = name.Replace(".", "_");

            var sb = new StringBuilder();

            var requireStr = require ? "require" : "";

            var inputTypeStr = inputType.ToString();

            sb.AppendLine(
                $@"<input class='layui-input' id='{id}' name='{name}' value = '{value}' placeholder='{
                        placeholder
                    }' type='{inputTypeStr}' {requireStr}>");

            return(new HtmlString(sb.ToString()));
        }