src/class-factory.php
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;
	}
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;
	}
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 ; }
Register preprocess with views.

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

@return $this
Register preprocess with views .