Khai báo biến slug và sử dụng biến slug này để gọi hàm lấy tiêu đề trang trong thymeleaf
Tôi đã có:<div class="markdown-block position-relative overflow-auto source-html">
<pre>
slug=${ezyfunctions.call('get_request_parameter', '{name:\'slug\'}')}
</pre>
</div><p>
Làm thế nào để sử dụng nó trong hàm <code class="markdown-inline">ezyfunctions.call('get_post_title_by_slug'</code> để lấy tiêu đề trang?
</p>
Hỏi về xử lí biểu đồ thống kê với thymleaf
Anh cho em hỏi cách xử lí dữ liệu biểu đồ thống kê với thymleaf như thế nào ạ?
Thymeleaf: chuyển đổi timestamp hoặc date time về string tương ứng với time zone của client
Thymeleaf: chuyển đổi timestamp hoặc date time về string tương ứng với time zone của client
Thymeleaf: Hiển thị message dạng chữ hoa
Code hiển thị message dạng chữ hoa trong thymeleaf:
<pre><code><li class="nav-header"
th:with="componentsTitle=#{components.title}"
th:text="${#strings.toUpperCase(componentsTitle)}"></li>
</code></pre>
<p>
Tham khảo thêm: <a href="https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#strings" target="_blank" rel="noopener">https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#strings</a>
</p>
Thymeleaf hiển thị text mà không cần sử dụng thẻ html
Thymeleaf hiển thị text mà không cần sử dụng thẻ html, có thể sử dụng cách này:
<p>
</p>
<pre><code><<span>p</span> <span>th</span>:inline=<span>"text"</span>>
[[${<span>menu</span>.name}]]
<<span>i</span> class=<span>"fas fa-angle-left right"</span>></i>
</p>
</code></pre>
Gọi hàm static trong thymeleaf
Để gọi hàm static trong thymeleaf hãy tham khảo cái này: <a href="https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#preprocessing" target="_blank" rel="noopener">https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#preprocessing</a>