Pipelines used for loading

formulaire_charger

This pipeline makes it possible to modify the table of values returned by the charger function for a form. It is more fully described in the chapter about pipelines: formulaire_charger

paramètre _pipeline

This parameter makes it possible to modify the HTML code published by making it pass through a specific pipeline. This data, sent in the loading table, makes it possible to specify the name of a pipeline and the arguments to be passed to it. It will be called at the time the form text is displayed.

Example

SPIP uses the parameter in a generic fashion by making all publication forms that call the formulaires_editer_objet_charger() function pass through a pipeline named editer_contenu_objet. This pipeline is described in its own special article: editer_contenu_objet.

$contexte['_pipeline'] = array('editer_contenu_objet', array('type'=>$type, 'id'=>$id));

The CFG plugin uses this parameter to make all the CFG forms written as CVT forms pass through the editer_contenu_formulaire_cfg pipeline.

$valeurs['_pipeline'] = array('editer_contenu_formulaire_cfg',
	'args'=>array(
		'nom'=>$form,
		'contexte'=>$valeurs,
		'ajouter'=>$config->param['inline'])
);

The pipeline that CFG then uses to collect the contents not necessary in the transmitted HTML:

// pipeline for the display of content
// to delete the CFG parameters from the form
function cfg_editer_contenu_formulaire_cfg($flux){
	$flux['data'] = preg_replace('/(<!-- ([a-z0-9_]\w+)(\*)?=)(.*?)-->/sim', '', $flux['data']);
	$flux['data'] .= $flux['args']['ajouter'];
	return $flux;
}

Author Mark Baber Published : Updated : 12/03/23

Translations : English, français