View Single Post
Old 03-23-10, 02:41 AM   #5
t3hl33td4rg0n
Dethklok Returns!
 
t3hl33td4rg0n's Avatar
 
Join Date: Dec 2004
Location: Kent, OH
Posts: 2,142
Send a message via AIM to t3hl33td4rg0n Send a message via MSN to t3hl33td4rg0n Send a message via Yahoo to t3hl33td4rg0n
Default Re: LAMP Templating/CMS Performance

Quote:
Originally Posted by ViN86 View Post
Yea there are some limitations to AJAX. Mostly that older browsers don't really support it and different browsers handle things differently.
As long as its supported in FF2, IE6 then you should be ok. From there it depends on the data output method you use. Doing straight preprocessed HTML shouldn't ever be a problem, however if the script is doing other stuff, you could run into issues.


Quote:
Originally Posted by ViN86
Yea, I learned method 2 from a PHP book. Once I realized that you can pretty much insert PHP tags and write some code wherever you want, it only seemed natural to just insert data on the fly wherever instead of searching for strings to replace.
Some do argue against this point in that they should always be separate. IMO, it depends on context and usage.


Quote:
Originally Posted by ViN86
Actually it's even simpler than that. I just write w/e PHP and HTML I need into a page called header.php or something, then I just put in include("header.php"); where I want the header to display and it just echoes the text. You have to be careful, though. I typically store my files in a template folder. But when you use include, it treats the inserted code as if it were coming from the home directory, not where it actually is. So if you're not careful you can mess up links this way.
OOohhhh. When you said HTML, I didnt know you meant that they were PHP files with PHP stuff in 'em :P. I usually use a constant to get around this, so that any relative paths are updated, regardless of where you put the file, as long as you update the relative path locale base script.

In method 1, I did this...
Code:
table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="169" align="left" valign="top" nowrap="nowrap"><img src="{{PATH}}img/head_top_01.jpg" width="169" height="61" alt="Logo"></td>
		<td align="left" valign="top" nowrap="nowrap"><img src="{{PATH}}img/head_top_02.jpg" ></td>
	</tr>
	<tr>
		<td colspan="2" class="headNav" nowrap="nowrap"><img src="{{PATH}}img/head_nav_01_home_n.jpg" width="68" height="28" alt="Home" /><img src="{{PATH}}img/head_nav_spacer.jpg" width="17" height="28"><img src="{{PATH}}img/head_nav_02_services_n.jpg" width="110" height="28" alt="Services"></td>
	</tr>
</table>
Of course this will be changed to outfit the new method I plan on using. This actually would be a good place to use AJAX to minimize the amount of PHP statements in the template. Now that I think about it, I could make this part of the object constructor.
__________________


Intel QX9650 @ 3.83GHzXFX 780ieVGA GTX 560Ti8GB GSkill DDR800Creative Sound Blaster X-Fi Titanium PCI-ESeagate 1.5TB . 4x Samsung 2TB

Quote:
Originally Posted by MowTin View Post
....it's so clear how government makes things worse not better...
t3hl33td4rg0n is offline   Reply With Quote