I study the finished project on October CMS and saw an interesting thing about getting a link to the product array.

{% partial "product" product=this.controller.vars.data.product %} 

In brief: there is a plug-in X, in which there is an Essence component, in which data is prepared for display on the product page. In particular, below is a piece of code with the required $data from this.controller.vars.data.product (the excess is removed for clarity and has no relation to the question):

 public function find() $data['product'] = $this->getPreparedProduct($data['id']); $result = array( "type" => "product", "data" => $data ); return $result; 

The question is: is it correct to get data through this.controller.vars.data.product - is this a normal approach or a crutch? Why I thought that this should not be so - there is $result , which is clearly returned somewhere and which can / should be read in the traditional way, why I don’t understand the required data from the whole list of controller variables.

If possible, give a link to the docks, where it is spelled out, I did not see it on the official docks.

    1 answer 1

    this.controller.vars.data.product is optional for getting the necessary data, data.product is quite enough.