cuốn sách gpt4 ai đã làm

css - Cakephp 添加样式到 h($product ['Product' ] ['name' ]);

In lại Tác giả: Walker 123 更新时间:2023-11-28 12:14:23 25 4
mua khóa gpt4 Nike

我想给这段代码添加样式:


我试着这样说:

 'font-weight:bold;')); ?>

但它给我这个错误信息:

警告 (2):htmlspecialchars() 期望参数 4 为 bool 值,数组给定 [CORE\Cake\basics.php,第 199 行]

谁能告诉我向该行添加样式的正确方法。

Cảm ơn.

câu trả lời hay nhất

h() 函数是 cakephp 中 htmlspecialchars() 的便捷包装器。它将特殊字符转换为 HTML 实体。所以你收到了警告。

这个函数的语法是h(字符串 $text, bool $double = true, 字符串 $charset = null)

要为您的代码设置样式,您可以选择使用它

echo $this->Html->tag('span', $product['Product']['name'], array('style' => 'font-weight:bold;'));
?>
// Output
Your Product Name

关于css - Cakephp 添加样式到 h($product ['Product' ] ['name' ]);,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19286628/

25 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress