[PHP] Simple installation and use of Yaf framework

WBOY
Release: 2016-07-29 08:48:47
Original
1173 people have browsed it

PHP extension framework developed by PHP development team Niao Ge Hui Xinchen

Installation

Windows download extension: https://pecl.php.net/package/yaf/2.2.9/windows

According to your own computer system and PHP version number selection, NTS is thread-unsafe, TS is thread-safe

According to phpinfo(), choose whether it is thread-safe

[PHP] Yaf框架的简单安装使用

Put the php_yaf.dll extension in the ext directory

Restart apache

Use

Create a new directory public, create a new file index.php entry file

php define("APP_PATH", realpath(dirname(__FILE__) . '/../')); /* 指向public的上一级 */$app = new Yaf_Application(APP_PATH . "/conf/application.ini"); $app->run();
Copy after login

New directory conf, create a new file application.ini

[product] ;支持直接写PHP中的已定义常量 application.directory=APP_PATH "/application/"
Copy after login

New directory application/controllers, create a new file index.php

php class IndexController extends Yaf_Controller_Abstract { publicfunction indexAction() {//默认Action$this->getView()->assign("content", "Hello Yaf"); } }
Copy after login

New directory views/index, create a new file index.phtml

echo$content;?>

Copy after login

[PHP] Yaf框架的简单安装使用

The above introduces the simple installation and use of [PHP] Yaf framework, including php and ya content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!