\AlphredScriptFilter

Creates Script Filter XML for Alfred

Example usage:

$script_filter = new Alphred\ScriptFilter( ['error_on_empty'] => true );
$script_filter->add_result( new Alphred\Result([
    'title' => 'This is a title',
 'subtitle' => 'This is a subtitle',
 'valid' => false
]));
$script_filter->to_xml();

Summary

Methods
Properties
Constants
__construct()
add_result()
get_results()
print_results()
to_xml()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
initializei18n()
translate()
write_item()
No private properties found
N/A

Methods

__construct()

__construct(array  $options = array()) 

Constructs a script filter container

Parameters

array $options

specify options:... see>>>?

add_result()

add_result(\Alphred\Result  $result) 

Adds a result into the script filter

Parameters

\Alphred\Result $result

an Alphred\Result object

get_results()

get_results() : array

Returns an array of the results

Returns

array —

an array of the current result items

print_results()

print_results() 

Alias of to_xml()

to_xml()

to_xml() 

Outputs the script filter in Alfred XML

initializei18n()

initializei18n() 

Initializes a i18n Alphred object to use internally

translate()

translate(string  $string) : string

Translates a string using the i18n class

Parameters

string $string

a string to translate

Returns

string —

the string, translated if possible

write_item()

write_item(object  $item) 

Writes out the Alfred XML

Parameters

object $item

An \Alphred\Result object