00001 <?php 00014 class Embed extends zCore{ 00024 function renderable($viewName, $src=null){ 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 } 00045 function sharedRenderable($viewName, $src=null){ 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 } 00067 function loadable($viewName, $assoc=null){ 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 } 00089 function sharedLoadable($viewName, $assoc=null){ 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 } 00102 } 00104 ?>