downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Yaf_View_Simple::assignRef> <Yaf_View_Simple
[edit] Last updated: Fri, 17 May 2013

view this page in

Yaf_View_Simple::assign

(Yaf >=1.0.0)

Yaf_View_Simple::assignAsignar valores

Descripción

public bool Yaf_View_Simple::assign ( string $name [, mixed $value ] )

Asigna una variable al motor de vistas.

Parámetros

name

Una cadena o un array.

Si es una cadena se requiere el argumento $value siguiente.

value

Valor mixto

Valores devueltos

Ejemplos

Ejemplo #1 Ejemplo de Yaf_View_Simple::assign()

<?php
class IndexController extends Yaf_Controller_Abstract {
    public function 
indexAction() {
        
$this->getView()->assign("foo""bar");
        
$this->_view->assign( array( "key" => "value""name" => "value"));
    }
?>

Ejemplo #2 Ejemplo de template()

<html>
 <head>
  <title><?php echo $foo?></title>
 </head>  
<body>
  <?php
    
foreach ($this->_tpl_vars as $name => value) {
         echo $
$name// o echo $this->_tpl_vars[$name];
    
}
  
?>
</body>
</html>

Ver también



add a note add a note User Contributed Notes Yaf_View_Simple::assign - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites