Jump to content

Recommended Posts

Hello, I am very new to PHP and I am trying to get a CMMS written in PHP working.

I have tracked the execution and have found it stops on this line of code:

 

return $this->templates["login"]->blocks["Login"]->output;

 

 

I'm not sure what "blocks" is, I cant find this in the templates class.

Should this be a function?

 

Also what is ->output? Is this a PHP function or variable?

 

Can anyone direct me to a good PHP langauge source?

 

I am using PHP 5 and I think this app was written in pre PHP 5 days. -Thanks

Link to comment
https://forums.phpfreaks.com/topic/49586-solved-execution-stops/
Share on other sites

I understand that this has no context I was just asking if anyone could see an simple syntax error. Secondly Its a CMMS and not a CMS. The reason why I'm not posting on a more relevant forum is because there is none. The CMMS is located @ http://www.maintenance-software.org/. Maybe someone knows of a forum or is familiar with this application. Thanks again.

Actually, there may be a problem there. I thought you may be able to get away with that but apparently not. This code won't work for me either.

[code]

#!/usr/bin/php

<?php

 

class b {

    function foo() {

        echo "here is foo";

    } 

}

 

class a {

 

    function c() {

        return new b();

    } 

}

 

$a = new a();

$a->c->foo();

   

?>

[/code]

 

Have you got error reporting switched on?

I have error_reporting  =  E_ALL and display_errors = ON in the php.ini. I am also logging errors, but nothing seems to show up in the logs.

This error is in the creation of the layout and login page so it may be showing the error but I don't see anything. Again I am very new to PHP so I may have other config settings wrong. Thanks again

Ok I solved the problem, Its a bit vague, but I read a forum post about PHP5 migration and its something to do with not using "$this" as this will cause a problem. The post was a bit unclear and I don't know why, Ive only been into PHP for 3 days now. So I did a find and replace $this to $_this and its all good now. 

 

This is what the line of code looks like now:

 

return $_this->templates["login"]->blocks["Login"]->output;

 

Does anyone understand this issue. I will post here if I find out why. Thanks for your help thorpe.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.