From cdd5e5d294aaf889bdaadf79f98642998356d753 Mon Sep 17 00:00:00 2001 From: crynobone Date: Tue, 10 Dec 2013 09:00:16 +0800 Subject: [PATCH] Update docs Signed-off-by: crynobone --- docs/changes.md | 1 + docs/manager.md | 73 ------------------------------------------------ docs/messages.md | 47 ------------------------------- docs/readme.md | 29 ------------------- docs/str.md | 27 ------------------ 5 files changed, 1 insertion(+), 176 deletions(-) delete mode 100644 docs/manager.md delete mode 100644 docs/messages.md delete mode 100644 docs/readme.md delete mode 100644 docs/str.md diff --git a/docs/changes.md b/docs/changes.md index 8c2fa29..f60ac16 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -1,5 +1,6 @@ --- title: Support Change Log + --- ## Version 2.0 {#v2-0} diff --git a/docs/manager.md b/docs/manager.md deleted file mode 100644 index 2c153bc..0000000 --- a/docs/manager.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Using Manager ---- - -`Orchestra\Manager` is a small improvement to `Illuminate\Support\Manager`, which allow multi-ton driver based factory design pattern for your class. - -## Use Case - -While in most cases you would not need to use multi-instance of the same driver there are a few use case that require this functionality especially [Orchestra\Memory](/docs/2.0/components/memory) and [Orchestra\Widget](/docs/2.0/components/widget). - -### Example of Orchestra\Widget\WidgetManager - -With following `Orchestra\Widget\WidgetManager`, it's possible to have an instance of `Orchestra\Widget::make("menu.orchestra")` and `Orchestra\Widget::make("menu.app")` without a conflict. - - app, $name); - } - - /** - * Create Pane driver. - * - * @param string $name - * @return \Orchestra\Widget\Drivers\Pane - */ - protected function createPaneDriver($name) - { - return new Drivers\Pane($this->app, $name); - } - - /** - * Create Placeholder driver. - * - * @param string $name - * @return \Orchestra\Widget\Drivers\Placeholder - */ - protected function createPlaceholderDriver($name) - { - return new Drivers\Placeholder($this->app, $name); - } - - /** - * Create default driver. - * - * @param string $name - * @return string - */ - protected function getDefaultDriver() - { - return 'placeholder.default'; - } - } diff --git a/docs/messages.md b/docs/messages.md deleted file mode 100644 index 5bb9e1c..0000000 --- a/docs/messages.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Using Messages ---- - -`Orchestra\Messages` utilize `Illuminate\Support\MessageBag` to bring notification support through-out Orchestra Platform (and Laravel 4). - -* [Adding a Message](#add-message) -* [Extending a Message to Current Response](#extend-for-current-request) -* [Displaying the Message in a View](#displaying-message) - -## Adding a Message {#add-message} - -Adding a message is as easy as following: - - Orchestra\Messages::add('success', 'A successful message'); - -You can also chain messages: - - Orchestra\Messages::add('success', 'A successful message') - ->add('error', 'Some error'); - -## Extending a Message to Current Response {#extend-for-current-request} - -There might be situation where you need to extend a message to the current response instead of the following request. You can do this with: - - Orchestra\Messages::extend(function ($message) { - $message->add('info', 'Read-only mode'); - }); - -## Displaying the Message in a View {#displaying-message} - -Here's an example how you can display the message: - -has($key)) { - $message->setFormat( - '
:message
' - ); - echo implode('', $message->get($key)); - } - } - } diff --git a/docs/readme.md b/docs/readme.md deleted file mode 100644 index 6f03e5a..0000000 --- a/docs/readme.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Support Component ---- - -* [Installation](#installation) -* [Configuration](#configuration) - -`Orchestra\Support` is basically a basic set of class required by Orchestra Platform. The idea behind it is similar to what is `Illuminate\Support` to Laravel 4 Framework. - -## Installation {#installation} - -To install through composer, simply put the following in your `composer.json` file: - - { - "require": { - "orchestra/support": "2.0.*" - } - } - -## Configuration {#configuration} - -Next add the service provider in `app/config/app.php`. - - 'providers' => array( - - // ... - - 'Orchestra\Support\MessagesServiceProvider', - ), diff --git a/docs/str.md b/docs/str.md deleted file mode 100644 index 1c4499d..0000000 --- a/docs/str.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: String Helper Class ---- - -`Orchestra\Support\Str` is probably one of the few internal API class that you might use directly. It extends `Illuminate\Support\Str` and offer some improvement. - -* [Title](#str-title) -* [Stream Get Contents](#stream-get-contents) - -## Title {#str-title} - -Allow a string to be transformed to a proper title. - - use Orchestra\Support\Str; - - return Str::title('hello-world'); // would return "Hello World" - -## Stream Get Contents {#stream-get-contents} - -Unliked other database driver, when using blob with PostgreSQL, the return value from database is a stream instead of string, using above helper method help convert it properly back to string. - - use Orchestra\Support\Str; - - $str = Str::streamGetContents($blob); - - -> The method would return original string when it detect that it isn't a stream.