Logging is a very important feature of the application. It let's you know what is happening in every moment. By default, Yii2 basic and advanced application have just a \yii\log\FileTarget target configured.
Logging is a very important feature of the application. It let's you know what is happening in every moment. By default, Yii2 basic and advanced application have just a \yii\log\FileTarget target configured.
\yii\mail\BaseMailer::useFileTransport is a great tool. If you activate it, all
emails sent trough this mailer will be saved (by default) on @runtime/mail
instead of being sent, allowing the devs to inspect thre result.
In India have Aadhar number an we may need to valid it a input. So I created a validator for yii2
I have a calls which help me display json directly in html table.
GridView show sum of columns in footer
`
PHP
use yii\grid\DataColumn;
There are Multiple Ways to Create a Validator But here we use Regular Expression or JavaScript Regular Expression or RegExp for Creation Validators. In this article, we will see the most Frequently Used Expression
The definition of breadcrumbs according to its documentation is as follow: Breadcrumbs displays a list of links indicating the position of the current page in the whole site hierarchy.
OpenGraph and Twitter Cards are two metadata sets that allow to describe web pages and make it more understandable for Facebook and Twitter respectively.
Some PHP installations may use a different php.ini
file for CLI PHP (command line PHP parser). As a result, when running the model
or crud
command in yiic shell
, you may encounter errors like "YiiBase::include(PDO.php): failed to open stream..." or "...could not find driver", even though the requirement checker confirms you have PDO and the corresponding database driver.
When you need to integrate with other frameworks (e.g. Zend Framework), you have to follow these steps:
Yii's ActiveRecord classes are powerful, but they fall short when you want to have a configurable table prefix for your application.
In this post I am going to describe a solution to make your yii-based web application safe from illegal content injections.
If we want to set meta tags on a per page (controller-action) basis, we may use the clientScript application component.
In order to nicely display flash Messages, create view like this called views/site/dialog.php :
It is a common case coders often come accross. For example the purpose of these checkbox is to mark records to be deleted
Followings are the simple steps to put an analogue clock widget on your skeleton application that is just generated by yiic.
A simple trick to get the localized version of a model field is to add this little method to your models.
p.s. latest version of this tutorial is always available unter the docs/ folder of the User Management Module.
During development, it's often very handy to have SQL logging and profiling.