{PT} - 3.5.3.1.2 render

render(string $action, string $layout, string $file)

O método render() é automaticamente chamado ao final de cada action do controller requisitada. Esse método executa toda a lógica da view (usando dados que você forneceu usando o método set()), insere a view dentro do layout e o serve de volta para o usuário final.

O arquivo de view padrão renderizado é determinado por convenção. Se a action buscar() do ReceitasController é requisitada, o arquivo de view /app/views/receitas/buscar.ctp será renderizado.

Ainda que o CakePHP vá automaticamente chamá-lo (a menos que você configure $this->autoRender para false) depois de cada lógica de action, você pode usá-lo para especificar um arquivo de view alternativo configurando o nome da action no controller usando $action. Você pode também especificar um arquivo alternativo um terceiro parâmetro, $file. Quando usar $file, lembre-se de utilizar um pouco das constantes globais do CakePHP (como a VIEWS).

O parâmetro $layout permite especificar o layout na qual a view é renderizada.

{EN} - 3.5.3.1.2 render

render(string $action, string $layout, string $file)

The render() method is automatically called at the end of each requested controller action. This method performs all the view logic (using the data you’ve given in using the set() method), places the view inside its layout and serves it back to the end user.

The default view file used by render is determined by convention. If the search() action of the RecipesController is requested, the view file in /app/views/recipes/search.ctp will be rendered.

Although CakePHP will automatically call it (unless you’ve set $this->autoRender to false) after every action’s logic, you can use it to specify an alternate view file by specifying an action name in the controller using $action. You can also specify an alternate view file using the third parameter, $file. When using $file, don't forget to utilize a few of CakePHP’s global constants (such as VIEWS).

The $layout parameter allows you to specify the layout the view is rendered in.

Diferenças

Lines: 1-6Lines: 1-6
 <title>render</title> <title>render</title>
 <p class="method"><code>render(string $action, string $layout, string $file)</code></p> <p class="method"><code>render(string $action, string $layout, string $file)</code></p>
-<p>The &lt;code>render()</code> method is automatically called at the end of each requested controller action. This method performs all the view logic (using the data you’ve given in using the &lt;code>set()</code> method), places the view inside its layout and serves it back to the end user.</p>
<p>The default view file used by render is determined by convention. If the <code>search()</code> action of the RecipesController is requested, the view file in <kbd>/app/views/recipes/search.ctp</kbd> will be rendered.</p>
<p>Although CakePHP will automatically call it (unless you’ve set <code>$this-&gt;autoRender</code> to false) after every action’s logic, you can use it to specify an alternate view file by specifying an action name in the controller using $action. You can also specify an alternate view file using the third parameter, <code>$file</code>. When using <code>$file&lt;/code>, don't forget to utilize a few of CakePHP’s global constants (such as <code>VIEWS</code>).</p>
<p>The &lt;code>$layout</code> parameter allows you to specify the layout the view is rendered in.</p>
+<p>O todo render() é automaticamente chamado ao final de cada action do controller requisitada. Esse método executa toda a lógica da view (usando dados que você forneceu usando o todo set()), insere a view dentro do layout e o serve de volta para o usrio final.</p>
<p>O arquivo de view padrão renderizado é determinado por convenção. Se a action buscar() do ReceitasController é requisitada, o arquivo de view /app/views/receitas/buscar.ctp se renderizado.</p>
<p>Ainda que o CakePHP automaticamente chamá-lo (a menos que você configure $this-&gt;autoRender para false) depois de cada lógica de action, você pode usá-lo para especificar um arquivo de view alternativo configurando o nome da action no controller usando $action. Você pode também especificar um arquivo alternativo um terceiro parâmetro, $file. Quando usar $file, lembre-se de utilizar um pouco das constantes globais do CakePHP (como a VIEWS).</p>
<p>O parâmetro $layout permite especificar o layout na qual a view é renderizada.</p>