hi!
I'm from Poland so I'm sorry for my English🙂
I would like a real PHP programist to read it. I think it's not easy to solve it.
I have a problem with classes. They work on my computer (localhost) but if I send files to my server they don't work propely. I use FastTemplate class to build my site.
I am not going to describe class.FastTemplate.php 🙂 The problem is that in 'class Main' lines which use 'class SubMain' doesn't work on the server but works on my PC (localhost). It is just an example so if you find letter's mistake don't bother. I am not checking everything here. My aim is to show you a general problem.
Do you have any ideas why I am not allowed to use another class inside the 'Main class'??
/index.php/
<?php
include ("class.FastTemplate.php");
include ("class.Main.php")
include ("class.SubClass.php")
$cMain = new Main;
$cMain->PrintMain();
?>
/class.SubMain.php/
<?php
class SubMain {
var $FastTemplateObject;
function PrintSubMain()
{
$this->FastTemplateObject->assign( ('SUB_MAIN_TEXT', 'some text') );
}
}
?>
/class.Main.php/
<?php
class Main {
function PrintMain()
{
$FastTemplate = new FastTemplate(".");
$FastTemplate->define( array( 'index' => 'index.tpl' ) );
[COLOR=YellowGreen]//THIS LINE WORKS PROPELY[/COLOR]
$FastTemplate->assign( array( 'TITLE' => 'My test title msg');
[COLOR=Red] //THIS THREE LINES DOESN'T WORK PROPELY[/COLOR]
$aSubMain = new SubMain;
$aSubMain->FastTemplateObject = $this->FastTemplate;
$aSubMain->PrintSubMain();
$FastTemplate->parse( 'INDEX', 'index' );
$FastTemplate->FastPrint( 'INDEX' );
}
}