YorkshireSteve Posted April 6, 2006 Share Posted April 6, 2006 Hi All,I'm creating a basic template system for a website and have variables in the content such as [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]{{Content:Body}}[!--fontc--][/span][!--/fontc--] which would be replaced with the variable [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]$content['body'][!--fontc--][/span][!--/fontc--]. This works fine, however, I also want to replace [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]{{Component:Login_Form}}[!--fontc--][/span][!--/fontc--] with the file [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]Components/Login_Form.php[!--fontc--][/span][!--/fontc--]. I'm not having much luck with this but it's something which would be very handy not only on this project, but also on other projects in the future.Does anyone have any ideas how this may be achieved?Thanks,Steve Quote Link to comment Share on other sites More sharing options...
obsidian Posted April 6, 2006 Share Posted April 6, 2006 as long as your Login_Form component is simply an HTML form, you could use file_get_contents() to assign the content of the component to a variable and echo it out inside the template tag. Quote Link to comment Share on other sites More sharing options...
YorkshireSteve Posted April 6, 2006 Author Share Posted April 6, 2006 [!--quoteo(post=362197:date=Apr 6 2006, 01:38 PM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Apr 6 2006, 01:38 PM) [snapback]362197[/snapback][/div][div class=\'quotemain\'][!--quotec--]as long as your Login_Form component is simply an HTML form, you could use file_get_contents() to assign the content of the component to a variable and echo it out inside the template tag.[/quote]Thanks for the reply. Anything represented by [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]{{Content:xxxx}}[!--fontc--][/span][!--/fontc--] is HTML code, pulled straight from a database. Anything in the form of [!--fonto:Courier New--][span style=\"font-family:Courier New\"][!--/fonto--]{{Component:xxxx}}[!--fontc--][/span][!--/fontc--] will need to be included as this is going to be executable code (such as a poll, form (including processing) etc. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.