@getData - Retrieve Data via HTTP GET
The @getData
directive in Ahmed PHP Template Engine allows you to fetch data using an HTTP GET request.
Syntax
url
: The endpoint from which the data will be retrieved.
Description
This directive makes an HTTP GET request to fetch data from a specified source.
Useful for retrieving API data, dynamic content, or query parameters.
Works asynchronously to enhance performance.
Example
Expected Output
Notes
Ensure the target URL supports GET requests.
Works well with APIs and public endpoints.
Supports dynamic parameters using template variables (e.g.,
@getData("/api/user?id=@userId")
).
Last updated