When using ES, we often encounter the situation of updating data,
Here is a brief introduction:
First, the most common and efficient method is to update according to id. at this time, the update method is called:
public static function updateEsById($id,$data = )
if (empty($id) || empty($data)) ...
Posted on Mon, 02 Dec 2019 05:19:48 -0500 by dotbands
Source|Dada Front End Bistro
ES - Class
Classes and Object Oriented:
Object-oriented, that is, everything is object. Object-oriented is a way of developing our thinking. Everything is object in object-oriented thinking. Take human as an example, what are its characteristics.Examples include name, gender, birth year, height, a ...
Posted on Mon, 02 Dec 2019 02:02:27 -0500 by amity
In short, a controller corresponds to a view, and a method corresponds to a template. Let's go to the figure above.
2. Assign value to template
Assign() function is used to assign template. The first parameter of assign() function is to give a user-defined name to the value, and the second parameter is the value
public function te ...
Posted on Mon, 02 Dec 2019 01:13:47 -0500 by jsantama
inner join: take out the matched data in two tables, and do not keep the unmatched data
outer join: take out the matched data in the connection table, and the unmatched data will be retained. Its value is NULL
mysql> select * from users;
| id | name |
Posted on Sun, 01 Dec 2019 22:52:34 -0500 by stormchaser1_1
First look File
Laravel middleware provides a convenient mechanism to filter HTTP requests entering the application.
Here we implement a function that only the admin role can access specific routes
New middlewarephp artisan make:middleware MustBeAdmin
Open the generated \ app\Http\Middleware\MustBeAdmin.php to modify the handle m ...
Posted on Sun, 01 Dec 2019 19:12:42 -0500 by viv
The class encapsulated by Yii2.0 is powerful enough. The usage of Mailer is summarized as follows:1. Configure in main-local.php first:
return [//....'components' => ['mailer' => ['class' => 'yii\swiftmailer\Mailer',],],];
The details are as follows:
return [//....'components' => [
'viewPath' => '@common/mail',
Posted on Sun, 01 Dec 2019 19:05:25 -0500 by sharke
Part 1: install Passport(laravel/passport)
Step 1. Use Composer to install Passport:composer require laravel/passport=~7.0
Step 2. The Passport service provider uses the framework to register its own database migration directory, so after registering the provider,You should run the Passport migration command to automatically create a data ta ...
Posted on Sun, 01 Dec 2019 17:09:21 -0500 by MeOnTheW3
php runtime using FAQ
The php version in the function calculation php runtime is 7.2.7. There are many built-in extensions in php runtime, as follows:
"Core", "date", "libxml", "openssl", "pcre", "zlib", "curl","filter", "hash", "readline", "Reflection",
"SPL", "session","xml", "standard", "mysqlnd", "bcmath", "bz2", "calendar","ctype ...
Posted on Sun, 01 Dec 2019 14:43:18 -0500 by Anant
Previously learned data types can only store one value (for example: Number/String). I want to store multiple values in a variable. How should I store them?
The so-called array is to arrange multiple elements (usually of the same type) in a certain order into a collection, which we call array.
1.1 array creation
// Creating arrays i ...
Posted on Sun, 01 Dec 2019 12:34:37 -0500 by The Phoenix
The default validate validation in the laravel framework returns to the previous page by default when handling errors, and only returns to Json when it is ajax. If we want to return Json all the time, we need to override error handling
As follows: only create a new BaseRequest class in the Requests directory
The code is as follows
Posted on Sun, 01 Dec 2019 12:19:40 -0500 by Kevmaster