Posts

Showing posts from April, 2020

Yii2 advance in form signup and send email

Image
Yii framework in form signup and send email / How to use the swiftMailer in Yii2 Click here >   More Details Add blow code in this file and configar email and password yii-application\common\config\main-local.php 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'viewPath' => '@common/mail', 'useFileTransport' => false,//set this property to false to send mails to real email addresses //comment the following array to send mail using php's mail function 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.gmail.com', 'username' => 'xyz@gmail.com',   // add email 'password' => 'xyz@123', // add password 'port' => '587', 'encryption' => 'tls', ], ], Add email in blow file yii-application\common\config\params.php return [ ...

How to Install Yii Framework

Image
Install YII  basic & How to run Project #With Composer installed, you can install Yii application template by running the following command under a Web-accessible folder: composer create-project --prefer-dist yiisoft/yii2-app-basic basic #If you want to install the latest development version of Yii, you may use the following command instead composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic #Run project using cmd  php yii serve Using VirtualHost ServerName: basic.dev Directory: "basic/web" #Copy /requirements.php to /web/requirements.php and then use a browser to access it via http://localhost/requirements.php #Run the following commands: cd basic php requirements.php Install YII 2-app-advanced  & How to run Project You can then install the application using the following commands: composer global require "fxp/composer-asset-plugin:~1.1.1" composer create-project --prefer-dist yiisoft/yii2-app-ad...

jquery validation for radio button checked or not

Image
< script > $ ( document ). ready ( function (){ $ ( '#submit' ). click ( function () { if (! $ ( " input :radio[name=rating]" ). is ( ":checked" )) { alert ( 'Rating cannot be empty' ); return false ; } }); }); </ script >

jquery modal popup page on load example

Image
HTML < div id= "first-modal" class= "modal" > < center > < p >< img src= "assets/img/nutrition-logo.png" width= "132" height= "30" alt= "Sports Research" style= " opacity : 0.5 " ></ p > < h2 style= " margin : 15 px 0 25 px 0 ; " > Has it been 15 days since you received your product? </ h2 > < a href= "javascript:void(0)" class= "btn-free" rel= "modal:close" > Yes </ a > < a class= "btn-free" href= "javascript:void(0)" id= "show-notice-modal" > No </ a > </ center > </ div > < div id= "notice-modal" class= "modal" > < center > < p >< img src= "assets/img/nutrition-logo.png" width= "132" height= "30" alt= "Sports Research...

javascript form on submit validation

Image
< script > $ ( "form" ). submit ( function (event) { var recaptcha = $ ( "#g-recaptcha-response" ). val (); if ( recaptcha === "" ) { event. preventDefault (); alert ( "Please Verify Captcha" ); } }); $ ( '#get_my_free_product' ). click ( function (event) { var recaptcha = $ ( "#g-recaptcha-response" ). val (); if ( recaptcha === "" ) { event. preventDefault (); alert ( "Please Verify Captcha" ); } }); </ script >