This article describes how to install and use the Yaf framework of the PHP Extension Framework. it is of reference value.
Install
Windows download extensions: https://pecl.php.net/package/yaf/2.2.9/windows
Based on your computer system and php version number, the process is thread-safe, and TS is thread-safe.
Depending on phpinfo (), select whether it is thread-safe
Put php_yaf.dll extension in the ext Directory
Restart apache
Use
Create a directory named public and a new file named index. php.
<? Phpdefine ("APP_PATH", realpath (dirname (_ FILE __). '/.. /');/* points to the upper-level public */$ app = new Yaf_Application (APP_PATH. "/conf/application. ini "); $ app-> run ();
Create a directory conf and a new file application. ini
[Product]; supports writing the defined constant application. directory = APP_PATH "/application/" in PHP /"
Create the application/controllers directory and create the file index. php
<? Phpclass IndexController extends Yaf_Controller_Abstract {public function indexAction () {// default Action $ this-> getView ()-> assign ("content", "Hello Yaf ");}}
Create directory views/index and file index. phtml
<?php echo $content;?>
The above section describes how to install and use the Yaf framework of PHP Extension Framework. I hope it will help you. if you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you for your support for the website!