suchen
Heimphp教程php手册Yaapi和PHP构建一个简单的内容管理系统

Yaapi和PHP构建一个简单的内容管理系统

Jun 13, 2016 am 10:26 AM
phpweb你是内容构建von简单管理系统

如果你是一个正在构建具有丰富内容的Web网站的开发人员,你就可能需要考虑下面这些解决方案,其中包括(a)用于内容的数据库,(b)将GUI与内容分离的模板系统,(c)用来维护数据库里数据的用户友好界面,以及(d)对所生成页面的最终外观的控制。
能够提供上述所有内容的一个非常有趣的解决方案就是Yaapi,它是“你的文章应用程序编程接口(Your Article Application Programming Interface)”的开头字母缩写。它是一个PHP类,提供了内置的方法来访问保存在数据库里的内容。管理模块装备有协助管理数据的类,而这个API本身都足够强大,可能够处理内容管理系统(CMS)所要求的大多数常见任务。
安装要安装和使用Yaapi,你需要一个支持PHP的Web服务器,例如Apache,当然还有PHP,以及MySQL数据库服务器。你可以下载一份Yaapi,将它解压到服务器根目录下的某个位置里。
你还需要创建一个MySQL数据库,以容纳Yaapi的数据结构。使用源档案里的yaapi.sql文件创建这个数据库,然后打开类构造函数(article.class.php文件)里的Yaapi配置,使用用于该数据库的名字和访问参数更新它。
添加内容要向数据库里添加内容,你就必须使用http://your-server/yaapi-root/admin/上的Yaapi管理模块(用安装有Yaapi的服务器的名称来替换“your-server”,并用Yaapi解压后的目录来替换“yaapi-root”)。你要使用这个管理模块来创建(和删除)内容类别,然后把文章放到这些类别里。下面就是你会在这一过程中碰到的字段的简表:
类别(Category):文章的类别 章节ID(Section ID):如果你的文章有两个层次,就要使用这个参数来定义第二个层次。 标题(Title):文章的标题 作者(Author):文章的作者 电子邮件(E-mail):文章作者的电子邮件地址 许可(Approved):用来表示文章是否已经“得到许可”可以进行显示的标志 图像(Image):与文章相关的可选图像URL 内容(Content):文章的内容 关于上面最后一个项目的一点小小注释:通过在文章文本里插入分隔符,Yaapi能够把你的大段文章分在若干个小的页面里进行显示。见下面的例子:


Introduction of article here
#intro#Page 1 content here #page#Page 2 content here #page#Page 3 content here #page#and so on...
别忘了在输入文章之后确认一下,因为只有经过确认的文章才能够用API检索得到。
Stellungnahme
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

AI Hentai Generator

AI Hentai Generator

Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
1 Monate vorBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Beste grafische Einstellungen
1 Monate vorBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Crossplay haben?
1 Monate vorBy尊渡假赌尊渡假赌尊渡假赌

Heiße Werkzeuge

SublimeText3 Linux neue Version

SublimeText3 Linux neue Version

SublimeText3 Linux neueste Version

EditPlus chinesische Crack-Version

EditPlus chinesische Crack-Version

Geringe Größe, Syntaxhervorhebung, unterstützt keine Code-Eingabeaufforderungsfunktion

PHPStorm Mac-Version

PHPStorm Mac-Version

Das neueste (2018.2.1) professionelle, integrierte PHP-Entwicklungstool

MinGW – Minimalistisches GNU für Windows

MinGW – Minimalistisches GNU für Windows

Dieses Projekt wird derzeit auf osdn.net/projects/mingw migriert. Sie können uns dort weiterhin folgen. MinGW: Eine native Windows-Portierung der GNU Compiler Collection (GCC), frei verteilbare Importbibliotheken und Header-Dateien zum Erstellen nativer Windows-Anwendungen, einschließlich Erweiterungen der MSVC-Laufzeit zur Unterstützung der C99-Funktionalität. Die gesamte MinGW-Software kann auf 64-Bit-Windows-Plattformen ausgeführt werden.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Leistungsstarke integrierte PHP-Entwicklungsumgebung