Quantcast
Channel: Live News for Yii Framework
Browsing all 3361 articles
Browse latest View live

[Extension] yii2-thumbnailer-component

Yii2 extension to generate thumbnails for images of any size

View Article


[wiki] Yii 1.1.17 Ubuntu AutoInstall Bash Script

Just thought I would share this bash script I wrote to help automate a base install of YII on an Ubuntu server. This script does the following: Installs requirements for YII (mcrypt, gd, apc, etc..)...

View Article


[wiki] Boost composer-asset-plugin update speed

TL;dr Using asset-packagist If you're using a lot of bower and npm assets with Yii 2.0 you might encounter long running composer update tasks. Luckily this issue can be avioded with the recently...

View Article

[wiki] How To: Custom Client Validation On Checkbox Toggle and Optional Input...

I just chased my tail around for a bit today. I got lost with setting the status of all inputs, and banging my head on why the "validate" function just wasn't working. It seems that the "validate"...

View Article

[wiki] A Single Page with a List and a Detail

Original Index Page Sub View for Detail Modifying Index Action Ajax Action Ajax Updating Conclusion The CRUD generator of Gii has done a wonderful job for you, and you already have a list of items in...

View Article


[wiki] Yii2: How to create/develop a new extension using Composer locally...

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

View Article

[wiki] A universal model attribute for its synthetic representation

Example General considerations It is convenient to use the same identification attribute, say info, in all of the active records of your application. It should be a virtual read-only attribute defined...

View Article

[wiki] Installation guide: Yii-2 advanced template with RBAC system

Welcome, all of you ! Here I am giving the steps for an easy installation of yii2-advanced template with an RBAC(Role Based Access Control) system. Installtion : Yii2 - advanced template Here we are...

View Article


[wiki] How to make bootstrap tabs remain active/selected after navigating to...

Bootstrap tabs gets unselected/inactive when user navigates to other page and comes back. How to make bootstrap tabs remain active/selected after navigating to different web pages. Steps :> 1: Add...

View Article


Image may be NSFW.
Clik here to view.

[wiki] How to customize your grid columns visible and order by user themselves

Goal Sample Picture Add code in controller Add code in model Adjust your view code a.Register JS b.Show Config Columns link c.Add partial render code in your view file d.That partial render real file...

View Article

[wiki] Yii2 GridView Sorting and Searching with a Junction Table Column(Many...

tblgroups tblcontacts tblcontactsgroups(junction table) Following is the table structure tblgroups ¶CREATE TABLE IF NOT EXISTS `tblgroups` ( `id` int(11) NOT NULL, `groupname` varchar(150) NOT NULL,...

View Article

[wiki] Optimize Scenarios for yii2

Working with scenarios, with models that can receive many modifications in their rules or structures as development evolves, can create disruptions in the rescue process. One way to avoid this disorder...

View Article

[wiki] REST API and null values in XML

I have been working on a REST API using the excellent tools provided by Yii2. My problem was that I have to differentiate between empty values and null values. In other words, <elem></elem>...

View Article


[wiki] Interactive mode command-line command for Yii1

For one of my projects I needed an interactive console command in Yii 1, i.e. the one that is gathering all information from user in an interactive mode (a serie of questions and answers displayed...

View Article

Image may be NSFW.
Clik here to view.

[wiki] Working with relational removals by yii2

This tutorial shows you how to safely remove records between relationships. First we create three tables using a Many to Many relationship. Important: Apply cascade to foreign key constraints for...

View Article


[wiki] Show raw SQL query

Here's a quick tip to dump the SQL for query. $query = new Books::find()->where('author=2'); echo $query->createCommand()->sql; or to get the SQL with all parameters included try:...

View Article

[wiki] How to make UrlManager createAbsoluteUrl work with sub-domains

Upon creating my Yii2 Members System, I have ran into a few snags along the way that forced me to extend and bend Yii2 to my will. I will describe how my app is intended to work, so you know how this...

View Article


[wiki] How to resize an image proportionally

Using the imagine extension is very simple Create this in your component: /** * @author André Luiz Pereira * @param string $ pathtoimage image the relative path: to/path/image.jpg * @param int $width –...

View Article

[wiki] Yii2 Report Grid

A Yii2 Gridview designed specifically for reporting ¶There are some very advanced grids in the Yii2 community, specifically Kartik's amazing gridview extensions but they all designed for interactive...

View Article

[wiki] How to get SEO friendly URL using Model and new getUrl() function

We all need SEO friendly URLs for our projects. its not always good to call route with params so we can generalise it for all models using a common function. Following the general convention of model...

View Article
Browsing all 3361 articles
Browse latest View live