Method 1 will never work, since all sections of the layout (and the layout itself) are separate view objects.
Variables set are not global, they are only known to the object you set them on (in this case $view). If you need global variables, you have to use the set_global() method.
Method 2 still uses "$this->output", which has been replaced by "$this->response->body".
The documentation has been updated at this point, but for some reason the hook that automagically updates the dev-docs site doesn't work at the moment.
There are basically two options for method 1:
- pass all variables needed by the view to every view (like your solution)
- pass all variables as global so they are available in all views (like I put in the docs)
Both work, it depends on your implementation which approach is the best.