recuperer_fond

The "recuperer_fond" pipeline is used to add to or modify the compilation results of a given template file. As input, it accepts the name of the selected "fond", or model template, and the compilation context within the args table, as well as the table describing the results in the data table.

$page = pipeline('recuperer_fond', array(
    'args'=>array(
        'fond'=>$fond,
        'contexte'=>$contexte,
        'options'=>$options,
        'connect'=>$connect),
    'data'=>$page));

Very often, only the texte key in the data table will be modified. Please refer to the recuperer_fond() article for a full description of this table.

Example

The "fblogin" plugin is used to identify visitors with their Facebook credentials. It adds a button to SPIP’s normal identification form. The "social_login_links" pipeline (in the same plugin) returns the HTML code for a link pointing to the Facebook identification page.

function fblogin_recuperer_fond($flux){
    if ($flux['args']['fond'] == 'formulaires/login'){
        $login = pipeline('social_login_links', '');
        $flux['data']['texte'] = str_replace('</form>', '</form>' . $login, $flux['data']['texte']);
    }
    return $flux;
}

Author Mark Baber Published : Updated : 29/05/10

Translations : English, français