przewiń do treści

Zend Framework od podstaw

Włodzimierz Gajda

class My_Application_Resource_Lorem
    extends Zend_Application_Resource_ResourceAbstract
{
    protected $_lorem;
    public function getLorem()
    {
        if (null === $this->_lorem) {
            $this->_lorem = new My_Lorem($this->getOptions());
        }
        return $this->_lorem;
    }
    public function init()
    {
        $lorem $this->getLorem();
        ...
        return $lorem;
    }
}

Listing 11.2. Klasa My_Application_Resource_Lorem z pliku My/Application/Resource/Lorem.php

Rozdział 11. Implementacja wtyczki inicjalizującej zasoby

listing-11-02.txt