An overview of the Android Operating System, its history, development as well as connection with Google. Differences between Android smartphones and iPhones along with concerns involved and security tips.
Author » Amit Sonkhiya
Undefined property $db in Codeigniter
Are you facing any notice saying Undefined property: Home::$db or something like this in your Codeigniter application? The reason behind the error Undefined property $db in Codeigniter arises because you didn’t load database library in your controller/method to use any function of it.
To change navbar color in Twitter Bootstrap 3
Twitter Bootstrap is a popular front-end framework to create responsive websites with some popular JavaScript plugins. Here is a workaround to change navbar color in Twitter Bootstrap 3 instead of using the two basic navbar colors (light one / dark one) available.
<!-- A light one --> <nav class="navbar navbar-default" role="navigation"></nav> <!-- A dark one --> <nav class="navbar navbar-inverse" role="navigation"></nav>
Automatic Update Copyright Year
Still wonder how to automatic update copyright year instead of changing hard-coded value each year. Lol!! You need some fresh air to let your mind breathe. Use PHP’s date() function which can echo the current year in your copyright text.
Copyright ©< ?php echo date('Y'); ?> | Your Company Name
Remove bullets from unordered list
By default Unordered List in HTML render bullets on webpage. To remove bullets from unordered list you can set CSS rule list-style-type: none; for ‘ul’.
Inline Style: <ul style="list-style: none;"><li>...</li></ul>
3 functions to check if string contains specific words
check for existence of a substring into a string is a common requirement for programmers. Here I’m describing 3 functions to check if string contains specific words.
- strpos – Find the position of the first occurrence of a substring in a string.
- strstr – Find the first occurrence of a string
- preg_match – Perform a regular expression match
Bootstrap 3 Pagination in WordPress
The function below will assist you to smoothly add pagination in your WordPress theme using Twitter Bootstrap 3 pagination style. This function is easy to read and to customize as well as contains features like:
- Bootstrap Styling
- First and Last Button
- Previous and Next Button
- Current page & total number of pages
- First/Last text invisible on small devices
- Previous/Next text invisible on small devices
- Works with custom post types by passing parameters to function
Hide or remove basic/web from URL in Yii 2.0
Yii is a awesome framework that does many things automatically. As you know, the default installation of Yii App makes site accessible via URL ‘http://www.example.com/basic/web/index.php’ or something like this but in a production server you may wish to hide or remove basic/web from URL in Yii 2.0 as well as access it with SEO friendly URL (‘http://www.example.com/controller/action’).
Multiple forms on one page / controller and form validation
Sometimes it’s required to place two forms on one page in codeigniter like displaying login form and register form on same page. Although the views may be different but you can face conflict while displaying validation errors if the form actions are not separate (aren’t calling different methods in controller). Here is a workaround to validate one form at a time while placing multiple forms on one page in codeigniter.
jQuery functions with CSS media queries for responsive website
Due to difference between CSS media queries based on max-width and jQuery’s ‘$(window).width()’ measurement (caused by the inconsistent ways in which browser media queries handle scrollbars), there is always a mismatch between ‘jQuery $(window).width()’ and CSS3 Media Queries. Which in turn causes some ugly or unexpected behaviour by your responsive website.