FounderSim
10-04-2014, 12:44 PM
So my tester/explore page works then but when I add the method investigate, I can't even access the tester/explore page. Its just blank. I have checked and rechecked both the controller and view for sytanx errors and can't seem to find any. I noticed sometimes if I will not be alerted of any error if I dont pass two variables to certain functions in mysidia so I checked all them as well because that usually results in a blank page as well.
The Controller:
public function investigate(){
$mysidia = Registry::get("mysidia");
$explore_var = $mysidia->session->fetch("explorer");
if($explore_var == 0)
{
$this->setField("explorer", new String("Stupid Hacker..."));
}
else
{
$mysidia->session->assign("explorer_step", 2);
$stmt = $mysidia->db->select("explorer", array("eType"), "eid={$explore_var}");
$result = $stmt->fetchObject();
if($result->eType == "item")
{
$this->setField("explorer", new String($result->eType));
}
elseif($result->eType == "coin")
{
$this->setField("explorer", new String($result->eType)));
}
elseif($result->eType == "pet")
{
$this->setField("explorer", new String($result->eType));
}
else
{
$this->setField("explorer", new String("boo"));
}
}
}
The View
public function investigate(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle("TEST");
$emessages = $this->getField("explorer");
switch($emessages)
{
//manual edit of comments during paist of this code =)
case "item":
$document->add(new Comment('Ooh/a>'));
break;
case "pet":
$document->add(new Comment('oh/a>'));
break;
case "coin":
$document->add(new Comment('Ooh">Continue</a>'));
break;
default:
$document->add(new Comment($emessages));
}
}
The Controller:
public function investigate(){
$mysidia = Registry::get("mysidia");
$explore_var = $mysidia->session->fetch("explorer");
if($explore_var == 0)
{
$this->setField("explorer", new String("Stupid Hacker..."));
}
else
{
$mysidia->session->assign("explorer_step", 2);
$stmt = $mysidia->db->select("explorer", array("eType"), "eid={$explore_var}");
$result = $stmt->fetchObject();
if($result->eType == "item")
{
$this->setField("explorer", new String($result->eType));
}
elseif($result->eType == "coin")
{
$this->setField("explorer", new String($result->eType)));
}
elseif($result->eType == "pet")
{
$this->setField("explorer", new String($result->eType));
}
else
{
$this->setField("explorer", new String("boo"));
}
}
}
The View
public function investigate(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle("TEST");
$emessages = $this->getField("explorer");
switch($emessages)
{
//manual edit of comments during paist of this code =)
case "item":
$document->add(new Comment('Ooh/a>'));
break;
case "pet":
$document->add(new Comment('oh/a>'));
break;
case "coin":
$document->add(new Comment('Ooh">Continue</a>'));
break;
default:
$document->add(new Comment($emessages));
}
}