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.
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
OpenGraph and Twitter Cards are two metadata sets that allow to describe web pages and make it more understandable for Facebook and Twitter respectively.
The keywords will be stored in a text field in a comma delimited format. The keywords will be created by the site administrator.
There are two ways to run a cron job:
It is good when someone writes extensions for us but trust, sometimes we forget about other approaches that, if we know the library, we shouldn't forget.
Yii makes it really easy for all to use their already made objects that automate everything we do. It provides also great power of flexibility and styling but hey, we programmers tend to complicate our lives and push a little more the power of our tools.
In this short how-to I will show how to customize setFlash() to display messages (flashes) styled to be success confirmation, error report or notice information. And how to achieve displaying errors in other way.
One can control the detail of a web application in the webroot/index.php
file by manipulating the values of YII_DEBUG
and YII_TRACE_LEVEL
, but these don't appear to be used by console applications. This is because although the base CApplication
class defines a displayError()
method that does consider these variable, CConsoleApplication
overrides it with a function that doesn't honor th...
Yii comes with a set of powerful classes for logging. If you have read the documentation about logging messages, you have noticed that we can actually decide which messages we wish to log. And this is exactly what we are going to do, using [CWebLogRoute](http://www.yiiframework.com/doc/api/1.1/CWebLog...
In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.
For example:
We have a record in a database with field switch
having 0 or 1 values.
After that we want a user to see on
or off
instead 1 or 0.
So we do the usual thing:
<?php $this->widget('zii.widgets.grid.CGridView', array(
//.....
array(
'name'=>'...
Occasionally one wishes to set systemwide parameters for an application, such as a contact address for email, an application name, or setting an option that guides major behavior. Yii provides for setting of static parameters in the configuration file, and this article talks about how to do it conveniently.
PHPIDS é conhecido projeto que pode ser visto em php-ids.org.
Checkboxes have two possible values, true
and false
, but some applications require that the user select one particular value before proceeding. Examples might be:
PHPIDS is a well known project that can be found in php-ids.org.
This had me stumped for a while so I figured it would be nice to share here to avoid others the grief.
Delploying anything using joomla's framework is quite difficult. The framework don't provide a good MVC structure and the documentation is very poor.
Create a folder where to place an Yii app under wordpress folder (mine is "yii')
At first, create a class named SmartyRenderer under application/components or any directory you want.