Thursday, 14 July 2016

Top 3 useful tricks of CodeIgniter



Hi all of you, today i'll share you some codeigniter top tricks.

1 there is an optional perameter in $this->uri->segment

                          when you see http://website.com/controller/method/perameter vs http://website.com/controller/method/ in action ? that time we use that type of code.....
$variable = $this->uri->segment(3)                                                                                                       
there are an optional second one peraemeter that permits set your default value
$variable = $this->uri->segment(3,'SecondPerameter')                                                                      

2 Codeigniter View can return as data with a third perameter
$variable = $this->load->view('viewpage',$data,TRUE);                                                                      
$PDF = build_pdf($page);                                                                                                                         

3 Every Library can have a configuration file
              I can try to keep my library configuration option out of my controllers where possible. suddenly codeigniter lets us seamlessly move that information into application/config widout missing any steps,you need to name your configuration file the same as the library and you are set that,this is the simple example for email library.here is the application/config/email,php file include in every bit of code which one is distibutes

<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');                                              
$config['protocol'] = '****';                                                                                                                          
$config['smtp_host'] = '*****************';                                                                                           
$config['smtp_user'] = 'username';                                                                                                             
$config['smtp_pass'] = 'password';                                                                                                              
$config['smtp_port'] = '80';                                                                                                                            
?>                                                                                                                                                                       

if the third pareameter allows you to suppress errors in the event that config file done not exist
$this->config->load('blog_settings', FALSE, TRUE);                                                                                     

ENJOY : )   
By :-  RAJA MAHIYARIYA MAHER(tHuNdEr^fR0G)

Tuesday, 5 July 2016

Disable text selection in web page using CSS

Hi there, today i m share code for disable text selection using css, there are not require jquery or javascript.you can disable text selection in whole page or user defined div,

this code will disable text selection for whole page.im using .body for disable text select for whole page
   
.body
{
 -webkit-touch-callout: none; /* For IOS Safari */
 -webkit-user-select: none; /* For Safari/Opera/Chrome */ 
 -khtml-user-select: none; /* For Konqueror */ 
 -moz-user-select: none; /* For Firefox */
 -ms-user-select: none; /* For Internet Explorer/Edge */ user
 -select: none; /* For non-prefixed version */
 }

this code will disable text selection for div.

.div
{ 
 -webkit-touch-callout: none; /* For IOS Safari */
 -webkit-user-select: none; /* For Safari/Opera/Chrome */ 
 -khtml-user-select: none; /* For Konqueror */ 
 -moz-user-select: none; /* For Firefox */
 -ms-user-select: none; /* For Internet Explorer/Edge */ user
-select: none; /* For non-prefixed version */
 }

Prompt Web Solution. Powered by Blogger.