yii2 Chinese garbled code

yii2 Chinese garbled code

The way to solve the Chinese garbled problem in yii2 is to configure the database, for example ['class' => 'yii\db\Connection','dsn' => 'mysql:host=127.0.0.1; dbname=ohmycto; charset=utf 】.

Feb 17, 2020 am 11:52 AM
yii2 乱码
How to generate hyperlinks in yii

How to generate hyperlinks in yii

The method for yii to generate hyperlinks is to use yii's built-in URL generation tool urlManager, such as [\Yii::$app->urlManager->createAbsoluteUrl($params, $schema = null)].

Feb 17, 2020 am 11:42 AM
yii 超链接
How to update data in yii

How to update data in yii

Methods for updating data in yii: 1. Use the update(true, updated field) method to update data; 2. Use the updateAll() method to update multiple pieces of data; 3. Use find() to find data, and after changes, call the save() method Just save it.

Feb 17, 2020 am 11:41 AM
yii 更新数据
Yii uses rules to get error information

Yii uses rules to get error information

Yii uses rules to obtain error information: first use the rules function in the model to return array type data; then use new myModel() in the controller to instantiate the relevant table model class; finally use the getErrors() method to obtain error information.

Feb 17, 2020 am 11:26 AM
yii rules 错误信息
yii encrypted string garbled characters

yii encrypted string garbled characters

The solution to garbled characters in yii encrypted strings: first use base64_decode($uid) to decode the encrypted data; then use \yii::$app->security->decryptByPassword() to decrypt the data to ensure that it is not garbled.

Feb 17, 2020 am 11:15 AM
yii 加密字符串 乱码
The difference between yii2 and ci

The difference between yii2 and ci

The differences between yii2 and ci are: 1. yii2 code is elegant and concise, and ci has a very large space for customization; 2. yii2 is very easy to expand, and ci needs to write extensions yourself; 3. yii2 has a relatively high learning curve, and ci has the characteristics of being easy to get started, etc. wait.

Feb 17, 2020 am 10:33 AM
yii2 ci 区别
Use php in yii2 to determine whether the image exists

Use php in yii2 to determine whether the image exists

How to use PHP to determine the existence of an image in Yii2: 1. Use the file_exists() function, pass in the path of the image, and return true if it exists; 2. Use the file_get_contents() function, pass in the path of the image, and return the image content if it exists, etc. .

Feb 17, 2020 am 10:00 AM
yii2 判断图片 存在
How to get the new data id in yii

How to get the new data id in yii

The method for yii to obtain the newly added data ID: first use Yii::$app->request->post() to obtain the submitted data; then use new User() to instantiate the object; finally use the setAttributes() method and $model ->id can get the id value.

Feb 17, 2020 am 09:40 AM
yii 获取 id
How to adaptively switch templates in yii2

How to adaptively switch templates in yii2

The method for adaptively switching templates in yii2 is: 1. First create a behavior; 2. Then create a base class BaseController.php; 3. Create H5Views under frontend and place the H5 template file there.

Feb 10, 2020 am 11:14 AM
yii2 自适应
yii framework routing configuration

yii framework routing configuration

Yii framework routing configuration method: 1. First, enable the rewrite module in the server configuration (httpd.conf); 2. Add the server configuration file [.htaccess] in the directory; 3. Then add the urlManager configuration item; 4. Finally restart Just the server.

Feb 06, 2020 pm 06:19 PM
yii 路由
How to reference adminlte to yii2

How to reference adminlte to yii2

The method for adminlte to reference yii2: first download and install the yii2 framework; then create the user table in the database; then execute the command "composer require mdmsoft/yii2-admin "~2.0"" in the windows environment.

Feb 04, 2020 am 09:01 AM
yii2
How to catch yii2 exceptions

How to catch yii2 exceptions

The method of catching exceptions in yii2: first throw an exception in method a; then use the use keyword to import Exception; finally use the try{}catch(\Exception $e) statement to catch the exception.

Feb 03, 2020 pm 05:00 PM
yii2 捕获异常
What should I do if nginx does not support yii?

What should I do if nginx does not support yii?

The solution to the problem that nginx does not support yii: first open the "nginx.config" configuration file; then add "server" to the file and change "root" to the directory where the "index.php" file is located; finally open the "web.php" file And set the access permission to "777".

Feb 03, 2020 am 10:25 AM
nginx yii
How to use mutex yii

How to use mutex yii

"mutex" in Yii refers to the "Mutex component", which allows concurrent processes to execute each other to prevent "race conditions"; the syntax for using "mutex" is "if ($mutex->acquire($mutexName)) { } else {}".

Feb 03, 2020 am 10:19 AM
mutex yii

Hot tools Tags

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use