PHP extension framework developed by PHP development team Niao Ge Hui Xinchen
Install
Windows download extension: https://pecl.php.net/package/yaf/2.2.9/windows
Select according to your computer system and PHP version number. NTS is thread-unsafe and TS is thread-safe
According to phpinfo(), choose whether it is thread-safe
Put the php_yaf.dll extension into the ext directory
Restart apache
Use
Create a new directory public and create a new file index.php entry file
<?<span>php define(</span>"APP_PATH", realpath(dirname(__FILE__) . '/../')); <span>/*</span><span> 指向public的上一级 </span><span>*/</span><span> $app </span>= <span>new</span> Yaf_Application(APP_PATH . "/conf/application.ini"<span>); $app</span>->run();
Create a new directory conf and create a new file application.ini
<span>[product] ;支持直接写PHP中的已定义常量 application</span>.directory=APP_PATH "/application/"
Create a new directory application/controllers and create a new file index.php
<?<span>php </span><span>class</span> IndexController <span>extends</span><span> Yaf_Controller_Abstract { </span><span>public</span> <span>function</span> indexAction() {<span>//</span><span>默认Action</span> <span>$this</span>->getView()->assign("content", "Hello Yaf"<span>); } }</span>
Create a new directory views/index and create a new file index.phtml
<h1><?php <span>echo</span> <span>$content</span>;?></h1>