我有这一职能,但并不好。 这使我难以推翻我的法典:
fun... {
eval( ?> . str_replace(
{yield} ,
file_get_contents( templates/ . $template . .phtml ),
file_get_contents( templates/layouts/ . $layout . .phtml )
));
}
让我知道更换情况较好。
感谢。
我有这一职能,但并不好。 这使我难以推翻我的法典:
fun... {
eval( ?> . str_replace(
{yield} ,
file_get_contents( templates/ . $template . .phtml ),
file_get_contents( templates/layouts/ . $layout . .phtml )
));
}
让我知道更换情况较好。
感谢。
function render($template, $layout) {
$cache = "wherever/you/put/the/cache/file/{$template}_{$layout}.phtml";
if (!file_exists($cache)) {
$template = file_get_contents( templates/ . $template. .phtml );
$layout = file_get_contents( templates/layouts/ . $layout . .phtml );
$output = str_replace( {yield} , $template , $layout);
file_put_contents($cache, $output);
} else {
include($cache);
}
}
利用产出缓冲是收集填充模板数据的最佳途径
ob_start();
include "my/template/link.phtml";
$content = ob_get_contents();
ob_end_clean();
How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...
I want to position my field at specified positions.
I m creating a website for my schools "Math Relay" competition. I have a "Container" div (with a white background), then a top-bar, left-bar, and right-bar div inside the container. left-bar and ...
As I stated in title to this question - I have an WPF Grid based layout with two header rows and few empty ones. Grid has about 100 columns. I am trying to achieve the situation, in which I will be ...
How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...
Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...
I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...
How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...