我有一个tr列,像这样.那么在点击更新ID为"quick-update-order-product"之后如何使用jquery获取tr的id
<tr id="product-id-<?=$product->product->id;?>">
<td><span class="product_price_show"></span></td>
<td><span><?= $product->product_qty; ?></span></td>
<td><span><?= $product->product->stock->qty; ?></span></td>
<td><span><?= $product->total_price_tax_incl; ?></span></td>
<td>
<a class="quick-update-order-product">Update</a>
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
提前致谢.. :)
好吧,我对Yii2资产捆绑包不熟悉。Yii2资产捆绑包在页面顶部注册css文件,在页面底部注册js文件。但是,如何在页面顶部也包含这些js文件?
class AppAsset extends \yii\web\AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
Run Code Online (Sandbox Code Playgroud)
我只需要在页面顶部注册所有js和css文件即可。使用AppAsset,可以吗?
编辑
默认注册脚本
<head>
....
<link href="/assets/4850c11c/css/bootstrap.css" rel="stylesheet">
....
</head>
<body>
.....
<script src="/assets/76016e7c/jquery.js"></script>
.....
</body>
Run Code Online (Sandbox Code Playgroud)
我只需要
<head>
....
<link href="/assets/4850c11c/css/bootstrap.css" rel="stylesheet">
<script src="/assets/76016e7c/jquery.js"></script>
....
</head>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用内置函数Remember()来缓存数据库查询。但这似乎工作不正常。这是好的片段。
$categories = Category::orderBy('rank', 'asc')
->select('id', 'name', 'rank')
->where('parentid', '=', 0)
->where('id', '<>', 4)
->remember(300)
->get();
Run Code Online (Sandbox Code Playgroud)
这是我遵循的参考链接。我收到以下错误消息
调用未定义的方法Illuminate \ Database \ Query \ Builder :: remember()
Category.php
<?php
namespace App;
use Eloquent;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
//
}
Run Code Online (Sandbox Code Playgroud)