Yii multi-language switch configuration and yii language switch configuration

Source: Internet
Author: User
Tags codeigniter

Yii multi-language switch configuration and yii language switch configuration
Today, I am studying the multi-language switch of yii. I first searched a lot of baidu for a similar search, and I don't feel very good. As a result, google has to say that technical articles are still reliable for google, because basically all the information found in it goes back to git, stack overflow, and other places to find the answer. When looking for the yii language, I finally found an ext in yiiframework and transferred it to git, git's instructions are clear, but after the configuration is complete, it cannot work. Then, read the code and modify it. The final result is successful. The detailed steps are as follows:
Github address: https://github.com/leoshtika/yii-language-selector
How to install [How to install]
1) Copy your ageselector folder to the extensions folder(Protected/extensions /)[CopyLanguageSelectorFolder to the extension directory of yii: (protected/extensions /)
2) Populate the 'params' attribute in the config file(Protected/config/main. php)With an array of code/language pairs [fill params in the form of an array of language-specific key-value pairs in the configuration file (Protected/config/main. php)]

'params'=>array(    'availableLanguages' => array(        'el'=>'Ελληνικά',         'en'=>'English',        'it'=>'Italiano',         'sq'=>'Shqip',     ),),


3) Overwrite the init () method in your main controller class (Protected/components/Controller. php) [Overwrite the init method in your main Controller File protected/components/Controller. php]
public function init(){    Yii::import('ext.languageSelector.LsWidget');    LsWidget::loadLanguage();    parent::init();
}

4) Add this line to your view file where you want to render your ageselector widget [Add the following line to the view file of the control you want to select in the output language]
<?php $this->widget('ext.languageSelector.LsWidget'); ?>
 
At this point, only the calligraphy above github has been taken, but the desired result has not been displayed. Therefore, the source file of ext has been modified by combining Chinese and Western: I will not describe it in detail here. In fact, there is nothing to add. You just need to replace it with me. I don't know whether it's my understanding or what's going on. If you feel wrong, please submit it in time, exchange:
 
Attachment: Modified File

How does yii framework access APIs?

1. Yii

Yii is a component-based high-performance PHP framework for developing large-scale Web applications. Yii is written in strict OOP mode and has complete library references and comprehensive tutorials. From MVC, DAO/ActiveRecord, widgets, caching, hierarchical RBAC, Web services, to the subject, I18N and L10N, Yii provides almost all the functions required for Web 2.0 application development today. And the price of this framework is not too high. In fact, Yii is one of the most efficient PHP frameworks.

2. CodeIgniter

CodeIgniter is an application development framework-a toolkit designed by people who build PHP websites. Its goal is to quickly develop projects: it provides a wide range of database groups to complete common tasks, as well as a simple interface to access these databases in a well-organized architecture. CodeIgniter development can inject more creativity into the project because it saves a lot of coding time.

3. CakePHP

CakePHP is a framework for rapid PHP development. It uses common design patterns such as ActiveRecord, Association Data Mapping, Front Controller, and MVC. Its main goal is to provide a framework for PHP developers to quickly develop web applications at any level, and this quick implementation does not sacrifice project elasticity.

4. PHPDevShell

PHPDevShell is an open-source (GNU/LGPL) Rapid Application Development Framework for developing pure PHP without Javascript. It has a complete GUI administrator background interface. Its main goal is to develop management-based applications such as plug-ins. Speed, security, stability, and elasticity are the top priorities. The design forms a simple learning curve, and PHP developers do not need to learn complicated new terms. The advent of PHPDevShell meets the need of developers for a lightweight but functional GUI that can be configured without restrictions.

5. Akelos

The Akelos PHP framework is a web application development platform based on the MVC design model. Based on good habits, you can use it to complete the following tasks:

◆ Convenient use of Ajax to compile views

◆ Request and response management through the Controller)

◆ Manage international applications

◆ Use simple protocols to communicate with models and databases

Your Akelos application can run on most shared host service providers, because the only requirement of Akelos for servers is to support PHP. Therefore, the Akelos PHP framework is ideal for publishing individual web applications because it can run without non-standard PHP configurations.

6. Symfony

Symfony is a web application framework used to develop PHP5 projects.

This framework aims to accelerate the development and maintenance of web applications and reduce repeated coding work.

Symfony has low system requirements and can be easily installed on any settings: you only need a Unix or Windows network server installed with PHP5. It is compatible with almost all databases. The price of Symfony is not high, which is much lower than that of the host.

For PHP developers, using Symfony is a natural thing, and its learning curve is only one day. A clean design and code readability can shorten the development time. Developers can apply the principles of agile development (such as DRY, KISS, or XP) to the application logic layer, instead of spending a lot of time writing endless XML configuration files.

Symfony is designed to build comprehensive enterprise-level applications. That is to say, you have control over the entire configuration: From the path structure to the external database, almost everything can be customized. To comply with enterprise development regulations, Symfony has also bound some additional tools for project testing, debugging, and archiving.

7. Prado

The PRADO team is composed of some PRADO enthusiasts... the remaining full text>

How can I submit multiple pages to a table through the questionnaire survey program, PHP, and yii framework?

Private Sub webbrowserappsdocumentcomplete (ByVal pDisp As Object, Url As Variant)
Dim vDoc
Set vDoc = WebBrowser1.Document
VDoc. getElementById ("UserName"). Value = "Sun Wukong"
VDoc. getElementById ("password"). Value = ""
VDoc. getElementById ("randCode"). Value = "Verification code"
VDoc. getElementById ("subLink"). Click
End Sub
It's not that easy to extract the verification code. Haha ~~

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.