diff --git a/README.md b/README.md index 8fb932c4..5c6d82a5 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,7 @@ # Crud View -Automated admin backend based on your Crud configuration. - -This project is in early stage of development, do not use it production unless you want to get down and dirty on the code :) +Automated admin backend based on your [Crud](https://github.com/friendsofcake/crud) configuration. # Installation @@ -20,58 +18,20 @@ composer require friendsofcake/crud-vew:dev-master ## Documentation -You can find the WIP detailed usage documentation [here](http://crud-view.readthedocs.org/en/latest/). - -### Quick Start - -1) Install the plugin using `composer require --prefer-dist friendsofcake/crud-view:dev-master`. - -2) Add ``Plugin::load('Crud');``, ``Plugin::load('CrudView');`` & ``Plugin::load('BootstrapUI');`` to your ``app/config/bootstrap.php`` - -3) Configure [Crud](http://crud.readthedocs.org/en/latest/quick-start.html) as per your needs. +You can find detailed usage documentation [here](http://crud-view.readthedocs.org/en/latest/). -4) Change ``AppController::$viewClass`` to ``CrudView\View\CrudView`` +# Bugs -5) Load the ``CrudView.View``, ``Crud.RelatedModels`` and ``Crud.Redirect`` listeners. +If you happen to stumble upon a bug, please feel free to create a pull request with a fix +(optionally with a test), and a description of the bug and how it was resolved. -6) Hopefully going to ``/loadComponent('RequestHandler'); - $this->loadComponent('Flash'); - - $this->viewClass = 'CrudView\View\CrudView'; - $this->loadComponent('Crud.Crud', [ - 'actions' => [ - 'Crud.Index', - 'Crud.Add', - 'Crud.Edit', - 'Crud.View', - 'Crud.Delete', - ], - 'listeners' => [ - 'CrudView.View', - 'Crud.RelatedModels', - 'Crud.Redirect', - ], - ]); - } -} -``` +You can join us on IRC in the #FriendsOfCake freenode channel for any support or questions. diff --git a/docs/contents.rst b/docs/contents.rst index 0cc860d0..47739ca8 100644 --- a/docs/contents.rst +++ b/docs/contents.rst @@ -6,5 +6,6 @@ Contents index installation + quick-start basic-usage customizing-templates diff --git a/docs/installation.rst b/docs/installation.rst index d9ff6c52..e34ca2f6 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -36,68 +36,3 @@ Execute the following lines from your application folder: bin/cake plugin load CrudView bin/cake plugin load BootstrapUI bin/cake plugin load Search - -Configuring the AppController ------------------------------ - -I you haven't configured the CRUD plugin already add the following line to your -``src/Controller/AppController.php`` file - -.. code-block:: php - - viewClass = 'CrudView\View\CrudView'; - $this->loadComponent('Crud.Crud', [ - 'actions' => [ - 'Crud.Index', - 'Crud.View', - 'Crud.Add', - 'Crud.Edit', - 'Crud.Delete', - 'Crud.Lookup', - ], - 'listeners' => [ - 'CrudView.View', - 'Crud.Redirect', - 'Crud.RelatedModels', - 'CrudView.Search', - ] - ]); - } - } - -If you are familair with the CRUD plugin already, you will immediately understand -that Crud view is simply a listener for the events generated by the plugin. If -this is new to you, don't worry, it will be explained in the following sections. - -Using It In Your Controllers ----------------------------- - -Any controller inheriting from ``AppController`` will automatically implement -the specified actions loaded int the ``CRUD`` component configuration. -Therefore, you can just leave your controller code empty! - -.. code-block:: php - - `, you are ready to CRUD-ify your app. + +App Controller +~~~~~~~~~~~~~~ + +First, configure the `Crud `_ plugin. + +Configuring the AppController +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you haven't configured the CRUD plugin already, add the following lines to your +``src/Controller/AppController.php`` file + +.. code-block:: php + + loadComponent('RequestHandler'); + $this->loadComponent('Flash'); + + $this->viewClass = 'CrudView\View\CrudView'; + $this->loadComponent('Crud.Crud', [ + 'actions' => [ + 'Crud.Index', + 'Crud.View', + 'Crud.Add', + 'Crud.Edit', + 'Crud.Delete', + 'Crud.Lookup', + ], + 'listeners' => [ + // New listeners that need to be added: + 'CrudView.View', + 'Crud.Redirect', + 'Crud.RelatedModels', + 'CrudView.Search', + ] + ]); + } + } + +If you are familair with the CRUD plugin already, you will immediately understand +that Crud view is simply a listener for the events generated by the plugin. If +this is new to you, don't worry, it will be explained in the following sections. + +Using It In Your Controllers +---------------------------- + +Any controller inheriting from ``AppController`` will automatically implement +the specified actions loaded int the ``CRUD`` component configuration. +Therefore, you can just leave your controller code empty! + +.. code-block:: php + +