What does <?= $this->fetch('script') ?>

#1

Hi,
i am in lag of information about objects in cakePHP.
something i can not find in any tutorial or help yet are pretty basics that are even part of the default files.

as example i took now the command “$this->fetch(‘script’)” within the default layout ctp.
Questions for me:
Is there any page in the docu that descibes what <?= $this->fetch('script') ?> can be used for?
Is there a libary with the commands / objects available from the object $this-> … and what they do?
By random i found the Variable $page is filled - no documentation of available variables in a Layout/Controller/ etc page.

thank you

0 Likes

#2

Have you read the book on views, in particular Using Blocks for Script and CSS Files? That explicitly documents what is going on here, and how you add to the script block from your views.

If the book isn’t in-depth enough for you, you can always look at the API documentation, or the code itself. Use get_class($this), for example, to find out the class you’re dealing with, and then look up what properties and functions it exposes.

0 Likes

#3

Thank you, i think i found the information i needed - currently i am unsure if it will be a problem not using everything as intended (due to lag of understanding all cakephp from the begining)

0 Likes