public function render( $print = true )
	{
		if( $this->args['render'] === false )return;

		$field = $this->getField();

		$class  = 'glsr-field';
		$class .= $this->args['errors'] ? ' glsr-has-error' : '';

		$renderedString = '%s';

		if( ( isset( $field->args['required'] ) && $field->args['required'] )
			|| ( isset( $field->args['attributes']['required'] ) || in_array( 'required', $field->args['attributes'] )) ) {
			$class .= ' glsr-required';
		}

		if( $field->args['type'] !== 'hidden' ) {
			$renderedString = sprintf( '<div class="%s">%%s</div>', $class );
		}

		$rendered = sprintf( $renderedString,
			$this->args['before'] .
			$field->generateLabel() .
			$field->render() .
			$this->args['after'] .
			$this->args['errors']
		);

		$rendered = apply_filters( 'castor/rendered/field', $rendered, $field->args['type'] );

		if( !!$print && $print !== 'return' ) {
			echo $rendered;
		}

		return $rendered;
	}
public function render( $print = true )
	{
		if( $this->args['render'] === false )return;

		$field = $this->getField();

		$class  = 'glsr-field';
		$class .= $this->args['errors'] ? ' glsr-has-error' : '';

		$renderedString = '%s';

		if( ( isset( $field->args['required'] ) && $field->args['required'] )
			|| ( isset( $field->args['attributes']['required'] ) || in_array( 'required', $field->args['attributes'] )) ) {
			$class .= ' glsr-required';
		}

		if( $field->args['type'] !== 'hidden' ) {
			$renderedString = sprintf( '<div class="%s">%%s</div>', $class );
		}

		$rendered = sprintf( $renderedString,
			$this->args['before'] .
			$field->generateLabel() .
			$field->render() .
			$this->args['after'] .
			$this->args['errors']
		);

		$rendered = apply_filters( 'castor/rendered/field', $rendered, $field->args['type'] );

		if( !!$print && $print !== 'return' ) {
			echo $rendered;
		}

		return $rendered;
	}
public function render ( $ print = true ) { if ( $ this -> args [ 'render' ] === false ) return ; $ field = $ this -> getField ( ) ; $ class = 'glsr-field' ; $ class .= $ this -> args [ 'errors' ] ? ' glsr-has-error' : '' ; $ renderedString = '%s' ; if ( ( isset ( $ field -> args [ 'required' ] ) && $ field -> args [ 'required' ] ) || ( isset ( $ field -> args [ 'attributes' ] [ 'required' ] ) || in_array ( 'required' , $ field -> args [ 'attributes' ] ) ) ) { $ class .= ' glsr-required' ; } if ( $ field -> args [ 'type' ] !== 'hidden' ) { $ renderedString = sprintf ( '<div class="%s">%%s</div>' , $ class ) ; } $ rendered = sprintf ( $ renderedString , $ this -> args [ 'before' ] . $ field -> generateLabel ( ) . $ field -> render ( ) . $ this -> args [ 'after' ] . $ this -> args [ 'errors' ] ) ; $ rendered = apply_filters ( 'castor/rendered/field' , $ rendered , $ field -> args [ 'type' ] ) ; if ( ! ! $ print && $ print !== 'return' ) { echo $ rendered ; } return $ rendered ; }
Render the field

@param mixed $print

@return string|void
Render the field