Home > Bug reports > Déclarer champ recherché sur nouvelle table

Bug report #324 - Déclarer champ recherché sur nouvelle table

Created on Thursday 9 February 2017 by JLuc

Assigned to:
This bug has been assigned to nobody.

La page http://programmer.spip.net/Prendre-en-compte-un-nouveau-champ
présente comment un plugin peut ajouter un champ recherché.

Il me semble qu’il y a une autre manière de déclarer les champs recherchés pour une nouvelle table :

prefixeplugin_declarer_tables_objets_sql<span class="br0">&#40;</span><span class="re0">$tables</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
<span class="sy0">...</span>
<span class="re0">$tables</span><span class="br0">&#91;</span><span class="st_h">'spip_nouvelobjet'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a> <span class="br0">&#40;</span>
<span class="sy0">...</span>
<span class="st_h">'rechercher_champs'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
                        <span class="st0">&quot;id_nouvelobjet&quot;</span> <span class="sy0">=&gt;</span> <span class="nu0">15</span><span class="sy0">,</span>
                        <span class="st0">&quot;titre&quot;</span> <span class="sy0">=&gt;</span> <span class="nu0">10</span><span class="sy0">,</span>
                        <span class="st0">&quot;texte&quot;</span> <span class="sy0">=&gt;</span> <span class="nu0">8</span> <span class="sy0">...</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="sy0">...</span><span class="br0">&#125;</span>

No comment

Bug report or comment only available for registered users.

Log in.