Giter Club home page Giter Club logo

butler's Introduction

You can find the design decisions relating to this module at
http://groups.drupal.org/butler.

The butler module intends to provide a unified context for Drupal, through a
single context object.

The context object can be retrieved by calling butler_context(), but it is
preferable to be passed a context object, or pass others the context object.

To get a piece of contextual information, simply call ->get() on the context
object with the "selector". The selector is a multi-layer selector pointing to
the specific contextual item. For example, `http:get:q` will fetch the
parameter `q` from the query string, and `node` will fetch the current node.

Additional context may be declared in two ways: statically or dynamically.
To declare the context statically, one may implement hook_butler(), returning
a simple mapping of `selector` => `class name`. The selector may be any number
of levels deep. To add to / change the context dynamically, you can call
`->set()` on the context object. The first parameter is the selector, which
can be any number of levels deep (you can, for example, override just
`http:get:q`, or all of `http`). The second parameter can either be an object,
in which case the ->get method is called to retrieve the context, or a static
data type (string, int, float, array), in which case the selector is directly
mapped to that value.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.