Formatting output Plese Wait...
shourtcut to make the Url to the Shared Contrnts like Images javascripts CSS File(s) etc.
More...
|
Public Member Functions |
| image ($path, $prjName=Z_PROJECT_NAME) |
| returns the Path to the Image
|
| javaScript ($path, $prjName=Z_PROJECT_NAME) |
| returns the Path to the javascript File
|
| css ($path, $prjName=Z_PROJECT_NAME) |
| returns the Path to the CSS
|
| vbScript ($path, $prjName=Z_PROJECT_NAME) |
| returns the Path to the VB Scripts
|
| uploadedImage ($path, $prjName=Z_PROJECT_NAME) |
| returns the Path to the Uploaded Image
|
| downloadedImage ($path, $prjName=Z_PROJECT_NAME) |
| returns the Path to the Downloadable Image
|
Detailed Description
shourtcut to make the Url to the Shared Contrnts like Images javascripts CSS File(s) etc.
e.g. shared::image('file.png')
wil return a String Like /zigmoyd/projects/main/path/to/file.png. a Shared Content belongs to a project so its expected that all shared contents resides in usr/share
directory of your project's directory. like all images resides in usr/share/pix
, all javascripts resides int usr/share/scripts/js
directory. all stylesheets resides in usr/share/css
Directory.
Now Loading it has nsimple too.in your css you used to code background: boring/image/path.png;
before and now you will code it like this.
and thats all
shared::image() will replace itself with proper path. When you are just passing the image name its not hiding the original path to the file. rather its rewrited as
background: /path/to/usr/share/pix/imageName.png
But when you prepend an
?
or an
</tt> symbol with it it will use smart url system by hiding the original path to image.
for Shared Content routing Zigmoyd actually uses a script called rt.php
you will find it on yor Zigmoyd Installation directory. when ?
or an </tt> symbol is used it uses rt.php
to serve the content . e.g. it specifies the file name and type to rt.php
as an get request and rt.php
delivers that shared content. so if you use shared::image('?imageName.png'); or shared::image('.png'); the original path to the image will be kept hidden.
and If you use ?
it will not utilize rewrite engine. else if </tt> is used it will utilize rewrite engine.
Definition at line 46 of file shared_helper.php.
Member Function Documentation
shared::image( string $path, string $prjName = Z_PROJECT_NAME
)
returns the Path to the Image
- Parameters:
-
| $path | Path to the Image (relative to usr/share/pix Directory) |
| $prjName | Optionally If you specify a project You can use Contents from that Projects |
- Returns:
- string
Definition at line 54 of file shared_helper.php.
References Z_PROJECT_DIR.
Show Source00054 {
00055 if($path[0] == '?')
00056 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/rt.php/$prjName/p/".substr($path, 1, (strlen($path)-1));
00057 elseif($path[0] == '@')
00058 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/r/$prjName/p/".substr($path, 1, (strlen($path)-1));
00059 else
00060 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/".Z_DIR_PROJECTS."/".Z_PROJECT_DIR."/".Z_DIR_IMG."/".$path;
00061 }
Top
shared::javaScript( string $path, string $prjName = Z_PROJECT_NAME
)
returns the Path to the javascript File
- Parameters:
-
| $path | Path to the JavaScript (relative to usr/share/scripts/js Directory) |
| $prjName | Optionally If you specify a project You can use Contents from that Projects |
- Returns:
- string
Definition at line 69 of file shared_helper.php.
References Z_PROJECT_DIR.
Show Source00069 {
00070 if($path[0] == '?')
00071 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/rt.php/$prjName/j/".substr($path, 1, (strlen($path)-1));
00072 elseif($path[0] == '@')
00073 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/r/$prjName/j/".substr($path, 1, (strlen($path)-1));
00074 else
00075 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/".Z_DIR_PROJECTS."/".Z_PROJECT_DIR."/".Z_DIR_JS."/".$path;
00076 }
Top
shared::css( string $path, string $prjName = Z_PROJECT_NAME
)
returns the Path to the CSS
- Parameters:
-
| $path | Path to the JavaScript (relative to usr/share/scripts/css Directory) |
| $prjName | Optionally If you specify a project You can use Contents from that Projects |
- Returns:
- string
Definition at line 84 of file shared_helper.php.
References Z_PROJECT_DIR.
Show Source00084 {
00085 if($path[0] == '?')
00086 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/rt.php/$prjName/c/".substr($path, 1, (strlen($path)-1));
00087 if($path[0] == '@')
00088 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/r/$prjName/c/".substr($path, 1, (strlen($path)-1));
00089 else
00090 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/".Z_DIR_PROJECTS."/".Z_PROJECT_DIR."/".Z_DIR_CSS."/".$path;
00091 }
Top
shared::vbScript( string $path, string $prjName = Z_PROJECT_NAME
)
returns the Path to the VB Scripts
- Parameters:
-
| $path | Path to the JavaScript (relative to usr/share/scripts/vbs Directory) |
| $prjName | Optionally If you specify a project You can use Contents from that Projects |
- Returns:
- string
Definition at line 99 of file shared_helper.php.
References Z_PROJECT_DIR.
Show Source00099 {
00100 if($path[0] == '?')
00101 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/rt.php/$prjName/v/".substr($path, 1, (strlen($path)-1));
00102 if($path[0] == '@')
00103 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/r/$prjName/v/".substr($path, 1, (strlen($path)-1));
00104 else
00105 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/".Z_DIR_PROJECTS."/".Z_PROJECT_DIR."/".Z_DIR_VBS."/".$path;
00106 }
Top
shared::uploadedImage( string $path, string $prjName = Z_PROJECT_NAME
)
returns the Path to the Uploaded Image
- Parameters:
-
| $path | Path to the JavaScript (relative to the Upload Directory) |
| $prjName | Optionally If you specify a project You can use Contents from that Projects |
- Returns:
- string
Definition at line 114 of file shared_helper.php.
Show Source00114 {
00115 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/rt.php/$prjName/u/$path";
00116 }
Top
shared::downloadedImage( string $path, string $prjName = Z_PROJECT_NAME
)
returns the Path to the Downloadable Image
- Parameters:
-
| $path | Path to the JavaScript (relative to the Download Directory) |
| $prjName | Optionally If you specify a project You can use Contents from that Projects |
- Returns:
- string
Definition at line 124 of file shared_helper.php.
Show Source00124 {
00125 return pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME)."/rt.php/$prjName/d/$path";
00126 }
Top
The documentation for this class was generated from the following file: