Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How the Yii framework executes sql statements in the page output

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report