Home >Backend Development >PHP Tutorial >Installation and use of the Yaf framework of the PHP extension framework, PHP extension yaf framework_PHP tutorial

Installation and use of the Yaf framework of the PHP extension framework, PHP extension yaf framework_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:52:15903browse

Installation and use of the Yaf framework of the PHP extension framework, PHP extension yaf framework

Installation

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

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

Create a new directory conf and create a new file application.ini

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

Create a new directory application/controllers and create a new file index.php

<&#63;php
class IndexController extends Yaf_Controller_Abstract {
  public function indexAction() {//默认Action
    $this->getView()->assign("content", "Hello Yaf");
  }
}

Create a new directory views/index and create a new file index.phtml

<h1><&#63;php echo $content;&#63;></h1>

The above is the knowledge about the installation and use of the Yaf framework of the PHP extension framework introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. of. I would also like to thank you all for your support of the Bangkejia website!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1127846.htmlTechArticleInstallation and use of Yaf framework of PHP extension framework, php extension yaf framework installation windows download extension: https:// pecl.php.net/package/yaf/2.2.9/windows According to your own computer system and php version...
Statement:
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