This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->widget('zii.widgets.jui.CJuiTabs', array( | |
'tabs'=>array( | |
'Datos Generales' => $this->renderPartial('_form',array('model' => $model, 'form' => $form),true), | |
'Datos Específicos' => $this->renderPartial('application.views.vista1._form',array('model' => $model1, 'form' => $form),true), | |
'Productores' => $this->renderPartial('application.views.vista2._form',array('model' => $model2, 'form' => $form),true), | |
), | |
'options'=>array( | |
'collapsible'=>true, | |
'selected'=>0, | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Academia\TecnicaMilitarBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* Docente | |
* | |
* @ORM\Table() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Auditoria | |
{ | |
/** | |
* atributo para guardar el nombre del usuario | |
* @var string | |
*/ | |
private $usuario; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* createNewUser | |
* inserta un nuevo usuario con los valores mapeados indicados. | |
* | |
* mapped_values, es un array -indexado- con los siguientes campos: | |
* 'username'=>'userxxx', 'email'=>'xyz@gmail.com', 'password' => 'tuassword' | |
* y los siguientes serian los nombres de los campos | |
* personalizados | |
* 'nombre'=>'pedro', 'apellido'=>'perez' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//variable externa que pasaremos a la columna del gridView | |
$variable_externa = 'foo'; | |
//dentro del index columns | |
array( | |
'header' => 'Foo' | |
'value' => function($data, $row) use ($variable_externa) { | |
return $variable_externa; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
array( | |
'header'=> 'Foo', | |
'value' => function($data,$row) use ($key){ | |
return CHTML::textField( | |
'ActasForm[field][]', | |
!empty($key) ? $key : '', | |
array( | |
"maxlength"=>"4", | |
"size"=>"4", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$uploads_dir = 'images'; | |
$name = $_FILES["file"]["name"]; | |
$tmp_name = $_FILES["file"]["tmp_name"]; | |
move_uploaded_file($tmp_name, "$uploads_dir/$name"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$connection = Yii::app()->db; | |
$transaction = $connection->beginTransaction(); | |
try { | |
$connection->createCommand($sql1)->execute(); | |
$transaction->commit(); | |
} catch (Exception $e) { | |
$transaction->rollBack(); | |
echo $e->getMessage(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function beforeSave() | |
{ | |
$this->fecha = date('Y-m-d'); | |
parent::beforeSave(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function beforeSave() | |
{ | |
if ($this->isNewRecord) { | |
$this->fecha = date('Y-m-d'); | |
} | |
parent::beforeSave(); | |
} |
OlderNewer