Hi, in a plugin i use the new admin functionality. And i want to move
the sfPropelRouteCollection rule from the applications routing.yml to
the plugins routing.class.php

this is the one generated :

sf_da_server:
  class: sfPropelRouteCollection
  options:
    model:               sfDaServer
    module:              DaServer
    prefix_path:         DaServer
    column:              id
    with_wildcard_routes: true

so now i move it to my routing class :

static public function listenToRoutingLoadConfigurationEvent(sfEvent
$event)
  {
    $r = $event->getSubject();

    // preprend our routes
    $options = array(
          "name"                =>  "sf_da_server",
          "model"               =>  "sfDaServer",
          "module"              =>  "DaServer",
          "prefix_path"         =>  "DaServer",
          "column"              =>  "id",
          "with_wildcard_routes"=>  true,
    );

    $daserverroute = new sfPropelRouteCollection($options);
    $r->prependRoute('sf_da_server', $daserverroute);
  }

I get this error :

Notice: Undefined index: requirements in core/lib/routing/
sfObjectRouteCollection.class.php on line 49

Warning: array_merge() [function.array-merge]: Argument #2 is not an
array in /core/lib/routing/sfObjectRouteCollection.class.php on line
49

Warning: array_merge() [function.array-merge]: Argument #1 is not an
array in /core/lib/routing/sfObjectRouteCollection.class.php on line
138

Apparently i need to pass the requirements & model_methods like this :

    // preprend our routes
    $options = array(
          "name"                =>  "sf_da_server",
          "model"               =>  "sfDaServer",
          "module"              =>  "DaServer",
          "prefix_path"         =>  "DaServer",
          "column"              =>  "id",
          "with_wildcard_routes"=>  true,
          "requirements"        => array(),
          "model_methods"       => array(),
    );


Shouldn't these values be defined by default ? Howcome the yaml
routing doesn't need those defaults, and php declaration does ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to