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
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();
New directory conf, create a new file application.ini
[product] ;支持直接写PHP中的已定义常量 application.directory=APP_PATH "/application/"
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"); } }
New directory views/index, create a new file index.phtml
echo$content;?>
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.