Search Results
… 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 …
… 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 …
Article: Drupal 9: Creating Ajax Dialogs
… { $output = []; $output['a_dialog_link'] = [ '#type' => 'link', '#url' => new Url('mymodule_display_modal'), '#title' => 'node in dialog', … { $output = []; $output['a_dialog_link'] = [ '#type' => 'link', '#url' => new Url('mymodule_display_modal'), '#title' => 'node in …
Article: PHP5 Filter Functions Part 1
… expressions to tell if a value is a number, a boolean or even a URL, you can just use these filter fucntions. The main functions that … }else{ echo 'Invalid Email'; }; The same thing can be done with a URL. $url = 'http://www.hashbangcode.com'; if( filter_var($url, …
… file. This file is basically a XML file containing a list of URLs. Most major search engines understand (and look for) this file, so … and made sure that the index action did not show the layout. The URLs are passed as an array to the view. class SitemapController … indexAction() { $this-> _helper-> layout()-> disableLayout(); $urls = array(array('loc'=> 'http://www.hashbangcode.com/', 'lastmod'=> …
… of a string within another string. Basically, I needed to find all URL's from a table that were more than 3 levels deep (i.e. with 3 … difficult really, all I needed to do was find out the length of the URL string and then subtract the length of the string with the slashes removed. This MySQL statement will give you the URL and the number of slashes in that URL in a table. SELECT url, …