-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ian Warner wrote:
> Hi
> 
> I would like some guidance on best practices for Action Helpers;
> 
> I currently use the following in my controllers
> 
>         // Get the Users Profile PIC URL
>         $this->_helper->facebookPhotos($social);
> 
>         // Setup the Invite elements
>         $profilePic = $this->_helper->facebookPhotos->getProfilePicURL();
> 
> In the helper I have:
> 
>     public function direct($social)
>     {
>         $this->social = $social;
>     }
> 
>     public function getProfilePicURL() {
>     }
> 
> Last time I checked I couldnt do something like:
> 
>    $profilePic =
> $this->_helper->facebookPhotos($social)->getProfilePicURL();
> 
> Or even
>    $helper = $this->_helper->facebookPhotos($social);
>    $profilePic = $helper->getProfilePicURL();

To be able to chain calls like this, you will need to "return $this;"
from your direct() method.

- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
http://twitter.com/tekerson

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrX6VcACgkQ7bkAtAithutYZQCg3Wi4iqw4f/Ys3s/GVNCzlHAO
U5MAn3ktzseT0EN+ZUfTUfw/B7hMdIWx
=n1nE
-----END PGP SIGNATURE-----

Reply via email to