Function : recall

The recall() function is an helper function that is used to obtain static urls stored with the Resource class named() method.

Assuming we have a resource class which stores urls as shown below:
  Res::new()

       ->url('res/some-file.js')->named('some-js')
       ->url('res/some-file.css')->named('some-css')
       ->urlClose();

                  

We can easily call any of the named url with their uniquely specified name
  var_dump( recall('some-js', 'some-css') );
                  
This will return a script as shown below:
  <script src="http://domain/res/some-file.js" />
  
  <link href="http://domain/res/some-file.css" rel="stylesheet" type="text/css" />
                  


When resources are binded into a new group name, we can also use this function to call the binded group.
  Res::new()

       ->url('res/some-file.js')->named('some-js')
       ->url('res/some-file.css')->named('some-css')

       ->bind('some-group', ['some-js', 'some-css'])
       ->urlClose();

                  

  var_dump( recall('some-group') );
                  
This will return a script as similar as before:
  <script src="http://domain/res/some-file.js" />
  
  <link href="http://domain/res/some-file.css" rel="stylesheet" type="text/css" />
                  


One major thing to note is that relative urls are internally checked before they are added to the webpage. If a relative path was supplied and the file does not exist, the file is never added to the web page. However, static files that start with http protocols are always returned because they are never validated. If a relative path is supplied and the equivalent script is not returned, then the relative file path supplied is not valid.