Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/06/2014, 11:18
javo27
 
Fecha de Ingreso: junio-2014
Mensajes: 6
Antigüedad: 9 años, 10 meses
Puntos: 0
Pregunta Consulta imprimir Datos

Estimados me pueden explicar como puedo imprimir dato ejemplo El getNombre()
ya que siempre me sale que es un array y no lo puedo imprimir
dejo mi clase:
Código:
<?php
/**
 * Created by PhpStorm.
 * User: Claudio
 * Date: 13-06-14
 * Time: 10:03 AM
 */

class Pregunta
{
    private $_nombre = array();
    private $_valor = array();
    private $_class = array();
    private $_preguntas= array();


    public function addPregunta($pregunta, $nom,$valor,$class)
    {
        $this->_preguntas[] = $pregunta;
        $this->_nombre[] = $nom;
        $this->_valor[] = $valor ;
        $this->_class[] = $class ;
    }

    public function recorrerPregunta()
    {
        $salida = '';
        for ($i = 0; $i < sizeof($this->_preguntas); $i++)
        {
            $this->_preguntas[$i];
            $this->_nombre[$i];
            $this->_class[$i];
            $this->_valor[$i];
        $salida.= getNombre();
        }
        return $salida;
    }
    public function getPregunta()
    {
        return $this->_preguntas;
    }

    public function getNombre()
    {
        return $this->_nombre;
    }

    public function tipoPregunta($tipo)
    {
        switch ($tipo) {
            case 'radio':
                echo "<input name='radio' type='radio' id='".$this->getNombre()."'  value='' class='' />";
                break;
            case 1:
                echo "i es igual a 1";
                break;
            case 2:
                echo "i es igual a 2";
                break;
        }

    }
}
GRacias po su apoyo ...