We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Something has continued around at middle of page.

Something has continued around at middle of page. https://docs.phalcon.io/en/latest/reference/di.html I confirmed it on latest version of chrome/firefox/opera. I feel dizzy. Please someone fix it.

I can not find the error, soon layer update the documentation with the arrangement.

https://raw.githubusercontent.com/phalcon/docs/master/en/reference/di.rst

String
^^^^^^
This type expects the name of a valid class, returning an object of the specified class, if the class is not loaded it will be instantiated using an auto-loader.
This type of definition does not allow to specify arguments for the class constructor or parameters:

.. code-block:: php

    <?php

    // Return new Phalcon\Http\Request();
    $di->set('request', 'Phalcon\Http\Request');

Object
^^^^^^
This type expects an object. Due to the fact that object does not need to be resolved as it is
already an object, one could say that it is not really a dependency injection,
however it is useful if you want to force the returned dependency to always be
the same object/value:

.. code-block:: php

    <?php

    use Phalcon\Http\Request;

    // Return new Phalcon\Http\Request();
    $di->set('request', new Request());

Closures/Anonymous functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This method offers greater freedom to build the dependency as desired, however, it is difficult to
change some of the parameters externally without having to completely change the definition of dependency:

.. code-block:: php

    <?php

    use Phalcon\Db\Adapter\Pdo\Mysql as PdoMysql;

    $di->set("db", function () {
        return new PdoMysql(
            array(
                "host"     => "localhost",
                "username" => "root",
                "password" => "secret",
                "dbname"   => "blog"
            )
        );
    });