Install and use the Yaf framework of PHP Extension Framework

Source: Internet
Author: User
Tags windows download
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.