Hello Simon,

here is an example:

$searchStr = "{{#ask: <your search>=|mainlabel=-|format=list}}";
// maybe you have to add param "sep" here if comma is not good for you
// http://semantic-mediawiki.org/wiki/Help:List_format

$searchResult = 
$parser->mStripState->unstripBoth($parser->recursiveTagParse( 
$searchStr, $frame ),$parser->mStripState);
// if you don't use template parameter in the ask, you don't need "$frame".

$searchResult = str_replace ( ', ' , ',' , $searchResult );
$valArray = explode( ',' , $searchResult );

This is a working example from one of my extensions.
If you don't get your's running, pls send me the source part...

Greetings
Frank

On 26.10.2015 08:20, Fannon wrote:
> Hello Frank,
>
> I couldn't get this working - could you please provide some more context?
>
> This solution is nicer, because it's not so much code to write - but it also
> contains all those parsing, un-parsing boilerplate steps.
>
>
>
> --
> View this message in context: 
> http://wikimedia.7.x6.nabble.com/Obtain-data-as-simple-array-tp4994985p5054239.html
> Sent from the Semantic Mediawiki - Development mailing list archive at 
> Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Semediawiki-devel mailing list
> Semediawiki-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>


------------------------------------------------------------------------------
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to