Get the App
SLTechnology News&Howtos  ›  Development  › 

How the Yii framework executes sql statements in the page output

Shulou Source: shulou.com Published: 2022-06-03 19:47:51 11月12日 Update

This article mainly explains "how the Yii framework executes sql statements in the page output", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how the Yii framework executes sql statements in the page output.

We use: yiidebugtb to debug (because its interface is more beautiful and does not affect other elements of the interface).

1. Download yiidebugtb and put it in the application.extensions.yiidebugtb directory

two。 Modify main.php and add the following code:

The copy code is as follows:

'log'= > array (

'class'= >' CLogRouter'

'routes'= > array (

Array (

'class'= >' CFileLogRoute'

'levels'= >' error, warning,trace'

),

/ / the following is a new addition

Array (/ / configuration for the toolbar)

'class'= >' XWebDebugRouter'

'config'= >' alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle'

'levels'= >' error, warning, trace, profile, info'

/ / 'categories' = >' system.db.*'

'allowedIPs'= > array (' 127.0.0.1). 1 [0-5]\. [0-9] {3}','if the program needs to enter the ip' of your public network in the external network)

),

),

)

Make the following changes in the configuration of the 3.db link:

The copy code is as follows:

'db'= > array (

'connectionString'= >' mysql:host=*.*;dbname=test'

'emulatePrepare'= > true, / / join

'enableParamLogging' = > true, / / join

'username'= >'-'

'password'= >'-'

'charset'= >' utf8'

'schemaCachingDuration'= >'0'

'autoConnect'= > false

),

4. Complete

Such as:

At this point, I believe you have a deeper understanding of "how the Yii framework executes sql statements in the page output". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Code framework statement page output content interface learning practical deeper beautiful element interest practical practical easy to operate method more friends directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS vpn Huawei Docker Linux