developer resources
Codebales holds an ever growing number of solutions to problems that we have experienced in our day to day code writing
Selected filter
177
results
Andrew Fletcher
•
In this instance, I'll check the beginning of the string. I want to focus on the href's that start with /node/. Which has been added using the variable $catchPhrase.
Using the Drupal service path_alias to return the node.nid as follows:
/**
* Load the node nid from the URL alias.
*
* @param string $url URL string.
*
* @return any
*/
public function getNodeNidFromAlias($url, $phrase)
{
// Default values.
$nid = null;
...
Andrew Fletcher
•
Using the Drupal Poll module and passing via RESTful API - How do...
Andrew Fletcher
•
This code is from Drupal 9 back-end for a React front-end via REST API.
Working...
Andrew Fletcher
•
For an introduction into setting up RESTful hal+json refer to the set-up...
Andrew Fletcher
•
How to use the Drupal REST API to trigger I've forgot (need to change) my...
Andrew Fletcher
•
To get the X-CSRF token, first, you need to login as a member. Follow the steps outlined under User options - login, logout and user details.
Calling a query
The query string is: {domain}/rest/session/token
See the notes on set-up, for the staging and production URLs. Using the current staging URL in the set-up screen, as an example of the query string using the following criteria
Replacing the following variables:
{domain} ~...
Andrew Fletcher
•
In retrieving an image, the primary element required is:
File id or...
Andrew Fletcher
•
For an introduction into setting up RESTful hal+json refer to the set-up...
Andrew Fletcher
•
For an introduction into setting up RESTful hal+json refer to the set-up...
Andrew Fletcher
•
For an introduction into setting up RESTful hal+json refer to the set-up...
Andrew Fletcher
•
To POST an image is similar to the other posts mentioned on this site. This article works through the steps to post an image.
To be able to get, patch or post you need to log in the member so you can retrieve their user id (uid).
Calling a query
To POST an image, the details required are:
Authentication credentials;
Base64image - converted;
Directory_path - the directory path is constructed by combining two directories:
pictures/date, where date is prepresented as...
Andrew Fletcher
•
To sort through a multidimensional array seems to be a function that I...
Andrew Fletcher
•
For an introduction to setting up RESTful hal+json refer to the set-up...
Andrew Fletcher
•
The user API, was originally created under the General...
Andrew Fletcher
•
The development version of the app database is held on the staging site....