I am trying to write a cron task to call wget on a url. The cron runs fine, but every time it runs it will creates a cron.php.X file in my home directory. I’ve tried to turn off output using the –quiet option but it’s still outputting a new file with every running.
I am trying to write a cron task to call wget on a url. The cron runs fine, but every time it runs it will creates a cron.php.X file in my home directory. I’ve tried to turn off output using the –quiet option but it’s still outputting a new file with every running.
Jquery validation itself didn’t give money validate method function. What we can to do is write a custom method to validate the money format with regular expression.
Below is the money validate method.
jQuery.validator.addMethod( "money", function(value, element) { var isValidMoney = /^\d{0,4}(\.\d{0,2})?$/.test(value); return this.optional(element) || isValidMoney; }, "Insert " );
On Linux without the GUI (Gnome or KDE) if you want to know how many files inside folder, you are unable to right click and select the properties to get the number of files inside the folder.
You can use below command to get number of files inside the folder
On Firebird it have a function to let you log the SQL Query where the system call. How to the log the Firebird SQL query?
First, you need install Firebird 2.5 or 3.0 server on your PC. After that, go to the Firebird folder find a file name call fbtrace.conf and then open the file with notepad.
First, you need install Firebird 2.5 or 3.0 server on your PC. After that, go to the Firebird folder find a file name call fbtrace.conf and then open the file with notepad.
In Yii2 compare two numbers attributes in operator function. you will found that it not working properly. This is because the wrongly “type” in compare validation rules.
You may need to set the type to number as below:
'type' => 'number'Example:
['min_price', 'compare', 'compareAttribute' => 'max_price', 'operator' => '<', 'type' => 'number'],
If want to check the specific Id already exists inside the site. you may using “length” to do it.
For Example:
if( $('#selector').length) { // it exists }if the length more then 0, that’s mean the following Id already exists inside the site.
if you are using class to check
if( $('.selector').length) { // it exists }
In javascript it don’t have function to check if the string is JSON. So we may need to write a function to check the string if is JSON.
The below function is to check the string and it will return true if the string is JSON else it will return false.
To use the MySQL function on Yii2 ActiveRecord Model you to add “\yii\db\Expression” on your script instead of you direct use the “DATE_ADD” function.
Example:
$model->date = new \yii\db\Expression('DATE_ADD(CURRENT_DATE, INTERVAL - 7 DAY)')
If you want to set full url or absolute url on Yii2 Html img, you may need to use “Url” helper this class on your page.
use yii\helpers\Url;The way to use:
Html::img(Url::to('@web/images/logo.png', true));
Because the default HTML chekcbox look not nice, So i decided use Boostrap Glyphicons as the checkbox and also it got provide checked and uncheck glyphicons.
Glyphicons check and uncheck icon:
Glyphicons check and uncheck icon: