def on_page_layout(page_layouts, callback = nil, &block)
      callback = block || callback
      [page_layouts].flatten.each do |page_layout|
        if callback
          OnPageLayout.register_callback(page_layout, callback)
        else
          raise ArgumentError,
            "You need to either pass a block or method name as a callback for `on_page_layout`"
        end
      end
    end
def on_page_layout(page_layouts, callback = nil, &block)
      callback = block || callback
      [page_layouts].flatten.each do |page_layout|
        if callback
          OnPageLayout.register_callback(page_layout, callback)
        else
          raise ArgumentError,
            "You need to either pass a block or method name as a callback for `on_page_layout`"
        end
      end
    end
Define a page layout callback

 Pass a block or method name in which you have the +@page+ object available and can do
 everything as if you were in a normal controller action.

 Pass a +Alchemy::PageLayout+ name, an array of names, or +:all+ to
 evaluate the callback on either some specific or all the pages.