Wiki articles

Showing 41-60 of 142 items.

embedded javascript block in your view with IDE checking or intellisense

Created 4 years ago by yiqing95, updated 4 years ago by yiqing95.

this is my way for embed js code block in view file:

1 0
3 followers
Viewed: 8 054 times
Version: 2.0
Category: Tips

MongoDB's RBAC support class extending BaseManager

Created 4 years ago by edoardo849, updated 4 years ago by edoardo849.

Here's a possible implementation for MongoDb of the RBAC standard. Create a class "MongoDbManager" in `common\components and modify your params.php` file like this:

0 0
4 followers
Viewed: 9 336 times
Version: 2.0
Category: How-tos
Tags: mongodb, rbac, yii2

Create Form With DynamicModel

Created 4 years ago by Misbahul D Munir, updated 4 years ago by Misbahul D Munir.

In yii2 we can create form without create FormModel. Here we go

2 0
7 followers
Viewed: 30 603 times
Version: 2.0
Category: Tips
Tags: form, model, yii2
0 0
5 followers
Viewed: 34 951 times
Version: 2.0
Category: How-tos

Save and Display Date/Time Fields in different formats in Yii2

Created 5 years ago by Kartik V, updated 4 years ago by Kartik V.

You would find having such a need in most Yii Projects. Your database needs a specific format to store date fields, while you may want to display it in different formats to the users on forms and other views.

0 0
51 followers
Viewed: 141 314 times
Version: 2.0
Category: How-tos

Simple Way to Upload and Save File

Created 4 years ago by Misbahul D Munir, updated 4 years ago by Misbahul D Munir.

This tutorial need extension mdmsoft/yii2-upload-file. Follow the intruction to install. After installation done, create controller and action

0 0
4 followers
Viewed: 27 956 times
Version: 2.0
Category: Tutorials

Step by step for how to full export Yii2 grid to excel

Created 4 years ago by Scott_Huang, updated 4 years ago by Scott_Huang.

We will leverage Yii2-excelview widget. So, first of all is install Yii2-excelview:

0 0
5 followers
Viewed: 53 842 times
Version: 2.0
Category: Tips

Upload files in Yii2 with MongoDb and GridFs

Created 5 years ago by edoardo849, updated 4 years ago by skworden.

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).

6 0
5 followers
Viewed: 23 108 times
Version: 2.0
Category: How-tos

Easy way to redirect http:\\localhost\yii2-basic to http:\\localhost\yii2-basic\web\index.php

Created 4 years ago by Scott_Huang, updated 4 years ago by Scott_Huang.

First of all, install yii2 basic template according below link:

1 0
5 followers
Viewed: 29 002 times
Version: 2.0
Category: Tips

Yii2: Configuring different sessions for backend and frontend in Yii Advanced Application Template

Created 4 years ago by hrnair, updated 4 years ago by hrnair.

This is as an extension of this wiki by Kartik V which shows to make different enableAutoLogin cookies for frontend and backend.

2 0
7 followers
Viewed: 32 918 times
Version: 2.0
Category: How-tos

Analyse the server's USER-AGENT against browsecap file to determine it's capability.

Created 4 years ago by Deepak Pradhan, updated 4 years ago by Deepak Pradhan.

Does your application need to know user's details on browser details, os and device type? We can use PHP's misc. function to achieve that provided you have an update copy of browsercap.ini

0 0
0 follower
Viewed: 5 216 times
Version: 2.0
Category: Tips

Pjax on ActiveForm and GridView - Yii2

Created 4 years ago by Sreenadh, updated 4 years ago by Sreenadh.

Here is a example on how to use Pjax with GridView (yii\grid\GridView) and ActiveForm (yii\widgets\ActiveForm) widgets in Yii2.

6 0
14 followers
Viewed: 119 671 times
Version: 2.0
Category: How-tos

Moving the vendor directory for multiple projects

Created 4 years ago by mariosimaremare, updated 4 years ago by mariosimaremare.

This How-To is useful if you are planning to move the Yii vendor directory outside the default location.

4 0
4 followers
Viewed: 20 199 times
Version: 2.0
Category: How-tos

Tutorial about How to Integrate Yii2 with fantastic theme AdminLTE

Created 4 years ago by ThePr0f3550r, updated 4 years ago by YiiJeka.

Yii2 comes with a charming twitter bootstrap version 3. But if it is less, then you can integrate with web templates that you like. One example is wonderfull template "adminLTE"

8 0
23 followers
Viewed: 109 034 times
Version: 2.0
Category: How-tos

Yii 2 list of path aliases available with default basic and advanced app.

Created 5 years ago by Kartik V, updated 4 years ago by Kartik V.

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.

10 3
47 followers
Viewed: 133 449 times
Version: 2.0
Category: Tips

How to hide /frontend/web in url addresses on apache

Created 4 years ago by raminious, updated 4 years ago by jim..

There is an issue on Yii2 to redirecting / urls to /frontend/web.
In other words we need a way to hidden /frontend/web from addresses.
We will do this without changing Apache configuration and creating virtual host or setting document root (It's good for share hostings that we have not access to apache.conf)

8 0
19 followers
Viewed: 100 422 times
Version: 2.0
Category: How-tos

RBAC Super Simple with Admin and User

Created 4 years ago by evercode, updated 4 years ago by evercode.

One of the common requests I see in the forum is how to implement RBAC. While you can implement Yii 2's built-in RBAC, that might be too much for developers who are just starting with Yii 2 or have simpler needs. Sometimes you are looking for a fast solution and just want two flavors, user and admin. And even if you will eventually need more, you can use these methods as a starting point for devel...

6 1
14 followers
Viewed: 77 107 times
Version: 2.0
Category: Tutorials

Running applications with Docker

Created 4 years ago by schmunk, updated 4 years ago by schmunk.

When building PHP web applications you usually have to take care about defining and providing a consistent development and production environment for your team. This includes your application packages, PHP-extensions, database servers and often further components such as a mail server or workers.

4 0
8 followers
Viewed: 32 283 times
Version: 2.0
Category: Tutorials

Use minified version of JqueryAsset, BootstrapAsset (and all default assets)

Created 4 years ago by robregonm, updated 4 years ago by robregonm.

By default, Yii 2.0 chooses to use the non-minified version of Jquery and Bootstrap files (CSS and JS). However, there's a simple way to indicate Yii to use the minified version.

5 0
5 followers
Viewed: 22 890 times
Version: 2.0
Category: How-tos

YII2 Pagination Options

Created 4 years ago by VivekYii, updated 4 years ago by VivekYii.

solution here If we are using default pagination option like

1 0
1 follower
Viewed: 12 335 times
Version: 2.0
Category: Tips