Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

> > > > Contextual pipelines

Contextual pipelines

It is often necessary to pass contextual arguments to the pipeline on top of the data returned by the pipeline. This is possible by using a table with at least 2 keys, named "args" and "data".

When the last function of the pipeline chain is called, only the value of data is returned.

  1. $data = pipeline('nouveau_pipe',array(
  2. 'args'=>array(
  3. 'id_article'=>$id_article
  4. ),
  5. 'data'=>"contenu au demarrage"
  6. ));

Download

  1. [(#PIPELINE{nouveau_pipe,
  2. [(#ARRAY{
  3. args,[(#ARRAY{id_article,#ID_ARTICLE})],
  4. data,contenu au demarrage
  5. })]})]

Download