phpDocumentor GloryLands
Common
[ class tree: GloryLands ] [ index: GloryLands ] [ all elements ]

How to use Dynamic Path

  1. <?php
  2. // Initialize the path
  3. $path new GLDynamicPath('/images/UI/flag.gif');
  4.  
  5. // You can get the absolute file location on the disk, using:
  6. $disk_path = (string)$path// or...
  7. $disk_path $path->file();
  8.  
  9. // You can get the relative URL for the file using:
  10. $url $path->url();
  11.  
  12. // You can also use GLDynamicPath for folderss
  13. $folder new GLDynamicPath('/images/elements');
  14.  
  15. // You can get the absolute file location of the folder, using:
  16. $disk_folder = (string)$path // or...
  17. $disk_folder $folder->path();
  18.  
  19. // You also get a sub-folder using:
  20. $tiles_folder $folder->path('tiles');
  21.  
  22. // Or a sub-file, using:
  23. $my_image $folder->file('image.gif');
  24.  
  25. // In the same way, you can use it in URLs:
  26. $my_web_image $folder->url('image.gif');
  27.  
  28. ?>

Documentation generated on Tue, 13 Oct 2009 23:48:59 +0300 by phpDocumentor 1.4.1