Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the file-include implementation #63

Open
victorjonsson opened this issue Oct 31, 2014 · 0 comments
Open

Change the file-include implementation #63

victorjonsson opened this issue Oct 31, 2014 · 0 comments
Milestone

Comments

@victorjonsson
Copy link
Owner

Current implementation:
https://github.com/victorjonsson/Arlima/wiki/File-includes

Suggested API:

arlima_article_function( $arr=array() )

  • label — Required
  • description — Optional
  • file — Optional, will be included if declared
  • callback — Optional. Anonymous function, or any other type of callable, that can be used instead of a file,
  • slug — Required if using an anonymous function instead of a file.
  • args — Optional array with arguments that should be possible to edit using the article form
    Examples:
// Using a file as callback
arlima_article_function(array(
  'label' => 'Label for this function',
  'description' => 'Description of this function',
  'file' => 'path/to/some/file.php',
  'args' => array(
    'arg1' => 'default value',
    'arg2' => 'other default value'
  )
));

// Using an anonymous function as callback
arlima_article_function(array(
  'label' => 'Label...',
  'slug' => 'some-function-slug'
  'callback' => function($args, $article, $list) {
    return 'the content...';
  },
  'args' => array(
    'arg1' => 'default value',
    'arg2' => 'other default value'
  )
));

Maybe there's some better name than article_function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant