Category: Web Application Development
-
Post Views: 14 1. In PHP 7.1 and Yii 2, AR activity records transactions, and the implementation of multiple models needs to be operated at the same time, as shown in Figure 1 2. Test whether the transaction is supported, and let the $this->save() operation fail, and let the $contentDetail->save() operation succeed, the response is as follows, as shown in…
-
Post Views: 13 1. Edit the cached controller class, \API\Controllers\CacheController.php 2. Create the data layer of the cached resource class (the corresponding model language package file), \common\models\redis\cache.php 3. Create the logical layer of the cached resource class, \common\logics\redis\cache.php 4. In the interface application, create a cached resource class, \API\Models\Redis\Cache.php 5. In the V1 module of the interface application, create the…
-
Post Views: 15 1. Create the controller class of the cache component, \API\Controllers\CacheComponentController.php 2. Create the data layer of the resource class of the cache component (the corresponding model language package file), \common\models\redis\cachecomponent.php 3. Create the logical layer of the resource class of the cache component, \common\logics\redis\cachecomponent.php 4. In the interface application, create the resource class of the cache component,…
-
Post Views: 14 1. The previous article:https://www.shuijingwanwq.com/2018/01/18/2328/ 2. Refer to step 11, the DB component is moved to the development environment to facilitate the use of GII, \common\config\base.php, as shown in Figure 1 3. Configured as a production environment, so that the multi-tenant implementation of the test database migration is not dependent on the DB component, as shown in Figure…
-
Post Views: 13 1. The multi-tenant system contains multiple tenants, and each tenant has its own database configuration information. The existing requirement is to connect the database based on the response host name, user name and password, as shown in Figure 1. 2. Now it is configured as an application component, \common\config\base.php, as shown in Figure 2 3. Open dubug,…
-
Post Views: 15 1. Open in the browser:http://frontend.cmcp-api.localhost/, a debugger toolbar will appear at the bottom of the page, you can click to expand, as shown in Figure 1 2. In Postman, gethttp://www.cmcp-api.localhost/v1/pages, 200 responses, but no debugger toolbar appears, as shown in Figure 2 3. Continue to step 1, click the Yii logo on the debugger toolbar, you can…
-
Post Views: 16 1. Previous:https://www.shuijingwanwq.com/2017/11/30/2084/ 2. The existing default interface, as shown in Figure 1 3. The designed UI interface needs to be implemented in this way, as shown in Figure 2 4. Copy:\vendor\bower\admin-lte\build\less\variables.less To: \backend\web\themes\default\css\variables.less, clear all the contents 5. Create a new one: \backend\web\themes\default\css\_all-skins.less, as shown in Figure 3 6. Create a new one: \backend\web\themes\default\css\adminlte.less, as shown in…
-
Post Views: 14 1. Use npm to install the less compiler, check the npm version, as shown in Figure 1 npm -v 2. Install the Less compiler globally, run npm in phpstorm, select file, and open settings, as shown in Figure 2 3. Click Node.js and npm under “Language and Framework”, and on the opened Node.js and npm page, pack…