Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/04/2013, 19:57
Avatar de masterpuppet
masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: Consulta acerca Namespacing en Zend Framework

Puedes agregar el FQCN o bien hasta el segmento que quieras del namespace ahora después debes instanciar a partir del segmento, por ejemplo:

FQCN
Código PHP:
Ver original
  1. use Application\Entity\Foo;
  2. $foo = new Foo;
Segmento
Código PHP:
Ver original
  1. use Application\Entity;
  2. $foo = new Entity\Foo;

Sobre la ruta, el fw se encarga de parsear las rutas a través de un listener y la definición de cada ruta indica todo lo que preguntas

Código PHP:
Ver original
  1. 'home' => array(
  2.     'type' => 'Zend\Mvc\Router\Http\Literal',
  3.     'options' => array(
  4.         'route'    => '/',
  5.         'defaults' => array(
  6.             'controller' => 'Application\Controller\Index',
  7.             'action'     => 'index',
  8.         ),
  9.     ),
  10. ),

la opción route indica cual es la ruta, en el caso de home "/" osea el root, y en defaullts indica a donde mapea.

Saludos.
__________________
http://es.phptherightway.com/
thats us riders :)