First block of code (#1) means that you are calling static instance()
method of Header
class which returns an object containing title
property, which is echoed.
Second one echoes name
property of $serial
object. Thing is, how that variable is passed to the view - you can call static method of any class (#1) anywhere you want, at least when the class is loaded or you have autoloader set up. I assume that view file is require_once()
'd or simply in the same file, in that case you need to check where (if anywhere) $serial
variable is set and what value it contains.
If you provide more code, I can tell you more things. :)