Yii Framework Forum: [RESUELTO] Como pongo una imagen en un boton - Yii Framework Forum

Jump to content

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

[RESUELTO] Como pongo una imagen en un boton Rate Topic: -----

#1 User is offline   gallego123 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 535
  • Joined: 11-August 09
  • Location:Argentina

Posted 10 September 2009 - 08:49 AM

como es la sintaxis de Chtml::LinkButton para agregarle una imagen al boton

<?php echo CHtml::linkbutton("Lov", '#', array('onclick'=>'abrirVentana()','ImageUrl'=>'aflist.gif')); ?>


soy nuevo !!!! perdon por la pregunta

gracias!


[EDIT]
GRACIAS SEBAS Y Polydoro.cardozo
KISS - Keep It Simple Stupid
ASAP-As Soon As Possible
http://www.yiiframew...oc/cookbook/71/
0

#2 User is offline   Angéllica Cardozo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 137
  • Joined: 11-March 09

Posted 10 September 2009 - 11:42 AM

You can attach an ID or CLASS attribute for your button and work it with css

Avisa si usted no habla Inglés
0

#3 User is offline   gallego123 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 535
  • Joined: 11-August 09
  • Location:Argentina

Posted 11 September 2009 - 09:06 AM

View PostPolydoro.cardozo, on 10 September 2009 - 11:42 AM, said:

You can attach an ID or CLASS attribute for your button and work it with css

Avisa si usted no habla Inglés



its work !!!! thanks qiang
<?php echo CHtml::link(CHtml::image('images/aflist.gif','Lov'), '#', array('onclick'=>'abrirVentana()')); ?>


Polydoro.cardozo:
but
As I do that? I do not know very well css
a example please
KISS - Keep It Simple Stupid
ASAP-As Soon As Possible
http://www.yiiframew...oc/cookbook/71/
0

#4 User is offline   Angéllica Cardozo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 137
  • Joined: 11-March 09

Posted 11 September 2009 - 10:44 AM

You can use CSS to replace text with an image. If no CSS is enabled no image is displayed, only your text element.

In this url (http://stopdesign.co...place-text.html) you have a simple example how to use it.

:) Hope it helps.
0

#5 User is offline   sebas 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 500
  • Joined: 28-October 08
  • Location:Buenos Aires, Argentina

Posted 14 September 2009 - 11:24 PM

View PostHoracio Segura, on 11 September 2009 - 09:06 AM, said:

its work !!!! thanks qiang
<?php echo CHtml::link(CHtml::image('images/aflist.gif','Lov'), '#', array('onclick'=>'abrirVentana()')); ?>


Polydoro.cardozo:
but
As I do that? I do not know very well css
a example please



un Ejemplo de Css es el siguiente:

.btn_bell{
    background-repeat: no-repeat;
    padding-left: 20px;
    background-image: url('icons/magnifier.png');
    min-width:22px;
    background-image: url('icons/bell.png');
}


Entonces a cualquier elemento HTML al que le pongas class="btn_bell" va a utilizar esta imágen de costado.

Saludos,
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