Quantcast
Channel: Yii Framework Forum
Viewing all 18717 articles
Browse latest View live

Export db without download (on host)

$
0
0
hi
how can i export db using adminer or phpmyadmin without download? I only want to save it on the server

thanks in advance.

MongoDb Extension

$
0
0
can we add mongodb data types via model (activeRecord)? can we use repository pattern to do so?

Yiiframework.com website

$
0
0
Hi -

I have been using Yii since version 1 and now upgraded my site to version 2 and I am very happy with the framework. Works great and incorporates all the features I need.

However looking at google trends or Github trending for instance
: trends.png
I can see that there is a problem with YII and on the long term it will affect all of us if the number of adopters does not grow. I don't want to be alarmist but a lot of PHP frameworks have lost interest from users and finally disappeared.

Anyway, Yii Framework is very good and most of the time I read a blog post about which PHP framework to choose, Yii is always considered fast, secure, extensible... but at the end of the review another framework is picked as the best one because it is more popular with a bigger community. Yii is underrated and all the trends are showing it.

One easy thing that should be done is update the yiiframework.com website. If you compare to other big players, the site looks outdated which is kind of ironic when it is a website for a PHP framework.

I know that the new website task has been on the roadmap since 2014 but it never happens.

My questions are:
- To the CORE team, is there a plan to update the website in the short term? If yes do you guys need help?

If you do need help

- I am pretty sure we have amazing designers in the community, would anyone be interested in working on the yiiframework site?


Waiting to see your comments and hopefully change for the best.

--Matt

Uso de multimodelform

$
0
0
Hola a todos les agradeceria que me ayuden en este topico, estoy usando la extension multimodelform, para manejar dos modelos, el modelo Cliente y el modelo Firmantes, donde a cada cliente le pueden corresponder varios firmantes, por lo que tengo una relacion uno a muchos entre las tablas firmantes y clientes, o sea:
//en la tabla firmantes
'idProducto' => array(self::BELONGS_TO, 'Clientes', 'CodCliente'),

El problema es que cuando creo un cliente o lo modifico, y le pongo varios firmantes, solo me crea uno, o me actualiza uno.
mi trozo de codigo del controlador es:
 public function actionCreate() {
    	Yii::import('ext.multimodelform.MultiModelForm');

    	$model = new Clientes;

    	$Fichas = new Firmantes;

    	$validatedFichas = array();  //ensure an empty array

    	if (isset($_POST['Clientes'])) {
        	$model->attributes = $_POST['Clientes'];

        	if (//validate detail before saving the master
                	MultiModelForm::validate($Fichas, $validatedFichas, $deleteItems) &&
                	$model->save()
        	) {
            	//the value for the foreign key 'groupid'
            	$masterValues = array('CodCliente' => $model->CodCliente);
            	if (MultiModelForm::save($Fichas, $validatedFichas, $deleteFichas, $masterValues))
                	$this->redirect(array('view', 'id' => $model->CodCliente));
        	}
    	}

    	$this->render('create', array(
        	'model' => $model,
        	//submit the member and validatedItems to the widget in the edit form
        	'member' => $Fichas,
        	'validatedFichas' => $validatedFichas,
    	));
	}

	public function actionUpdate($id) {
    	Yii::import('ext.multimodelform.MultiModelForm');

    	$model = $this->loadModel($id); //the Group model

    	$Fichas = new Firmantes;
    	$validatedFichas = array(); //ensure an empty array

    	if (isset($_POST['Clientes'])) {
        	$model->attributes = $_POST['Clientes'];

        	//the value for the foreign key 'groupid'
        	$masterValues = array('CodCliente' => $model->CodCliente);

        	if (//Save the master model after saving valid members
                	MultiModelForm::save($Fichas, $validatedFichas, $deleteFichas, $masterValues) &&
                	$model->save()
        	)
            	$this->redirect(array('view', 'id' => $model->CodCliente));
    	}
    	$this->render('update', array(
        	'model' => $model,
        	//submit the member and validatedItems to the widget in the edit form
        	'member' => $Fichas,
        	'validatedFichas' => $validatedFichas,
    	));
	}

Mi codigo de la vista es:
<?php
/* @var $this ClientesController */
/* @var $model Clientes */
$validatedFichas = array();
$Fichas = new Firmantes;
$items = array();
$detalle = array();
$FichasFormConfig = array();
/* @var $form CActiveForm */
?>

<div class="form wide">
	<?php
	$form = $this->beginWidget('CActiveForm', array(
    	'id' => 'clientes-form',
    	'enableAjaxValidation' => false,
	));
	?>  

	<?php
	//show errorsummary at the top for all models
	//build an array of all models to check
	echo $form->errorSummary(array_merge(array($model), $validatedFichas));
	?>
	<div class="panel-default">
    	<div class="panel panel-default">
        	<table>
            	<tr>
            	<div class="panel-heading">
                	<b contextmenu="Crear Cliente">Crear Clientes</b>
                	<b>(</b>
                	<b>Los campos con <span class="required">*</span> son necesarios.</b>
                	<b>)</b>

            	</div>
            	</tr>
        	</table>
        	<hr>
        	<table>
            	<tr>
                	<td style="padding: 4px 10px 4px 0px; width: 130px;">
                    	<?php echo $form->labelEx($model, 'CodCliente'); ?> 
                    	<?php echo $form->textField($model, 'CodCliente', array('size' => 8, 'maxlength' => 12)); ?> <?php echo $form->error($model, 'CodCliente'); ?>        	</td>
                	<td>
                    	<?php {
                        	echo $form->labelEx($model, 'Descripcion');
                        	?>
                        	<?php echo $form->textArea($model, 'Descripcion', array('rows' => 1, 'cols' => 25, 'readonly' => FALSE)); ?>
                        	<?php
                        	echo $form->error($model, 'Descripcion');
                    	}
                    	?>        	
                	</td>
                	<td>
                    	<?php echo $form->labelEx($model, 'Sucursal Ban'); ?> 
                    	<?php echo $form->textField($model, 'sucursal', array('size' => 12, 'maxlength' => 12)); ?> 
                    	<?php echo $form->error($model, 'sucursal'); ?>   		
                	</td>
            	</tr>
            	<tr>
                	<td style="padding: 4px 10px 4px 0px; width: 130px;">
                    	<?php echo $form->labelEx($model, 'CodREUP'); ?> 
                    	<?php echo $form->textField($model, 'CodREUP', array('size' => 8, 'maxlength' => 12)); ?> 
                    	<?php echo $form->error($model, 'CodREUP'); ?>   		
                	</td>
                	<td>
                    	<?php {
                        	echo $form->labelEx($model, 'Direccion');
                        	?>
                        	<?php echo $form->textArea($model, 'Direccion', array('rows' => 1, 'cols' => 25, 'readonly' => FALSE)); ?>
                        	<?php
                        	echo $form->error($model, 'Direccion');
                    	}
                    	?>      	
                	</td>
                	<td>
                    	<?php echo $form->labelEx($model, 'Código NIT'); ?> 
                    	<?php echo $form->textField($model, 'NIT', array('size' => 8, 'maxlength' => 12)); ?>
                    	<?php echo $form->error($model, 'NIT'); ?>  	
                	</td>
            	</tr>
            	<tr>
                	<td style="padding: 4px 10px 4px 0px; width: 130px;">
                    	<?php echo $form->labelEx($model, 'CuentaCUP'); ?> 
                    	<?php echo $form->textField($model, 'CuentaCUP', array('size' => 14, 'maxlength' => 16)); ?> 
                    	<?php echo $form->error($model, 'CuentaCUP'); ?>        	</td>
                	<td style="padding: 4px 10px 4px 0px; width: 130px;">
                    	<?php echo $form->labelEx($model, 'CodProv'); ?>
                    	<span style="width: 240px;">
                        	<?php
                        	echo $form->dropDownList($model, 'CodProv', CHtml::listData(Provincias::model()->findAll(array('order' => 'Descripcion')), 'CodProv', 'Descripcion'), array(
                            	'ajax' => array(
                                	'type' => 'POST',
                                	'url' => CController::createUrl('clientes/actualizarMunicipios'),
                                	'dataType' => 'json',
                                	'data' => array('idCodigo' => 'js:this.value'),
                                	'success' => 'function(data) {
            	$("#Clientes_CodMun").html(data.municipios);          				
            	}')
                                	)
                        	);
                        	?>
                        	<?php echo $form->error($model, 'CodProv'); ?></span></td>
                	<td style="width: 240px;"><?php echo $form->labelEx($model, 'CodMun'); ?>
                    	<?php echo $form->dropDownList($model, 'CodMun', array(), array('style' => 'width:150px')); ?>
                	</td>
            	</tr>
            	<tr>
                	<td style="padding: 4px 10px 4px 0px; width: 130px;">
                    	<?php echo $form->labelEx($model, 'CuentaCUC'); ?> 
                    	<?php echo $form->textField($model, 'CuentaCUC', array('size' => 14, 'maxlength' => 16)); ?> 
                    	<?php echo $form->error($model, 'CuentaCUC'); ?>        	</td>
                	<td>
                    	<?php echo $form->labelEx($model, 'Organismo'); ?> 
                    	<?php echo $form->dropDownList($model, 'CodOrg', CHtml::listData(Xorganismos::model()->findAll(array('order' => 'Descripcion')), 'CodOrg', 'Descripcion'));
                    	?> <?php echo $form->error($model, 'CodOrg'); ?>        	</td>
                	<td>
                    	<?php echo $form->labelEx($model, 'Sector'); ?> 
                    	<?php echo $form->dropDownList($model, 'Codsec', CHtml::listData(Sectores::model()->findAll(array('order' => 'NSector')), 'Codsec', 'NSector'));
                    	?> <?php echo $form->error($model, 'Codsec'); ?>        	</td>
            	</tr>
        	</table>
    	</div>
	</div>
</div>
&lt!-- ---------------------------------------- Detalles de las Fichas de Clientes ------------------------------------- -->
<?php
$FichasFormConfig = array(
	'elements' => array(
    	'Nombre' => array(
        	'type' => 'text',
        	'size' => '20',
        	'maxlength' => 100,
        	'style' => 'WIDTH:100px',
    	),
    	'CI' => array(
        	'type' => 'text',
        	'size' => '11',
        	'maxlength' => 11,
        	'style' => 'WIDTH:100px',
    	),
    	'cargo' => array(
        	'type' => 'text',
        	'size' => '20',
        	'maxlength' => 30,
        	'style' => 'WIDTH:100px',
    	),
    	'Contrato' => array(
        	'type' => 'text',
        	'size' => '2',
        	'maxlength' => 16,
    	),
 		'Fechaf' => array(
        	'type' => 'date',
      	'language' => 'en'
    	),
	)
);
?>
<?php
$this->widget('ext.multimodelform.MultiModelForm', array(
	'id' => 'CodCliente', //the unique widget id
	'formConfig' => $FichasFormConfig, //the form configuration array
	'model' => $Fichas, //instance of the form model
	'tableView' => true,
	//if submitted not empty from the controller,
	//the form will be rendered with validation errors
	'validatedItems' => $validatedFichas,
	//array of member instances loaded from db
	'data' => $Fichas->findAll('CodCliente=:CodCliente', array(':CodCliente' => $model->CodCliente)),
     		'showAddItemOnError' => false,
        	'addItemText' => 'Agregar',
        	'removeText' => 'Eliminar',
        	'removeConfirm' => '¿ Desea eliminar lo seleccionado ?', 
    	)
);
?>


<div class="row buttons">
	<?php echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Guardar'); ?>
</div>

<?php $this->endWidget(); ?>
</div>&lt!-- form --> 

Necesito saber donde esta el error, me urge solucionarlo

Calendar View Widget Extension

Emergency Help - Yii application Migration Error (From VPS to Shared Host)

$
0
0
Dear All Active Users , Please Help Me
We have developed a REST Client in yii framework for our admin Side.
our previous server was a VPS , now we migrated our application to a shared host.
all our applications are working very well
our rest app ( in phalcon ) is OK
our user side app ( which is a rest client ) is OK
our admin side app which is a rest client in yii 2.0, has got problems.
(note : in our vps , we had composer but in shared host, we don't have it )
so we copy the vendor folder to our yii admin app directory ,the ui rendered , we can also login to admin app ( so our rest is sound to be ok ) but we cant do anything in our admin app we always get this error (see the attachment)
for example when we click to see users list we get errors , the error is always the same.
please see the attachment (screen shot)

what should I do , is it because of composer? we just copy the vendor folder to our new shared host ,
is there any change that we should do , the login and authentication is working good...but others not !
please help me

Doc en français

$
0
0
Guide définitif pour Yii 2.0

J'ai trouvé un début de documentation en français. Je poste ces liens car je n'ai pas trouvé cette doc très facilement, peut-être ai-je raté un lien quelque part... en tout cas si ça peut aider.

Malheureusement, ce n'est pas complet, mais c'est un bon début

github.com/yiisoft/yii2/tree/master/docs/guide-fr

et

nix-tips.ru/yii2-api-guides/guide-fr-README.html

DB mit Login verknüpfen

$
0
0
Hey Leute,

ich mache zurzeit ein Praktikum als Softwareprogrammierer und bin grad dabei mich mit Yii auseinander zu setzen. Bin soweit, dass ich meine erste Datenbank erstellt habe und sie mir auch anzeigen lassen kann auf der vorprogrammierten Yii-Testseite. Soweit so gut. Mein Vorhaben ist jetzt, dass, wenn sich "jemand" über den E-Mail Login einloggt, einzelne Informationen über diesen "jemand" angezeigt werden.
Kleines Beispiel:

User1 loggt sich mit example@email.com seinem jeweiligen Password ein und daraufhin werden dann zb. Alter, Beruf usw von User1 angezeigt.
Das ganze sollte dann auch für mehrer User sein, wäre das dann auch einstellbar?

Ich hoffe ihr versteht mein Anliegen


MfG Nasir21

перенаправление на поддомен

$
0
0
Помогите, пожалуйста. как могу с помощю .htaccess и конфигурации routes перенаправить example.ru/project/domain?domain=domainname на domainname.example.ru?

Experienced Yii2 coder that delivers!

$
0
0
I deliver top quality in website backend coding, web applications architecture as well as in full stack of web development tasks. I'm really excited about how well the application works and what needs to be done to receive exceptional performance.

I'm enjoying latest technology trends and work with wide variety of programming languages. Can work on various assignments ranging from urgently needed frontend/backend fixes to web and mobile application development from scratch.

Skills:
- Core PHP, PHP frameworks (Yii/Yii2 and others)
- node.js
- JavaScript, jQuery, AngularJS
- MySQL, MongoDB, PostgreSQL
- 3-rd party systems and APIs: social, Google, payment gateways and any others

Don't hesitate to shoot me a PM or reach out in Skype: icemintco

d3files - attachment module

$
0
0
- attach files to model record (it is possible to attach one file to multiple models)
- widget for model view
- standalone actions to integrate in model's controllers to control access rights there
- shared files for public access

In github: github.com/d3yii2/d3files

How to install Googlecalendar?

$
0
0
I put files from downloaded googlecalendar extension archive in demo site blog from yiiframework. Css from archive i add in root of the site blog in exsising directory, for directory jquery from archive i add new dir in root of the site directory, view.php from archive i added in created directory views in root too. But, when i enter in the adres bar mysite.ru\googlecalendar.php, i got an error:
Fatal error: Class 'Yii' not found in C:\OpenServer\domains\www.blog.ru\googlecalendar.php on line 31, on line 31 in this file write this code: Yii::import('system.web.widgets.CWidget');. What i doing wrong?

Your Dedicated Development Team

$
0
0
Hello,

My name is Hristo Proynov, I am Business Development Director at Devision, IT company based in Sofia, Bulgaria. We have a pool of talented Software Engineers specialized in PHP Development (Yii Framework 1,2) and JavaScript Development (AngularJS, ReactJS, NodeJS, Backbone).

We are specialized in the development of complex software solutions and custom web applications. We use Agile (Scrum) process, Test-Driven Development (TDD) and utilize different continuous integration and DevOps tools to automate the software development process.

You can check our portfolio on www.devision.com/projects.

If you want to discuss your software development needs contact me on:
Email: h.proynov@devision.bg
Skype: hristo.devision.bg

Best Regards,
Hristo Proynov

Pagination With Cgridview And Carraydataprovider

$
0
0
I'm attempting to use a GridView to display and paginate records retrieved from an API. The API returns thousands (and thousands) of records, but thankfully provides a way to limit the returned data to a subset. I can specify the number of records I want back, and the number with which to start. The API is nice enough to tell me how many total records there are for things like pagination.

Since the API returns the records as an array, I'm using the ArrayDataProvider. Assuming the API response is $this->applications, my data provider looks like this:

    $dataProvider = new CArrayDataProvider($this->applications->List, array(
        'id' => 'applications',
        'keyField' => 'ApplicationId',
        'pagination' => array(
            'pageSize' => 20,
            'pageVar' => 'page'
        ),
        'totalItemCount' => $this->applications->Total
    ));



When I allow the API to return all the records, GridView displays and paginates properly:

    $this->widget(
        'zii.widgets.grid.CGridView', array(
            'ajaxUpdate' => false,
            'columns' => array(
                [...]
            ),
            'dataProvider' => $dataProvider,
        )
    );



My problem comes when I want to paginate over the entire result set, but have the API only return a subset of data. So for example, If I limit the returned records to 20, despite the totalItemCount being in the thousands, no pagination controls will be displayed.

If I return more than 20 records (say 21-1000), the proper pagination controls to navigate over the 1000 records will be displayed properly, but pagination itself does not work correctly. If 21-40 is page 2, and records 21-1000 are returned by the API, page 2 will actually represent 41-60. Click page 3 (API results 61-80), I'll actually get 101-120.

So my question is this: Can I accomplish what I'm attempting using GridView and ArrayDataProvider? I'm quite certain I'm going about it in the wrong way, but I'm also pretty confident there's a way to do this. It seems silly to me that the GridView would require all records to be loaded in order to paginate.

Any advice from the Yii citizens out there?

Thanks for your help.

pagination wtih renderpartial

$
0
0
how to add pagination to a page which is renderpartial to another page that is how to add pagination to a renderpartial page.....to show data in cgridview any suggestions will be appreciated..

cgridview wrap text that has no spaces

$
0
0
I was wondering if anyone had come across a solution for wrapping content in a cgridview that has no spaces. Wrapping works fine if the text coming back has spaces in it. But some of content is rather long and doesn't contain spaces. Is there any way to wrap this or even just show only a certain length of the text until the end of the column.

I tried doing

'htmlOptions' => array('style' => 'max-width:100px'),


on the column options. This keeps the column width fine, but the text overflows to the right of the page

Thanks

Помощ за новобранци

$
0
0
Здравейте,

Съдбата ме събра със сайт писан на Yii и се очаква да го администрирам, поправям по малко и допълвам с нови страници и артикъли. Програмирал съм процедурно PHP дълги години но с рамки не съм се захващал. Дайте идея за tutorial за начинаещи. Опитах този в документацията, но не ми създаде яснота, кое къде да търся в тая рамка. Може ли да се направи нещо простичко, което не включва 50 файла за едно hello world? Изобщо някакво напътствие от къде да подхвана ученето на платформата. Сървър ОС Линукс Ubuntu /Nginx ако е важно.

Поздрави

yii2 gridview mongodb

$
0
0
Hi,

I am using yii2 with mongodb extension.
I am trying to use GridView with the following instructions.

https://github.com/yiisoft/yii2-mongodb/blob/master/docs/guide/usage-ar.md

But when I try to do the following configuration, I always get an error undefined index.

        $query = new Query();
        // compose the query
        $query->from('products');

        $provider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => 10,
            ],
            'sort' => [
                'defaultOrder' => [
                    '_id_' => SORT_ASC,
                ]
            ],
        ]);


I must be doing something wrong? I am just trying to get it to work and be able to sort the columns.
I did the same code with a regular MySQL db connection active record and it works fine.

If I comment the '_id_' line, it loads fine but I can't sort.

I looked online but didn't see any mention of this.

---

It seems to only work when I create an ActiveRecord class. But using Query doesn't work.

Thanks for any help!

Looking for Yii Developer (2-5 years)

$
0
0
We are a startup and looking for dedicated experienced Yii developer. Since we are at initial phase we can't give any monitoring benefits. This position will be on equity/shares basis.

We have already developed the base product and doing good in market, so we need a person/partner who can work with us as a part time and will get the secure position in the company.

Company profile: http://www.testunity.com

Interested person, please comment here or mail me at ranjan@testunity.com

Regards,
Ranjan

Ajax will update a textArea but not a textField

$
0
0
In a CActiveForm I'm using a dropdownmenu to update a textField with ajax, but it won't update the display in the target field. If I change the field to a textArea though it'll display the update fine.

I think it might be because in the textField a value='' is included in the html. Am I correct? Is there a way around this?
Viewing all 18717 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>