Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ad3n committed Mar 18, 2015
1 parent b4018a5 commit a33c408
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Controller/CrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Ihsan\SimpleAdminBundle\Event\PostFlushCrudEvent;
use Ihsan\SimpleAdminBundle\Event\PrePersistCrudEvent;
use Ihsan\SimpleAdminBundle\IhsanSimpleCrudEvents as Event;
use Ihsan\SimpleAdminBundle\IhsanSimpleAdminEvents as Event;

abstract class CrudController extends Controller
{
Expand Down
6 changes: 1 addition & 5 deletions IhsanSimpleAdminEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
* Author: Muhammad Surya Ihsanuddin<[email protected]>
* Url: https://blog.khodam.org
*/
class IhsanSimpleCrudEvents
class IhsanSimpleAdminEvents
{
const PRE_PERSIST_EVENT = 'ihsan.simple_admin.pre_persist_event';

const POST_FLUSH_EVENT = 'ihsan.simple_admin.post_flush_event';

const PRE_SHOW_RENDER_EVENT = 'ihsan.simple_admin.pre_show_event';

const PRE_LIST_RENDER_EVENT = 'ihsan.simple_admin.pre_list_event';
}
81 changes: 74 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ use Ihsan\SimpleAdminBundle\Annotation\Crud;
* @Route("/user")
* @Crud(entityClass="AppBundle\Entity\ProductCategory", formClass="AppBundle\Form\ProductCategoryType")
*/
class UserController extends CrudController
class ProductCategoryController extends CrudController
{
}
~~~~~
Expand All @@ -288,16 +288,12 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

use Ihsan\SimpleAdminBundle\Annotation\PageTitle;
use Ihsan\SimpleAdminBundle\Annotation\PageDescription;
use Ihsan\SimpleAdminBundle\Annotation\GridFields;
use Ihsan\SimpleAdminBundle\Annotation\ShowFields;

/**
* @Route("/user")
*
* @PageTitle("user.page_title")
* @PageDescription("user.page_description")
* @GridFields({"username", "fullName", "email", "roles"})
* @ShowFields({"username", "fullName", "email", "roles"})
*/
class UserController extends CrudController
{
Expand All @@ -311,11 +307,56 @@ You can also use ``@Crud`` global annotation with key ``pageTitle`` and ``pageDe
Same as page title and page description but using ``@GridFields`` and ``gridFields`` on ``@Crud`` global annotation
The value of parameter must be an array

####Customize Form Fields####
~~~~~ php
<?php
namespace Ihsan\SimpleAdminBundle\Controller;

Same as page title and page description but using ``@FormFields`` and ``formFields`` on ``@Crud`` global annotation
/**
* Author: Muhammad Surya Ihsanuddin<surya[email protected]>
* Url: https://blog.khodam.org
*/

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Ihsan\SimpleAdminBundle\Annotation\GridFields;

/**
* @Route("/user")
* @GridFields({"username", "fullName", "email", "roles"})
*/
class UserController extends CrudController
{
}
~~~~~

####Customize Show Fields####

Same as page title and page description but using ``@ShowFields`` and ``showFields`` on ``@Crud`` global annotation
The value of parameter must be an array

~~~~~ php
<?php
namespace Ihsan\SimpleAdminBundle\Controller;

/**
* Author: Muhammad Surya Ihsanuddin<surya[email protected]>
* Url: https://blog.khodam.org
*/

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

use Ihsan\SimpleAdminBundle\Annotation\ShowFields;

/**
* @Route("/user")
* @ShowFields({"username", "fullName", "email", "roles"})
*/
class UserController extends CrudController
{
}
~~~~~

####Customize Action Template####

Use ``@NewActionTemplate`` with template path as parameter for override new template or use ``newActionTemplate`` on ``@Crud`` global annotation
Expand All @@ -329,10 +370,36 @@ Use ``@NormalizeFilter`` without parameter

####Event Listener#####

This bundle have 2 event ``ihsan.simple_admin.pre_persist_event`` and ``ihsan.simple_admin.post_flush_event``. Just create an event listener to listen that events.

####Configuration Reference####

~~~~~ yml
ihsan_simple_admin:
app_title: 'IhsanSimpleAdmin'
per_page: 10
identifier: 'id'
date_time_format: 'd-m-Y' #php date time format
menu: 'main'
filter: 'name'
translation_domain: 'IhsanSimpleAdminBundle'
security:
user:
form_class: user_form
entity_class: AppBundle\Entity\User
grid_action: #not work for this time
show: true
edit: true
delete: true
themes:
dashboard: 'IhsanSimpleAdminBundle:Index:index.html.twig'
form_theme: 'IhsanSimpleAdminBundle:Form:fields.html.twig'
pagination: 'IhsanSimpleAdminBundle:Layout:pagination.html.twig'
~~~~~

####TODO####
- Improvement translation
- Grid Action (urgent)
- Add more features

####Resources We Use####
Expand Down

0 comments on commit a33c408

Please sign in to comment.