Yii Framework Forum: Obtener Segmentos De Url - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Obtener Segmentos De Url Rate Topic: -----

#1 User is offline   alexd2 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 12-September 12

Posted 01 October 2012 - 12:08 PM

Hola a todos, alguno sabe como obtener los segmentos de la url
Ejemplo:
http://www.example.c.../4522/300/venta

y que me devuelva en un array

[1] categoria
[2] 4522
[3] 300
[4] venta

en codeigniter es así
$segs = $this->uri->segment_array();

foreach ($segs as $segment)
{
    echo $segment;
    echo '<br />';
}



En yii como se hace?

Saludos
0

#2 User is offline   Luciano 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 133
  • Joined: 20-September 09
  • Location:Buenos Aires, Argentina

Posted 01 October 2012 - 01:05 PM

No sé si hay otra manera más directa, pero fijáte esto:

$parts = explode('/', Yii::app()->request->getPathInfo());


Saludos!
Company web site: pressEnter
Development using free software.
0

#3 User is offline   alexd2 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 12-September 12

Posted 01 October 2012 - 05:28 PM

View PostLuciano, on 01 October 2012 - 01:05 PM, said:

No sé si hay otra manera más directa, pero fijáte esto:

$parts = explode('/', Yii::app()->request->getPathInfo());


Saludos!


Muchas gracias por tu respuesta se agradece, lo pruebo y comento.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users