phpcms v9的系统类库有一个表单类,它封装了表单的一些组件,如编辑器、图片上传、时间选择器、模板选择器等,更详细请参考form.class.php。有了这些组件,在对phpcms v9进行二次开发时,更加省时省心。我们要做的就是如何把这些工具调出来使用。调用方法总共有两种。
一、视图调用法
这种方法最简单,但有局限性。在后台的模型定义字段时,选择表单的类型就会生成相应的表单类型。
二、代码调用法
这种方法比较灵活,走出了内容模块的限制,不再拘泥于内容模型的框架。下面是一个足球模块控制器添加信息的方法,看代码:
表单类的位置:libs\classes--form.class.php
public function addfbteam(){ $levels = $this->level->select('','`id`,`level`','','id'); if(isset($

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
