Wiki

Articles in category "how-tos"X
Displaying 91-100 of 341 result(s).

Safely checking if a model class exists (without exploding)

Created about a year ago by BoazHow-tos0 comments – viewed 4,883 times – ( +1 ) – version 1.1
While rewriting the PcReportContent extension I'm maintaining I've bumped to a challenge. This wiki was born out of it.

Simple example for language translation

Created about a year ago by RKAHow-tos2 comments – viewed 12,792 times – ( +1 ) – version 1.1
Language translation is a common requirement in multi lingual sites. In Yii, we can translate using message and view translation.
tags: yii, i18n

Attaching multiple event handlers to onBeginRequest

Created about a year ago by BoazHow-tos0 comments – viewed 3,980 times – ( +2 ) – version 1.1
There came the need to perform two operations, always, on 'application boot' time. Example? My real world example involved some geo-location logic (that's the first operation) and syncing of some session details so KcFinder can be in sync with the user in context - each user with his own session container (the second).

How to limit number of guest page views

Created about a year ago by PeRoChAkHow-tos1 comment – viewed 3,423 times – ( +3 ) – version 1.1
In some cases, we have to limit the number of page views for the guests users. Yii provide an efficient method to get this.

MongoDb's embedded documents mapping for ActiveRecord in Yii2

Created about a year ago by edoardo849How-tos1 comment – viewed 6,204 times – ( +5 ) – version 2.0
You are working with MongoDb and you have embedded documents in your collection that you want to easily map in your Model for CRUD operations.

How to create a simple logout link in the view?

Created about a year ago by mi.sarahHow-tos0 comments – viewed 8,186 times – ( +1 / -3 ) – version 1.1
Here you learn to create and set a simple ahref-link to logout the current user.
tags: Logout, Link, user, URL, views

Email by YiiMailer, Call Outlook, IMAP

Created about a year ago by Scott_HuangHow-tos0 comments – viewed 4,483 times – version 1.1
In Yii community we have lots of extention can send emails, such as YiiMailer and Swift and so on, or even IMAPI, thanks for team contribution. However, sometimes, in the intranet enviroment, the program cannot run successfully since SMTP /IMAP port been banded. So you need to seek other ways. The most simple way is **call outlook** as COM.

Override/Eliminate Bootstrap CSS/JS for Yii 2.0 widgets

Created about a year ago by Kartik VHow-tos2 comments – viewed 12,568 times – ( +37 / -4 ) – version 2.0
In Yii 2.0, the yii widgets that use Twitter Bootstrap CSS & JS directly, are part of the yii2-bootstrap extension, starting with yii/bootstrap namespace. For customizing bootstrap extension specific widget assets, you could configure your own assets (CSS/JS) using the new Yii Asset Manager in your Yii Config file. Something like:

Configuring Yii to run on both Windows and OSX

Created about a year ago by trondHow-tos2 comments – viewed 3,397 times – ( +2 ) – version 1.1
If you develop your Yii project on both Windows and Mac, there can be a problem setting up the configuration unless the configurations for both system are identical. On my machines I have the following configurations:
tags: config

Upload image and content using AJAX and Store it in different table

Created about a year ago by SelvakumarHow-tos1 comment – viewed 31,445 times – ( +2 ) – version 1.1
We all know how to upload the content and images at the same time with refreshing the page. And uploading the images using Ajax we have faced some issues, here i have fixed the issues and both content and photos are uploaded using Ajax. And both content and images are stored in the different tables