Function : Raw

The raw() function is a coined function that uses the internal file_get_contents() php function to return the direct content of a rex template file. The only major difference is that only rex template files from within the WIN_REX, that is, window rex directory are being resolved.

Assuming we have a template file within the template directory "windows/Rex" named "home.rex.php" as below:
  The boy is {{ $age }} years today
                  

We can use the raw() function as shown below:
  <?php 

  namespace spoova/mi/windows/Routes;

  use window;

  class Home extends Window { 

    function __construct() {

      //fetch template content
      $rex = raw('home');

      //The boy is {{ $age }} years today
      echo ( $rex );

    }

  }
                  

In the sample above, the direct content of the template file is returned. Note that we can also use dots to specify subdirectories. Internally, all dots will be converted to slashes.

  <?php 

  namespace spoova/mi/windows/Routes;

  use window;

  class Home extends Window { 

    function __construct() {

      // windows/Rex/home/user.rex.php
      $raw = raw('home.user'); 
      
      //dump template content
      vdump( $raw ); 

    }

  }