How to Force a Method Call on a Property or Method of an Object in PHP?
- by Noah Goodrich
In my View (using Zend_View so the the view is an object), I make calls to object properties and methods to populate the template like so:
<?= $this->user->name ?> // Outputs John Doe
<br/>
<?= $this->user->getCompany()->name ?> // Outputs Acme
<br/>
<?= $this->method() ?> // Outputs foobar
If I…