Register preprocess with views.

@param  array|string $views
@param  \Closure     $callback

@return $this
489495
public function composer( $views, $callback ) {
		foreach ( (array) $views as $view ) {
			if ( $callback instanceof Closure === false ) {
				$callback = function () use ( $callback ) {
					return $callback;
				};
			}

			if ( $view === '*' ) {
				$this->composers['*'][] = $callback;
				continue;
			}

			$view = $this->view( $view );

			if ( ! isset( $this->composers[$view] ) ) {
				$this->composers[$view] = [];
			}

			$this->composers[$view][] = $callback;
		}

		return $this;
	}
308003
protected function resolvingCallback(Closure $callback)
    {
        $abstract = $this->getFunctionHint($callback);

        if ($abstract) {
            $this->resolvingCallbacks[$abstract][] = $callback;
        } else {
            $this->globalResolvingCallbacks[] = $callback;
        }
    }
1245062
function registerView(view) {
  var name = view.getDebugName();
  var wrapped = new RegistryWrapper(view, 'views');
  flatRegistry.views[name] = wrapped;
  if (!view.parentView && !view.isComponentView) {
    nestedRegistry.views[name] = wrapped;
  }
  if (typeof view.destroy === 'function') {
    wrapped.destroy = _.bind(view.destroy, view);
    view.destroy = _.bind(function() {
      var name = this.obj.getDebugName();
      delete nestedRegistry.views[name];
      delete flatRegistry.views[name];
      updateNestedModels();
      triggerChange();
      this.destroy();
    }, wrapped);
  }
  updateNestedModels();
  triggerChange();
}
610430
public function loop($data, Closure $callback)
    {
        TypeChecker::isIterable($data);

        foreach ($data as $key => $value) {
            $builder = new static();
            $callback($builder, $value, $key);
            $this->addNotification($builder->getNotification());
        }

        return $this;
    }
141471
public function findCallback(Closure $callback, $columns = ['*'])
    {
        return $this->postProcess( parent::findCallback($callback, $columns) );
    }
967090
public function resourceFilterByFn(\Closure $callback)
    {
        $this->filterJSFiles($callback);
        $this->filterJSInline($callback);
        $this->filterCSSFiles($callback);
        $this->filterCSSInline($callback);
    }
1282314
public function setConstraint(Closure $callback)
    {
        $this->data            = [];
        $this->loaded          = false;
        $this->queryConstraint = $callback;

        return $this;
    }
422861
public function setEditableCallback($callback)
    {
        $this->isEditable() ?: $this->setEditable();
        $this->editableCallback = $callback;

        return $this;
    }
299750
public function maybe(Closure $callback) {
        $predicate = new Predicate(self::MAYBE);
        $predicate->bindCallback($callback);

        $this->_params[] = $predicate;

        $this->addBinding(null, $predicate);

        return $this;
    }
182464
public function send($view, array $data, Closure $callback, $message = null)
    {
        $this->message = $message ?: new Message($this->mailgun->MessageBuilder(), $this->config);

        $this->callMessageBuilder($callback, $this->message);
        $this->renderBody($view, $data);

        $message = $this->message->getMessage();
        $files = $this->message->getFiles();

        $domain = $this->config->get('mailgun.domain');
        $response = new Response($this->mailgun->post("{$domain}/messages", $message, $files));

        return $response;
    }
407730
protected function registerCallbacks()
    {
        if (!empty($this->callbacks)) {
            $selector = $this->getSelector();
            $view = $this->getView();
            foreach ($this->callbacks as $event => $callback) {
                if (is_array($callback)) {
                    foreach ($callback as $function) {
                        if (!$function instanceof JsExpression) {
                            $function = new JsExpression($function);
                        }
                        $view->registerJs("jQuery('#$selector').on('$event', $function);");
                    }
                } else {
                    if (!$callback instanceof JsExpression) {
                        $callback = new JsExpression($callback);
                    }
                    $view->registerJs("jQuery('#$selector').on('$event', $callback);");
                }
            }
        }
    }
984000
public function beforeSending(Closure $callback): self
    {
        return tap($this, function () use ($callback) {
            $this->beforeSendingCallbacks[] = $callback;
        });
    }
1298197
public function attachment(Closure $callback)
    {
        $this->attachments[] = $attachment = new SlackAttachment;

        $callback($attachment);

        return $this;
    }
1106429
public static function prepare($view, $data, $closure)
    {
        $mailer = new self();

        $closure($mailer);

        $mailer->view($view, $data);
        $mailer->transport();
    }
1275080
public function render(Closure $callback = null) {
        $contents = $this->renderContents();

        $response = isset($callback) ? $callback($this, $contents) : null;

        // Once we have the contents of the view, we will flush the sections if we are
        // done rendering all views so that there is nothing left hanging over when
        // another view is rendered in the future by the application developers.
        $this->factory->flushSectionsIfDoneRendering();

        return $response ?: $contents;
    }
1362228
public function either(Closure $callback) {
        $predicate = new Predicate(self::EITHER);
        $predicate->bindCallback($callback);

        $this->_params[] = $predicate;

        $this->addBinding(null, $predicate);

        return $this;
    }
821565
final public function setView(View $view) {
        $this->view = $view;
        if (!$this->initializedView) {
            $this->initializedView = true;
            $this->init();
        }
        return $this;
    }