Search Results
Article: PHP Class To Interact With is.gd API
… The is.gd URL shortening service is yet another site that converts a long URL into a small one, but is.gd differs in that it generally produces smaller URLs than others. The is.gd API doesn't require that you create an …
… wrote about recently on the site. The function originally found any URL strings within a larger string and turned them into links. The … thing, except that the link text has been shortened using the shortenurl() function. $longurl = "there is the new site …
… was by appending the hash value like "#node/123" to the end of the URL. This meant that as the page loaded I could look for this hash … will append the path of the link that was clicked to the end of the URL as a hash value. // Find all modal links on the page and attach a … // When the link is clicked, add the path to the URL as a hash value. history.pushState('', '', `#${this.pathname}`); …
… There are a few URL shortening services about, of which bit.ly is just one. However, it … to interact with the site. Not only is it possible to shorten URL's, you can also reverse them, find out information about the site … available in this class but the main two are shorten() to turn a URL into its bit.ly equivalent and expand(), which will do the exact …
… sent a request. This controls how Varnish deals with cookies and which URL's should be included or excluded from the cache mechanisms. This is … of the IP address of the user to the server in a proxy header. What URLs to skip when storing cache objects. Optionally prevent access to … = 6h; # Pipe these paths directly to Apache for streaming. if (req.url ~ "^/admin/content/backup_migrate/export") { return (pipe); } # Set …
Article: Drupal 9: Creating A GET Form
… from how you get data from the form input to considerations of the URL structure is important. In fact, I would say that creating GET … swapping to a GET form is that the the form data will be added to the URL (which is how GET requests work). This means that any data the user entered will be added to the URL of the page. Additionally, because Drupal adds additional elements …
… to allow users to easily copy. <div> <p> <input class="js-referral-url" type="text" readonly="readonly" … and the content copied. window.onload = function () { const shareUrl = document.querySelector(".js-referral-url"); const copyContent = async () => { try { await …
… The equivalent in Drupal 8+ is the Link class. use \Drupal\Core\Link; $url = Url::fromUri('route:user.logout'); $link = new Link(t('Logout'), $url); There are a number of static helper methods that can generate the …
… a nice little PostCode to geographical reference tool. Using a simple URL parameter I was able to give the site a PostCode and strip the … $ch = curl_init($uri); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output …
… httpClient property. public function returnGetPage() { // Generate the Url object for the page we want to get. $url = new Url('entity.node.canonical', ['node' => 123]); // Make the call to the …