current location:Home > Technical Articles > PHP Framework > YII

  • What is the difference between yii1 and yii2
    What is the difference between yii1 and yii2
    Difference: Yii2 application instances directly use global named variables to access: $app without calling app(). A significant change in the view layer of Yii2 is the introduction of view classes. Yii2 introduces the concept of resource packages, and the way of resource reference changes greatly.
    YII 4011 2019-12-07 16:28:59
  • How to upload pictures in yii2
    How to upload pictures in yii2
    First, build the upload class and create a product table with fields id, name, and picurl. Then use GII to generate PRODUCT models, classes, and views. Place main.css in \css, main.js in \asses, and then register these two files in AppAsset.php.
    YII 2254 2019-12-07 16:21:15
  • How to get the current url in yii framework
    How to get the current url in yii framework
    How to get the current url in Yii framework: You can directly use the command "\Yii::$app->request->hostInfo;" to get the current domain name, you can use the command "\Yii::$app->request->getUrl(); "Get the url except the domain name.
    YII 2179 2019-12-07 16:08:55
  • What should I do if the yii2 entry file cannot be found?
    What should I do if the yii2 entry file cannot be found?
    First, double-click the init.bat file in the root directory, or cmd to the Yii directory to execute the php init command. Then enter the scene you want to select: 0 or 1, and press Enter. Determine whether to execute generation: y/n, press Enter. The entry file of the framework will be generated in the frontend/web directory and can be accessed through the address.
    YII 2446 2019-12-07 16:01:21
  • What should I do if a 403 error occurs on the yii2 website?
    What should I do if a 403 error occurs on the yii2 website?
    gii tool configuration: 'gii'=>['class'=>'yii\gii\Module','allowedIPs'=>['127.0.0.1','::1','192.168.0.*',' 192.168.178.20'] will do.
    YII 3517 2019-12-07 15:52:49
  • How to conditionally query in yii framework
    How to conditionally query in yii framework
    Conditional query: "$customers = Customer::find()->where($cond)->all();". $cond is what we call a condition, and the way the condition is written varies depending on the query data.
    YII 2533 2019-12-07 15:33:15
  • Check whether yii is installed successfully
    Check whether yii is installed successfully
    How to check whether yii is installed successfully: After installing the yii framework, open the browser and enter http://localhost/../index.php in the browser to check whether the yii framework is installed successfully.
    YII 2606 2019-12-07 14:44:21
  • How to re-url in yii
    How to re-url in yii
    The method to re-"url" in "yii" is: 1. Change the project address to static mode (pseudo-static===Url routing management). This process requires the support of the "apache" function module (url rewriting module) ; 2. Edit the project configuration file; 3. Use the "createUrl" method of the framework.
    YII 15278 2019-12-07 11:48:51
  • After yii2 adds a field to the database table, the corresponding model cannot recognize the attribute.
    After yii2 adds a field to the database table, the corresponding model cannot recognize the attribute.
    The reason why the corresponding model cannot recognize the attribute after "yii2" adds a field to the database table is: the structure of the database table should be cached. The solution is: delete the "runtime" folder or clear the cached data of the specified database table structure.
    YII 3084 2019-12-07 11:17:16
  • Comparison of yii2 and laravel framework
    Comparison of yii2 and laravel framework
    Comparison between the "yii2" framework and the "laravel" framework: Comparing in terms of development speed, the "yii" framework can use the "gii" scaffolding to quickly generate code without the need to write special effects and styles, while "laravel" can also Quickly create controllers, models, routes, etc. with the help of "artisan" tools.
    YII 5758 2019-12-07 11:04:59
  • Solution to garbled yii2 page
    Solution to garbled yii2 page
    Solution to the garbled code on the yii2 page: Configuring the encoding format in the database configuration can solve the problem. The setting statement is: "'dsn'=>'mysql:host=127.0.0.1;dbname=ohmycto;charset=utf8',".
    YII 2768 2019-12-07 11:02:01
  • How to set the default access home page in yii
    How to set the default access home page in yii
    How to set the default homepage for yii: Add: "'defaultRoute'=>'login/index' (controller/method)" in config->main.php to change the default homepage.
    YII 4086 2019-12-07 10:52:18
  • yii2 determines whether it is submitted in post mode
    yii2 determines whether it is submitted in post mode
    How yii2 determines whether it is submitted in post mode: You can use the if(Yii::$app->request->isPost) statement to determine. If the condition in the if statement is true, it means that it is a post submission, and if it is not true, it means that it is not a post submission.
    YII 2959 2019-12-07 10:35:11
  • How to define yii controller
    How to define yii controller
    In Web applications, the yii controller should inherit yii\web\Controller or its subclasses. Similarly, in console applications, the controller inherits yii\console\Controller or its subclasses.
    YII 2580 2019-12-04 13:33:24
  • There are several ways to connect to the database in yii
    There are several ways to connect to the database in yii
    Yii connects to the database through PDO, Active Record, Criteria and Query Builder methods. There is already Query in Yii2, which is better in performance than ActiveRecord and can be used as a replacement.
    YII 2781 2019-12-04 13:18:21

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!