Skip to content
Browse files

first version of documentation

  • Loading branch information...
1 parent 430feb7 commit 2d7e5f7920fe68563b4b31a49e3ab64bbe231524 @ghua committed Jul 11, 2012
View
4 Controller/DirectController.php
@@ -15,7 +15,9 @@
use Ext\DirectBundle\Router\Router;
use Ext\DirectBundle\Response\Basic;
-
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class DirectController extends Controller
{
View
1 DependencyInjection/ExtDirectExtension.php
@@ -10,6 +10,7 @@
* DirectExtension is an extension for the ExtDirect.
*
* @author Otavio Fernandes <otavio@neton.com.br>
+ * @author Semyon Velichko <semyon@velichko.net>
*/
class ExtDirectExtension extends Extension
{
View
3 Event/DirectEvents.php
@@ -1,6 +1,9 @@
<?php
namespace Ext\DirectBundle\Event;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
final class DirectEvents
{
View
4 Event/ResponseEvent.php
@@ -5,7 +5,9 @@
use Symfony\Component\EventDispatcher\Event;
use Ext\DirectBundle\Response\ResponseInterface;
-
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class ResponseEvent extends Event
{
private $response;
View
91 Resources/doc/index.rus.rst
@@ -0,0 +1,91 @@
+DirectBundle
+============
+
+DirectBundle -- это реализация ExtDirect спецификации для symfony2
+
+Установка
+----------
+
+Лучший способ установки, добавить git репозиторий в ваш проект, это добавив субмодуль.
+
+Добавьте в файл deps
+~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ [ExtDirectBundle]
+ git=git://github.com/ghua/DirectBundle.git
+ target=/bundles/Ext/DirectBundle
+
+Либо добавив субмодуль в вашу текущий проект
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ $ git submodule add git://github.com/ghua/DirectBundle.git vendors/bundles/Ext/DirectBundle
+
+Добавляем namespace в autoloader
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ <?php
+ // app/autoload.php
+ $loader->registerNamespaces(array(
+ // ...
+ 'Ext' => __DIR__.'/../vendor/bundles',
+ // ...
+ ));
+
+Регистрируем DirectBundle в AppKernel
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+
+ <?php
+ // app/AppKernel.php
+ public function registerBundles()
+ {
+ $bundles = array(
+ // ...
+ new Ext\DirectBundle\ExtDirectBundle(),
+ // ...
+ );
+
+ // ...
+ return $bundles;
+ }
+
+Пример конфигурации
+~~~~~~~~~~~~~~~~~~~
+
+ getCustomers - произвольное имя правила
+ defaults - основные параметры
+ _controller - ИмяУзла:Контроллер:метод
+ params - метод принимает параметры
+ form - метод formHandler
+ reader - аналог store.reader в extjs, поддерживается: root, successProperty, totalProperty
+
+::
+ # app/config.yml
+ ext_direct:
+ router:
+ rules:
+ getCustomers:
+ defaults: { _controller: AcmeDemoBundle:Demo:getCustomers, params: true }
+ reader: { root: root }
+
+ getCountries:
+ defaults: { _controller: AcmeDemoBundle:Demo:getCountries }
+
+ getRoles:
+ defaults: { _controller: AcmeDemoBundle:Demo:getRoles }
+
+ updateCustomer:
+ defaults: { _controller: AcmeDemoBundle:Demo:updateCustomer, params: true }
+
+ createCustomer:
+ defaults: { _controller: AcmeDemoBundle:Demo:createCustomer, params: true, form: true }
+
+Пример использования
+~~~~~~~~~~~~~~~~~~~~
View
3 Response/AbstractQuery.php
@@ -11,6 +11,9 @@
use Ext\DirectBundle\Event\DirectEvents;
use Ext\DirectBundle\Event\ResponseEvent;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class AbstractQuery extends Response implements ResponseInterface
{
View
3 Response/Error.php
@@ -4,6 +4,9 @@
use Symfony\Component\Form\Form;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class Error extends Response implements ResponseInterface
{
View
3 Response/FormError.php
@@ -4,6 +4,9 @@
use Symfony\Component\Form\Form;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class FormError extends Error implements ResponseInterface
{
public function setContent($form)
View
3 Response/KnpPaginator.php
@@ -11,6 +11,9 @@
use Ext\DirectBundle\Event\DirectEvents;
use Ext\DirectBundle\Event\ResponseEvent;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class KnpPaginator extends Response implements ResponseInterface
{
View
3 Response/Response.php
@@ -11,6 +11,9 @@
use Ext\DirectBundle\Event\DirectEvents;
use Ext\DirectBundle\Event\ResponseEvent;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class Response implements ResponseInterface
{
View
4 Response/ResponseFactory.php
@@ -6,7 +6,9 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
use Ext\DirectBundle\Router\ControllerResolver;
-
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class ResponseFactory
{
View
3 Response/ResponseInterface.php
@@ -4,6 +4,9 @@
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
interface ResponseInterface
{
View
3 Response/ValidatorError.php
@@ -4,6 +4,9 @@
use Symfony\Component\Validator\ConstraintViolationList;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class ValidatorError extends Error implements ResponseInterface
{
public function setContent($errors)
View
3 Router/CallForm.php
@@ -2,6 +2,9 @@
namespace Ext\DirectBundle\Router;
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class CallForm extends Call
{
View
4 Router/ControllerResolver.php
@@ -9,7 +9,9 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpFoundation\Request as HttpFoundation_Request;
-
+/**
+ * @author Semyon Velichko <semyon@velichko.net>
+ */
class ControllerResolver extends BaseControllerResolver {
private $call;

0 comments on commit 2d7e5f7

Please sign in to comment.
Something went wrong with that request. Please try again.