add view to functions
This commit is contained in:
@@ -753,4 +753,27 @@ $hash_link.\n\n
|
|||||||
|
|
||||||
add_action('wpcf7_mail_sent', 'my_custom_mail_sent' );
|
add_action('wpcf7_mail_sent', 'my_custom_mail_sent' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!function_exists('view')){
|
||||||
|
function view ($view, $data = array(), $layer = null){
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
if (is_array($data))
|
||||||
|
extract($data);
|
||||||
|
if ($layer !== null){
|
||||||
|
$content = view($view, $data);
|
||||||
|
require $layer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
require $view;
|
||||||
|
|
||||||
|
return trim(ob_get_clean());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user