This tutorial is explained following "basic" application structure.
The problem was that all my web applications ran normally on localhost, but on server the Greek characters (or any other no-english characters) displayed with problems.
Using a version control system, like Git, is nice. However, when building an extension from scratch and loading it via Composer, it adds a lot of pain in the butt steps. You have to commit your changes, update composer to pull them over, then notice there is an error, fix, commit, update. repeat.. I don't want all my baby steps under Git. Sure, I could edit my commit history, but c'mon. Just let m...
Following is the table structure
CREATE TABLE IF NOT EXISTS `tblgroups` ( `id` int(11) NOT NULL, `groupname` varchar(150) NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Acitve,2=Inactive', `date` datetime NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
The Problem: Yii2 utilizes by default UserIdentity configured in config/web.php for connection, this object appy one table to authentication ('identityClass' => 'app\painel\models\User'). How to authentication from diferent tables? Solution: Create instances in web.php to uses UserIdentify. eg:
Uploading files in a webapp can be extremely tricky and sometimes the quickest way to do it is to store the file directly in the webserver or into a DNS (like Amazon S3) and then to save the link and the metadata inside a table in the DB. The thing is that you'll have to deal with file permissions, server storage, file management and so on (which is perfectly fine, by the way).
If you are coming over from Yii 1.x to Yii 2, and already read this guide, you may note that namespaces are very important in Yii 2 to identify classes. But do you know the list of seeded path aliases that come shipped with a basic or advanced app? Here is my attempt to list them.
// In Yii 1.x $form = $this->beginWidget('CActiveForm', [
'id' => 'order-search-form', 'method' => 'get',
echo $form->textInput($searchModel, 'id');
echo CHtml::submitButton('Find', ['class' => 'btn btn-primary']);
This is for folks who are using
\kartik\widgets\FileInput to upload files from your client. How do you display an image for update after you have uploaded it to the server using the widget?
Imagine adds most common image functions and also acts as a wrapper to Imagine image manipulation library.
1. Create Extension in yii2.
There are numerous usability problems: