Jump to content

Hey guys ... whats up with this code? HELP?!


jonaofarc

Recommended Posts

this strip of code seems to make the browser go into a loop? would anybody please tell me what the return function does here? I really dont understand why the return function is returning a variable?

 

Fatal error: Call to a member function getType() on a non-object

 

 

public function __construct($display_type)

{

if (empty($display_type) && !empty($_COOKIE['display_type']))

$this->display_type = $_COOKIE['display_type'];

else

    $this->display_type = ($display_type === 'list') ? 'list' : 'grid';

 

setcookie('display_type', $this->display_type, strtotime('+ 1 year'));

}

 

public function getType()

{

return $display_type;

}

Link to comment
https://forums.phpfreaks.com/topic/147681-hey-guys-whats-up-with-this-code-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.