<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>View on php-tips.com</title>
    <link>https://php-tips.com/tags/view/</link>
    <description>Recent content in View on php-tips.com</description>
    <generator>Hugo</generator>
    <language>ja</language>
    <lastBuildDate>Thu, 15 Mar 2012 09:00:11 +0900</lastBuildDate>
    <atom:link href="https://php-tips.com/tags/view/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>CakePHP 1.3/2.0でView blocksっぽいことを可能にするHelperメソッド</title>
      <link>https://php-tips.com/2012/03/15/helper-method-like-view-blocks-for-cakephp-13-20/</link>
      <pubDate>Thu, 15 Mar 2012 09:00:11 +0900</pubDate>
      <guid>https://php-tips.com/2012/03/15/helper-method-like-view-blocks-for-cakephp-13-20/</guid>
      <description>&lt;p&gt;CakePHP 2.1がリリースされました。2.0から大きく変わる部分は少ないですが、2.1での目玉機能の一つとして&lt;a href=&#34;http://book.cakephp.org/2.0/en/views.html#using-view-blocks&#34;&gt;View blocks&lt;/a&gt;が挙げられます。&lt;/p&gt;
&lt;p&gt;Viewの指定した部分をバッファリングして、後で呼び出すことができる機能ですが、1.3/2.0系でも似たようなことができるヘルパーメソッドを作成していたので公開します。&lt;/p&gt;
&lt;p&gt;個別のビューでバッファリングした要素を、レイアウトctpなどから後で呼び出すことができるので、ビュー別のサイドバーカスタマイズなどに利用できます。&lt;/p&gt;
&lt;p&gt;2.1のView blocksとの違いは、ViewクラスのメソッドではなくHelperクラスのメソッドであること、start/endによるバッファリングではなく、指定エレメントファイルをバッファリングするものであることです。&lt;/p&gt;
&lt;p&gt;[ad]&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
