-
Tp5 uses redis, to add extension guidance
how do you tp5 encapsulate the extension function of redis? Because there are only simple functions of set and get by default, guide me. ...
-
Prompt class not found for references between class files under the tp5 framework on the server
for example, the following figure shows the error message and the corresponding file under applicationmobilesupportcontroller
the namespace of both class files is namespace appmobilesupportController; Message file with the following use: use app...
-
Json_encode problem under thinkphp5
I set up User.php, User.php under the model layer and have a method getUserInfo to query the data, as follows:
$userModel = new UserModel;
dump($userModel->getUser());
dump(json_encode($userModel->getUser()));
the first printed data is as follo...
-
Please help me convert this native SQL statement into TP5 thank you!
ask God to help me translate this native SQL statement into TP5 thank you! It is Db:: ( name )-> this kind of chained operation select a.id, a.titlerect a. Createwriting time as answer_count from fa_question a. Isometric solvepaper count (b.qid) as ...
-
Model events such as TP5.0 before_insert are invalid?
follow the ThinkPHP5.0 official manual prompt:
User::event( before_insert , function ($user) {
if ($user->status != 1) {
return false;
}
});
:https: www.kancloud.cn manua...
TP beforeInsert ,,,,.
the direct insertion is s...
-
Php sets the corresponding key of the cache
I use thinkphp5
I don t know how a key corresponds to a value when using cache
my preliminary idea is to apply controller name concatenation method name splicing all passing parameters md5 encrypted string as key
when you get the cache, you also...
-
Problems with thinkphp5.17 federated query
this sql statement, under thinkphp5.17
tp
there is another problem. My sql statement is executed incorrectly. I can t see the error statement in the tract panel or runtime log. I want to see what I did wrong and what I think.
...
-
Sometimes tp5.1 can't find a class of the framework.
has been developing with tp5.1 recently. Because of the requirements, there is no front-end separation, using the template engine. But a strange phenomenon occurs when I load a page occasionally that some classes of the system do not exist. Such as thi...
-
Consult about the problem of belongsTo association in thinkphp5
situation description: A Table: user s coupon Information Table, Field: id,ticket_id,status B Table: voucher Information Table, Field: id,ticket_info,status in Model A, there is the following code: class An extend Model { public function getUserTi...
-
How does the thinkphp5 template volist parse variables?
Please take a look. Is it wrong to write this? why can t you parse this variable ?
...
-
There are some problems in uploading multiple images in Layui.
the corresponding return path cannot be obtained when multiple images are uploaded. I don t know why?
...
-
How to develop composer packages for the framework?
thinkphp5 composer
tp5 composer
...
-
The browser reported an error Access denied for user 'root'@'localhost' (using password:NO
browser error: SQLSTATE [HY000] [1045] Access denied for user root @ localhost (using password: NO) I successfully connected to the database with navicat, the user name is root, password is the password set when installing mysql, and the framework...
-
Can the route of thinkphp5 be modified to make tp5 run on nginx? in forced mode without modifying the nginx configuration?
The server does not support modifying the configuration file (site-building host). The current environment is nginx1.10.2.
question: currently, by setting the route and forcing the mode, it is found that it does not work. What is the problem? Whether ...
-
ThinkPHP 5 how to check data by cross-table one-to-many Has Many Through
you could have checked User, through Conuntry and then Post, through User. Now you can check Post; directly through Country usually the relationships between Country and User,User and Post are established beforehand, and then you can use hasManyThrough...
-
TP5 detects login jump in behavior class, and redirect reports an error
check whether to log in in the check class file under the behavior file under the module, and then jump to the business, use the redirect prompt to report an error, and find the answer
Call to undefined method app admin behavior CheckBehavior::redir...
-
Tp5 session master-slave domain name sharing
it is said that Session can be shared between master and slave domain names, (two projects, two TP5 frameworks)
domain.com
a.domain.com
b.domain.com
but in the TP5 primary domain name, the Session in the secondary domain name is set to the same d...
-
There is no length attribute when thinkphp5 returns json?
function findChild(&$arr,$id){
$childs=array();
foreach ($arr as $k => $v){
if($v[ pid ]== $id){
$childs[]=$v;
}
}
return $childs;
}
function build_tree($rows,$root...
-
How does thinphp5 write session? in the entry file
because you want to create an additional administrative entry, it is convenient to change the name of the entry file.
app admin contrller Login
Login:
<?php
namespace app admin controller;
use think Controller;
class Login extends Control...
-
How is thinkphp5 designed to use transactions?
is it better to put the transaction in the controller, or in the model, or is there another solution when using TP5 when you need a transaction? If you put it in a model, and multiple models are involved in the process, and the process requires a transac...