Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This would be the perfect opportunity to set up a working debugger, e.g. <a href="http://xdebug.org/" rel="nofollow noreferrer">xdebug</a> and <a href="http://www.netbeans.org/features/php/" rel="nofollow noreferrer">netbeans/php</a></p> <p>edit: In lack of a "real" debugger (which is way better) a (bad) echo/assert debugger has to do</p> <ul> <li>add an error handler method to your class</li> <li>set the error handler within the the constructor</li> <li>set error_reporting=E_ALL and display_errors=On within the constructor</li> <li>set some assert options within the constructor</li> <li>add an assertion within the constructor</li> <li>add two assertions within the getUserAccount() method of your controller</li> </ul> <p>and don't forget to remove the code when you're done debugging</p> <pre><code>class YourController extends TheController{ // debug, don't forget to remove/comment out this method public static function myErrorHandler($errno, $errstr, $errfile, $errline) { $source = file($errfile); echo '&lt;fieldset&gt;&lt;legend&gt;', htmlspecialchars($errstr. ', '.$errfile.'@'.$errline), "&lt;legend&gt;&lt;pre&gt;\n"; for($i=$errline-8; $i&lt;$errline+3; $i++) { if ( isset($source[$i]) ) { echo $i+1, ': ', htmlspecialchars($source[$i]); } } echo "\n&lt;/pre&gt;&lt;/fieldset&gt;\n"; flush(); return false; } public function __construct() { set_error_handler('YourController::myErrorHandler'); // debug, don't forget to remove error_reporting(E_ALL); ini_set('display_errors', 1); // debug, don't forget to remove assert_options(ASSERT_ACTIVE, 1); // debug, don't forget to remove assert_options(ASSERT_WARNING, 1); // debug, don't forget to remove assert_options(ASSERT_BAIL, 1); // debug, don't forget to remove assert_options(ASSERT_QUIET_EVAL, 1); // debug, don't forget to remove parent::__construct(); $this-&gt;loadModel("AccountModel", "Model"); assert( is_object($this-&gt;Model) ); // debug, don't forget to remove $account = $this-&gt;getUserAccount(); } public function loadModel($model_name, $var_name) { // blah blah blah $obj = new $model_name(); $this-&gt;$var_name = $obj; } public function getUserAccount() { assert( is_object($this-&gt;Model) ); // debug, don't forget to remove assert( is_callable(array($this-&gt;Model, 'getAccount')) ); // debug, don't forget to remove $account = $this-&gt;Model-&gt;getAccount($_SESSION["account"]["user_account_id"]); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload