Formatting output Plese Wait...
Detailed Description
Embedding Views. Embedd one view in another.This class is meant to be called from View(s). To render/load one view's content into another view.
You might also be able to embedd a view in a layout but this operation has not been tested with Layouts.
Definition at line 14 of file viewEmbeder.php.
Member Function Documentation
Embed::renderable( string $viewName, Object $src = null
)
render a general View. accept two arguments render a View and embed its output content. First argument is the viewName. You can optionally specify a source Object who's member variables will become the local variables of the embedded Vie
- Warning:
- Remember it renders a View under the current method.
- Parameters:
-
| $viewName | Name of the View |
| $src | Object thats member variables will become local to that view |
Definition at line 24 of file viewEmbeder.php.
References $val, and zTemplate::sysNumeric().
Show Source00024 {
00025 $viewPath = Z_PROJECT_ROOT.DRS.Z_DIR_APPS.DRS.Z_DIR_MVC_VIEW.DRS.Z_CONTROLLER_NAME.DRS.Z_METHOD_NAME.DRS.$viewName.".view.php";
00026 if(!file_exists($viewPath)){
00027 exit(zTemplate::sysNumeric('v404', $viewName, $viewPath));
00028 }
00029 if(is_object($src)){
00030 foreach($src as $var => $val){
00031 ${$var} = $val;
00032 }
00033 }
00034 return include($viewPath);
00035 }
Top
Embed::sharedRenderable( string $viewName, Object $src = null
)
render a shared view. accept two arguments render a View and embed its output content. First argument is the viewName. You can optionally specify a source Object who's member variables will become the local variables of the embedded Vie
- Warning:
- Remember it renders a shared View under the current project.
- Parameters:
-
| $viewName | Name of the View |
| $src | Object thats member variables will become local to that view |
Definition at line 45 of file viewEmbeder.php.
References $val, and perror().
Show Source00045 {
00046 $viewPath = Z_PROJECT_ROOT.DRS.Z_VIEW_DIR_NAME.DRS.$viewName.".view.php";
00047 if(!file_exists($viewPath)){
00048 perror("Failed to render Shared View $viewName as no such file exists $viewPath");
00049 return false;
00050 }
00051 if(is_object($src)){
00052 foreach($src as $var => $val){
00053 ${$var} = $val;
00054 }
00055 }
00056 return include($viewPath);
00057 }
Top
Embed::loadable( string $viewName, array $assoc = null
)
Loads a general view. accept two arguments load a View and embed its output content. First argument is the viewName. You can optionally specify a source associative who's keys will become the local variables of the embedded View
- Warning:
- remember it loads a View under the current method.
- Parameters:
-
| $viewName | Name of the View |
| $assoc | an associative array thats key's will be local to the view. |
Definition at line 67 of file viewEmbeder.php.
References $val, and perror().
Show Source00067 {
00068 $viewPath = Z_PROJECT_ROOT.DRS.Z_DIR_APPS.DRS.Z_DIR_MVC_VIEW.DRS.Z_CONTROLLER_NAME.DRS.Z_METHOD_NAME.DRS.$viewName.".view.php";
00069 if(!file_exists($viewPath)){
00070 perror("Failed to Load View $viewName as no such file exists $viewPath");
00071 return false;
00072 }
00073 if(is_array($assoc)){
00074 foreach($assoc as $var => $val){
00075 ${$var} = $val;
00076 }
00077 }
00078 return include($viewPath);
00079 }
Top
Embed::sharedLoadable( string $viewName, array $assoc = null
)
Loads a Shared view. accept two arguments load a View and embed its output content. First argument is the viewName. You can optionally specify a source associative who's keys will become the local variables of the embedded View
- Warning:
- remember it loads a shared View under the current project.
- Parameters:
-
| $viewName | Name of the View |
| $assoc | an associative array thats key's will be local to the view. |
Definition at line 89 of file viewEmbeder.php.
References $val, and perror().
Show Source00089 {
00090 $viewPath = Z_PROJECT_ROOT.DRS.Z_VIEW_DIR_NAME.DRS.$viewName.".view.php";
00091 if(!file_exists($viewPath)){
00092 perror("Failed to Load Shared View $viewName as no such file exists $viewPath");
00093 return false;
00094 }
00095 if(is_array($assoc)){
00096 foreach($assoc as $var => $val){
00097 ${$var} = $val;
00098 }
00099 }
00100 return include($viewPath);
00101 }
Top
The documentation for this class was generated from the following file: