lib/roda/plugins/render.rb
def view(template, opts = (content = _optimized_view_content(template); OPTS))
          if content
            # First, check if the optimized layout method has already been created,
            # and use it if so.  This way avoids the extra conditional and local variable
            # assignments in the next section.
            if layout_method = _layout_method
              return send(layout_method, OPTS){content}
            end

            # If we have an optimized template method but no optimized layout method, create the
            # optimized layout method if possible and use it.  If you can't create the optimized
            # layout method, fall through to the slower approach.
            if layout_template = self.class.opts[:render][:optimize_layout]
              retrieve_template(:template=>layout_template, :cache_key=>nil, :template_method_cache_key => :_roda_layout)
              if layout_method = _layout_method
                return send(layout_method, OPTS){content}
              end
            end
          else
            opts = parse_template_opts(template, opts)
            content = opts[:content] || render_template(opts)
          end

          if layout_opts  = view_layout_opts(opts)
            content = render_template(layout_opts){content}
          end

          content
        end
# Render the given template.  If there is a default layout
# for the class, take the result of the template rendering
# and render it inside the layout.  See Render for details.
Render the given template.  If there is a default layout
for the class, take the result of the template rendering
and render it inside the layout.  See Render for details.
Render the given template . If there is a default layout for the class take the result of the template rendering and render it inside the layout . See Render for details .
def view(template, opts = (content = _optimized_view_content(template); OPTS))
          if content
            if layout_method = _layout_method
              return send(layout_method, OPTS){content}
            end
            if layout_template = self.class.opts[:render][:optimize_layout]
              retrieve_template(:template=>layout_template, :cache_key=>nil, :template_method_cache_key => :_roda_layout)
              if layout_method = _layout_method
                return send(layout_method, OPTS){content}
              end
            end
          else
            opts = parse_template_opts(template, opts)
            content = opts[:content] || render_template(opts)
          end
          if layout_opts  = view_layout_opts(opts)
            content = render_template(layout_opts){content}
          end
          content
        end
def view ( template , opts = ( content = _optimized_view_content ( template ) ; OPTS ) ) if content if layout_method = _layout_method return send ( layout_method , OPTS ) { content } end if layout_template = self . class . opts [ :render ] [ :optimize_layout ] retrieve_template ( :template => layout_template , :cache_key => nil , :template_method_cache_key => :_roda_layout ) if layout_method = _layout_method return send ( layout_method , OPTS ) { content } end end else opts = parse_template_opts ( template , opts ) content = opts [ :content ] || render_template ( opts ) end if layout_opts = view_layout_opts ( opts ) content = render_template ( layout_opts ) { content } end content end
Render the given template.
Render the given template .
# First, check if the optimized layout method has already been created, # and use it if so.  This way avoids the extra conditional and local variable # assignments in the next section. # If we have an optimized template method but no optimized layout method, create the # optimized layout method if possible and use it.  If you can't create the optimized # layout method, fall through to the slower approach.
template
opts
content
_optimized_view_content