PHP Framework Kohana Learning 2

Source: Internet
Author: User
The URL is Kohana, you can download the latest code from their website, unzip it to see the architecture of the framework

root+-application|    +-cache|    +-Config|    +-controllers|    +-helpers|    +-hooks|    +-libraries|    +-logs|    +-models|    +-views|+-modules|    +-media|        +-Config|        +-controllers|        +-helpers|        +-libraries|    +---system|    +-Config|    +-controllers|    +-core|    +-helpers|    +-i18n|    +-libraries|    +-models|    +-vendor|    +-views|+-index.php

Where index.php is the entire framework of the portal, if you configure the PHP environment, you can directly put this code on your network, run to see a test page, first test your PHP environment can be very good use of the framework, if the various conditions, You can put the install. PHP deletes or modifies the name so that when you visit again it is the Welcome page.

Config configuration

Config file is the basic configuration of the site config.php

1. Site_domain is the name of your website such as your project name is Kohana then this parameter is $config [' site_domain '] = ' localhost:81/kohana '; The port can be omitted if it is 80.

2. $config [' index_page '] = ' index.php '; This is the default.

3. Modify the suffix of the page for example, to change. PHP to HTML you only need to configure $config [' url_suffix '] = '. html ';

4. Extension of the class name prefix, Kohana allows you to extend your class based on the framework of the prefix can be set here $config [' extension_prefix '] = ' my_ ';
5. You can use the module provided by Kohana or a custom module

               

$config [' modules '] = array

Modpath. ' Debug_toolbar ',//debug tool

Modpath. ' Auth ',//Authentication

Modpath. ' Forge ',//forge

Modpath. ' Kodoc ',//self-generating documentation

Modpath. ' GMaps ',//Google Maps Integration

Modpath. ' Archive ',//Archive utility

Modpath. ' Payment ',//Online payments

Modpath. ' Unit_test ',//Unit Testing

);

Start Page Paranoid routes.php

$config [' _default '] = ' index ';  You can set the default controller for the site, the default action is index

Database database.php

          

$config [' default '] = array

' benchmark ' = TRUE,

' Persistent ' = FALSE,

' Connection ' = ' mysql://username:password@localhost/databasename ',

' Character_set ' = ' UTF8 ',

' Table_prefix ' = ' ps_ ',

' object ' = TRUE,

' Cache ' = FALSE

);


A few of the Chinese URLs are

* Home-http://khnfans.cn
* Chinese Manual-Http://khnfans.cn/docs
* Enthusiasts Forum-Http://khnfans.cn/forum

English good can directly read English documents, most of them have been translated.

  • 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.