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

**URL:** <https://discourse.cakephp.org/t/what-does-this-fetch-script/5630>\
**Category:** Need Help\
**Created:** [February 8, 2019, 1:56pm UTC](https://discourse.cakephp.org/t/what-does-this-fetch-script/5630 "2019-02-08T13:56:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oompf](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@Oompf](https://discourse.cakephp.org/u/Oompf)\
**Post date:** [February 8, 2019, 1:56pm UTC](https://discourse.cakephp.org/t/what-does-this-fetch-script/5630/1 "2019-02-08T13:56:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [February 8, 2019, 5:26pm UTC](https://discourse.cakephp.org/t/what-does-this-fetch-script/5630/2 "2019-02-08T17:26:06Z")

</div>

Have you read the book on views, in particular [Using Blocks for Script and CSS Files](https://book.cakephp.org/3.0/en/views.html#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](https://api.cakephp.org/), 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.

---

<div class="post-metadata">

**Author:** ![Oompf](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@Oompf](https://discourse.cakephp.org/u/Oompf)\
**Post date:** [March 24, 2019, 1:15am UTC](https://discourse.cakephp.org/t/what-does-this-fetch-script/5630/3 "2019-03-24T01:15:59Z")

</div>

> [@Zuluru](#):
>
> mple, to find out the class you’re dealing with, and then look up what properties and functions it exposes.

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)
