Jump to content

Recommended Posts

Posted

I dont know if this is the best way to do it, so i have to ask... :) This solution works just fine, but i am just wandering if there is a better way?

 

So in my index.php i have this:

 

<?php
require "header.php";
?>

 

then goes my content and then:

 

<?php
require "footer.php";
?>

 

footer.php looks like this:

 

<?php
function FormatRowFooter(){
return <<<HTML
	</div>
	<div id="footer">
		<div id="valid">
			<a href="http://validator.w3.org/check?uri=referer" title="Valid XHTML 1.0 Strict!">xhtml</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Valid CSS level 2.1">css</a>
		</div>
		<div id="copyright">
			<a href="http://www.ivar.rs" title="ivar.rs">2009. iVar ©</a>
		</div>
	</div>
</div>
</body>
</html>
HTML;
}
$rowFooter = FormatRowFooter();
echo $rowFooter;
?>

 

In my header.php only difference is html content and instead of echoing $rowFooter i echo $rawHeader.

 

This works like a charm, i am just wandering if this is correct way to do it? :)

Posted
I know, but i was hoping for one of those "ehhh gavra, gavra, so noobish... this is best way to do that:" hahaha... :D
  • Management
Posted

The code is fine so let's be nit-picky :lol:

 

You can change this code:

$rowFooter = FormatRowFooter();
echo $rowFooter;

with this smaller code:

echo FormatRowFooter();

Done :P

Board Rules - Available Products - Need a Custom Work?

 

< Don't PM me for support, post in the forum or submit a ticket from the client area instead! >

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.