This is the most common way you will want to partially apply a view into a layout.
424785
function($root, $el, rentManager, manager) {
    var $filtered;

    // If selector is specified, attempt to find it.
    if (manager.selector) {
      if (rentManager.noel) {
        $filtered = $root.filter(manager.selector);
        $root = $filtered.length ? $filtered : $root.find(manager.selector);
      } else {
        $root = $root.find(manager.selector);
      }
    }

    // Use the insert method if the parent's `insert` argument is true.
    if (rentManager.insert) {
      this.insert($root, $el);
    } else {
      this.html($root, $el);
    }
  }
313379
protected function composeViews()
    {
        // user menu in app
        View::composer('app', function ($view) {
            $view->getFactory()->inject('account', view('user::menu', ['guest' => Auth::guest(), 'user' => Auth::user()]));
        });

        View::composer('admin', function ($view) {
            // user menu in admin menu
            $view->getFactory()->inject('account', view('user::admin.partials.account', ['user' => Auth::user()]));

            // user panel in admin sidebar
            $view->getFactory()->inject('userpanel', view('user::admin.partials.userpanel', ['user' => Auth::user()]));
        });
    }
414871
protected function setupLayout()
    {
        if ( ! is_null($this->layout))
        {
            $this->layout = View::make($this->layout);
        }
    }
758668
public boolean applyLayout(Layout layout) {
        boolean applied = false;
        if (layout != null && isValidLayout(layout)) {
            Layout defaultLayout  = getDefaultLayout();
            if (layout != defaultLayout) {
                mLayouts.remove(defaultLayout);
            }
            if(mLayouts.add(layout)) {
                layout.onLayoutApplied(this, mViewPort);
                applied = true;
            }
        }
        return applied;
    }
140502
function UMLCompartmentView() {
        NodeView.apply(this, arguments);
        this.selectable = Core.SK_PROPAGATE;
        this.parentStyle = true;

        /* temporal */
        this._leftPadding   = COMPARTMENT_LEFT_PADDING;
        this._rightPadding  = COMPARTMENT_RIGHT_PADDING;
        this._topPadding    = COMPARTMENT_TOP_PADDING;
        this._bottomPadding = COMPARTMENT_BOTTOM_PADDING;
        this._itemInterval  = COMPARTMENT_ITEM_INTERVAL;
    }
624716
function (nodes, options) {
    // If there is just one node to expand we need to animate for fisheye view, but if there are more then one node we do not
    if (nodes.length === 1) {
      
      var node = nodes[0];
      if (node._private.data.collapsedChildren != null) {
        // Expand the given node the third parameter indicates that the node is simple which ensures that fisheye parameter will be considered
        this.expandNode(node, options.fisheye, true, options.animate, options.layoutBy);
      }
    } 
    else {
      // First expand given nodes and then perform layout according to the layoutBy parameter
      this.simpleExpandGivenNodes(nodes, options.fisheye);
      this.endOperation(options.layoutBy);
    }

    /*
     * return the nodes to undo the operation
     */
    return nodes;
  }
868165
protected function _finish()
		{

			// Check layout path
			$layoutPath = !is_null($this->request->route->module) ? $this->request->route->module->path . '/Layouts' : LAYOUT_PATH;

			// Layout set?
			if (!isset($this->_layout)) {

				// Layout in controller?
				if (!is_null(static::$layout)) {

					// Use that.
					$this->_layout = $layoutPath . '/' . static::$layout;

				} elseif (!is_null($this->request->route->module) && !is_null($this->request->route->module->defaultLayout)) {

					// Use that with module info
					$this->_layout = $layoutPath . '/' . $this->request->route->module->defaultLayout;
					

				} else {

					// Use app's default.
					$this->_layout = LAYOUT_PATH . '/' . Application::getConfiguration()->defaultLayout;

				}

			}

			// No layout?
			if ($this->_layout === false) {

				// Just output the content then.
				if (array_key_exists('main', $this->_renderedContent)) {
					echo $this->_renderedContent['main'];
				}

			} else {

				// Guess the extension
				$layoutFile = $this->_guessExtension($this->_layout);
				
				// Not found?
				if ($layoutFile === false) {
					throw new \Exception("Couldn't find layout for " . $this->_layout, 1);					
				}
				$this->_layout = $layoutFile;

				// Create and render the layout
				$layout = new Layout($this->_layout, $this, $this->_renderedContent);

			}


		}
70774
def fix(self):
        
        # Do up to 2 passes in case we have a variable height Layout.
        fill_layout = None
        fill_height = y = 0
        for _ in range(2):
            # Pick starting point/height - varies for borders.
            if self._has_border:
                x = y = start_y = 1
                height = self._canvas.height - 2
                width = self._canvas.width - 2
            else:
                x = y = start_y = 0
                height = self._canvas.height
                width = self._canvas.width

            # Process each Layout in the Frame - getting required height for
            # each.
            for layout in self._layouts:
                if layout.fill_frame:
                    if fill_layout is None:
                        # First pass - remember it for now.
                        fill_layout = layout
                    elif fill_layout == layout:
                        # Second pass - pass in max height
                        y = layout.fix(x, y, width, fill_height)
                    else:
                        # A second filler - this is a bug in the application.
                        raise Highlander("Too many Layouts filling Frame")
                else:
                    y = layout.fix(x, y, width, height)

            # If we hit a variable height Layout - figure out the available
            # space and reset everything to the new values.
            if fill_layout is None:
                break
            else:
                fill_height = max(1, start_y + height - y)

        # Remember the resulting height of the underlying Layouts.
        self._max_height = y

        # Reset text
        while self._focus < len(self._layouts):
            try:
                self._layouts[self._focus].focus(force_first=True)
                break
            except IndexError:
                self._focus += 1
        self._clear()
1308159
private void initContentView(LayoutInflater inflater, View header, boolean fixedHeader, View footer,
                               boolean fixedFooter, BaseAdapter adapter, int[] padding, int[] margin) {
    View contentView = createView(inflater, header, fixedHeader, footer, fixedFooter, adapter);
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
        ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT
    );
    params.setMargins(margin[0], margin[1], margin[2], margin[3]);
    contentView.setLayoutParams(params);
    getHolderView().setPadding(padding[0], padding[1], padding[2], padding[3]);
    contentContainer.addView(contentView);
  }
446385
public void layoutParts() {
    StringBuilder styleClass = new StringBuilder("group");

    // if there are no rows yet, getRowCount returns -1, in this case the next row is 0
    int nextRow = PreferencesFxUtils.getRowCount(grid) + 1;

    // Only when the preferencesGroup has a title
    if (preferencesGroup.getTitle() != null) {
      grid.add(titleLabel, 0, nextRow++, 2, 1);
      styleClass.append("-title");
      titleLabel.getStyleClass().add("group-title");
    }

    List<Field> fields = preferencesGroup.getElements().stream()
        .map(Field.class::cast)
        .collect(Collectors.toList());
    styleClass.append("-setting");

    int rowAmount = nextRow;
    for (int i = 0; i < fields.size(); i++) {
      // add to GridPane
      Field field = fields.get(i);
      SimpleControl c = (SimpleControl) field.getRenderer();
      c.setField(field);
      grid.add(c.getFieldLabel(), 0, i + rowAmount, 1, 1);
      grid.add(c.getNode(), 1, i + rowAmount, 1, 1);

      // Styling
      GridPane.setHgrow(c.getNode(), Priority.SOMETIMES);
      GridPane.setValignment(c.getNode(), VPos.CENTER);
      GridPane.setValignment(c.getFieldLabel(), VPos.CENTER);

      // additional styling for the last setting
      if (i == fields.size() - 1) {
        styleClass.append("-last");
        GridPane.setMargin(
            c.getNode(),
            new Insets(0, 0, PreferencesFxFormRenderer.SPACING * 4, 0)
        );
        GridPane.setMargin(
            c.getFieldLabel(),
            new Insets(0, 0, PreferencesFxFormRenderer.SPACING * 4, 0)
        );
      }

      c.getFieldLabel().getStyleClass().add(styleClass.toString() + "-label");
      c.getNode().getStyleClass().add(styleClass.toString() + "-node");
    }
  }
764874
private void adaptWidth() {
        adapter.setWidth(width);

        if (rootView != null) {
            rootView.setWidth(width);
            rootView.requestLayout();
        }
    }
975279
public function partial($view)
    {
        $path = '../App/' . $this->viewsDir . $view . '.phtml';
        if (file_exists($path)) {
            require $path;

        } else {
            die('No partial view file ' . $view . ' present in view directory.');
        }
    }
14012
function(ch, w, coord, prop) {
     if(this.layout.horizontal()) {
       return this.layoutH(ch, w, coord, prop);
     } else {
       return this.layoutV(ch, w, coord, prop);
     }
    }
673345
private void inflateView() {
        parentView = createParentView();
        view = createView();
        view.setOnFocusChangeListener(createFocusChangeListener());
        view.setBackgroundResource(R.drawable.validateable_view_background);
        setLineColor(getAccentColor());

        if (parentView != null) {
            parentView.addView(view, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
            addView(parentView, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        } else {
            addView(view, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        }
    }
316908
private void inflateRootView() {
        ViewGroup contentView = findViewById(android.R.id.content);
        contentView.removeAllViews();
        LayoutInflater layoutInflater = LayoutInflater.from(getContext());
        rootView =
                (DraggableView) layoutInflater.inflate(R.layout.bottom_sheet, contentView, false);
        rootView.setCallback(this);
        contentView.addView(rootView, createRootViewLayoutParams());
    }
402921
public UI wrapLayout(Layout layout) {
        // TODO: add a header to switch the style, etc
        // TODO: add bookmark to set the style
        if (server.getConfig().isDevelopmentHeader()) {
            final VerticalSplitPanel mainLayout = new VerticalSplitPanel();
            mainLayout.setSizeFull();
            mainLayout.setSplitPosition(SPLIT_POSITION, Sizeable.Unit.PIXELS);
            mainLayout.setLocked(true);

            final DevApplicationHeader header = new DevApplicationHeader(server);
            header.setSpacing(true);
            mainLayout.setFirstComponent(header);

            mainLayout.setSecondComponent(layout);

            return new DevUI(mainLayout);
        } else {
            return new DevUI(layout);
        }
    }
90268
function handleLayout(layoutObj) {
      view.currentLayout = layoutObj.layout;
      self.handle('onLayout', view);
      delete view.currentLayout;
    }