You are viewing revision #12 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version or see the changes made in this revision.
- Intro
- Yii demo app + GitLab
- Translations (i18n) + changing languages
- User management + basic SQL commands
- Login via database + Session
- Access rights
Please give me a few days to add whole text
Intro ¶
Skip this paragraph if you are in hurry :-) ... 8 years ago I started these two tutorials for Yii 1:
- https://www.yiiframework.com/wiki/250/yii-for-beginners
- https://www.yiiframework.com/wiki/462/yii-for-beginners-2
... and today I am beginning with Yii 2 so I will also gather my snippets and publish them here. They are meant maily for me, but also for other beginners. I have some experiences with Yii 1, but I havent used Yii for almost 5 years so many things are new for me again. Plus I was suprised that the Yii 2 demo application does not contain some basic functionalities which must be implemented in the most of web projects so I will focus on them. Plus I will talk about GitLab.
Yii demo app + GitLab ¶
... text ...
Translations (i18n) + changing languages ¶
... text ...
User management + basic SQL commands ¶
To create DB with users, use following command. I recommend charset utf8_unicode_ci as it allows you to use more international characters.
CREATE DATABASE IF NOT EXISTS `yii-demo-db` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
If you must use MyISAM instead of InnoDB, just skip the last row.
CREATE TABLE IF NOT EXISTS `user` (
`id` INT NOT NULL AUTO_INCREMENT,
`username` VARCHAR(45) NOT NULL,
`password` VARCHAR(60) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
Adding first user:
INSERT INTO `user` (`id`, `username`, `password`) VALUES (NULL, 'user01', '0497fe4d674fe37194a6fcb08913e596ef6a307f');
Login via database + Session ¶
... text ...
Access rights ¶
... text ...
thanks of share
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.