CakePHP model, view, and controller naming conventions
If we have a database with table named users, then following standard Cake PHP naming conventions should be used:
1. For Model
filename = User.php
classname = User
directory...
I have a situation which will help us to understand the use of Global Filtering.
Situation:
I have a published filter that I use for my articles. Guests can only view published articles, logged in users can view and apply filter (?published...
When multiple developers are working on the same project and we have a single storyboard, we might face conflicts in the storyboard file. And the conflicts of storyboard are difficult to resolve.
Xcode 7 provides a new feature of storyboard ref...
Hello Friends,
In this tutorial I will guide you how you can install Fedora 23 workstation on your system.
If you have any previous version installed in your system then you can check the upgrade guide else follow the below steps....
Hi All,
If you want to change height of textView according to content height than you can follow this code.
Use auto layout to set view in story board and make IBOutlet for textview . Assign delegate to textview and dont give height constra...
To upgrade Fedora in your machine follow the below steps-
Take all your important files backup to any external media or hard drive.
Verify your current fedora version by executing following commands in terminal
$ cat /etc/fedora-release
...
Step1: Import the MessageUI using :- import MessageUI
Step 2: class ViewController: UIViewController, MFMessageComposeViewControllerDelegate
Step 3: when you tap on the button the list of contact will appear and you can choose the contact ...
Hi All,
If you want to show flags in using unicode hex coding (U+XXXX) than you can follow this code .
UNICODE:- Unicode is a computing industry standard for the consistent encoding, representation, and handling of text expressed in most of...
Different Types Of Testing In The Cloud:-
The entire cloud testing is divided into four primary groups. Which are mentioned as below:-
Testing of the whole cloud
Testing within a cloud
Testing across cloud
SaaS testing in cloud
T...
Drupal database abstraction layer allow's the use of different database servers using the same code base i.e it provides
with the ability to support multiple database servers easily. The system is built a top PHP's PHP Data Objects database AP...
Put Your GIF image in /raw folder and put the below code in your project
public class CustomGifView extends ImageView {
Movie movie;
InputStream inputStream;
private long mMovieStart;
public CustomGifView(Context contex...
If you are looking to get the permission to access your external storage in android, here is the solution:-
you have to add these lines in your manifest file:
<uses-permission android:name="android.permission.STORAGE" />
To store s...
Different Types Of Cloud Computing Services:-
There are primarily three significant cloud computing services. These services are utilized by the distinct organizations as per there need. These cloud computing services name are mentioned as below...
Hello Reader's!, If you have a condition in which you need to return two or more variable from function like below:-
functions()
{
//you calculation for result
return $a, $b;
}
Now you will face the error. But you can use the arr...
Suppose you have an html code like this.
<input type="button" id="btn-press" value="Submit!">
<div id="egText></div>
If now you want to add some text into this div,you need to attach an event handler and You should mov...
If you want to update the values of the dropdown based on the values of other dropdown. Here is the example where If I choose Chicken as my where from.
My where to should display Baked potato, Mutton, fish.
<form class="foodorder hide">...
You need to give class to the button and attach the .on() method with it.
If you have multiple buttons that when you click one, it changes classes & the text inside.
Here is the simple code to do this:
$('.EgClassName').on('click', fun...
How to go to the desired page on clicking a link when the same link is present in more than one page using ui router in angularjs?
If you have one link present in more than one page and you want to redirect to the page from where you came to t...
Hello Reader's!, If you have given a xml data and you need to parse it into Jquery, Then you can use the parseXML function.
Let's see the example below:-
var xml='<Pages><Page Name="test"><controls><test>parsing into ...
HI all,
If you want to convert NSString to NSDate ,then you must use NSDateFormatter to convert please follow this code .
NSString to NSDate
In Objective-C :-
NSString *dateString = @"11-11-2015";
NSDateFormatter *dateFormatter = [[...
Hello friend,
I have a javascipt array object. Now i will try to sort price in this array.
For Example:
var data = [
{
"h_id": "3",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"price"...
Hello readers today we discuss about "HTTP Long Polling".
World-wide-web application coders can put into action an approach called HTTP extended polling, in which the client polls the server looking for brand new data. The particular server ke...
Laravel 4.x we have a facility to get last inserted id easily. By showing one of my code you will get easily understanding.
Example:
$karmaNote = new Karmanote;
$karmaNote ->reqid = $meetingId;
$karmaNote ->conne...
Now there are n number of site which we have to make multilingual. In Laravel we have the facility to make
our site multilingual. In Laravel 4.x we will also make multilingual routes.There are few steps we have to follow to create multilingual t...
Hello readers, today we will discuss about the "SQL query with INNER JOIN".
UPDATE
(SELECT table1.value as OLD, table2.CODE as NEW
FROM table1
INNER JOIN table2
ON table1.value = table2.DESC
WHERE table1.UPDATETYPE='blah'
) t
SET t...
Hello readers, today we will discuss about "Calculating the difference between two dates in PHP".
For example, we have 2 dates and we wants to find the difference between them in php so we can use the below code:
$date1 = "2007-03-24";
$da...
We can validate a textbox on a button click by calling a function and using jquery.
I am using regex for integer and decimal numbers and match method for the comparison.
Here is the code:
<html>
<header ng-controller="menuCont...
In this blog we are inflating the menu by using inflate()method of the menuInflater class this can be performd event handling on menu items, when we need to override then we can used onOptionItemSelected()method of activity class. Hence using bel...
Android developers do face the exception when sending large file from Android device to a server. To send large file to a server you have to make the file into small size chunks and then send it to the server.
setChunkedStreamingMode(1024), thi...
We can create controller and make command using artisan.The syntax for writing command for controller is:
Syntax for writing Controller:
php artisan controller:make ControllerName
Example for writing Controller:
php artisan control...
If you are looking to create Sliding menu in android below example will help you.In android Sliding menu is used to hide and show menu items. In below example I have create multi layouts here like fragment layout using for dividing menu item . fr...
To add class to first child of an element you will use :first selector as follow:
$(selectorname:first).addclass('classname');
For example:
<div class="demo">
<p>hello</p>
<p>hiii</p>
</div>
...
Laravel is very useful when we want to do basic operation .Suppose if we have a condition that we have to
Insert a new record if not exist and update if exist, If we do this task in php then we have to put if-else condition But In Laravel 4.x we...
In case of syntax errors all you need to do to is to turn on error display in the php.ini. You may miss it because of it being turned off by default. Well, they are turned off by default because of a simple reason that a customer does not come a...
If we have two submit buttons and want to detect which one is pressed then simply use post method i.e. $this->request->data.
<?php echo $this->Form->create(false); ?>
<?php echo $this->Form->text('input'); ?>
&l...
Insertion is the very basic feature in every project. When we want to do bulk insertion there are n number of ways are available in Laravel to do bulk insertion. Some of the way to bulk insertion are:
1) By using Raw query in Laravel.
2) By ...
Current URL is : http://mysite.com/MyController/view/page1
but if you want something like :http://mysite.com/MyController/page1
means you want to hide action name from URL.
Then go to app/config/routes.php and type the below code.
Rou...
To implement view Animation in Android follow the steps mentioned below:-
1) Start a new project in android studio.
2) Now create a new Android resource Directory under res directory then choose interpolater option in directory type and nam...
I am using Laravel and I want Automatically deleting rows using Eloquent ORM .In laravel we have deleting
event .By using this "deleting" event we can do all the clean up or what we want to delete we are able to delete.
By using example ...
Namespaces plays an important feature of php. Namespaces are used to solve 2 major issues.
1) Authors of libraries
2) Applications encounter
Laravel 4.x also provide namespace to solve those issues.
The files are app/controllers/F...
Exceptions are the abnormal conditions which generated at the time any runtime error occurred.
To handle these exception is known as exception handling. The exception handling is done to maintain the normal flow of the program. In java there are...
How to refresh the parent window and close the child window on clicking the button in child window using JavaScript
If you want to close your child window and refresh its parent window on click of a button, we can do that with the help of foll...
It is used where ample data is fetched from the query and there are numerous levels of associations between your models.
we use Recursive like this way.
$this->Region->find('all', array('recursive' => 0));
These are levels of ...
Hello Readers ,
In cakephp development framework we will use $this->set() several times .
The set() method is basically use to create a variable in our view file i.e. ctp file .
If suppose we have an array $userprofile and we want to ...
Hello Reader's. If you have given a date and you just need to add or subtract number of days from it then you can use the code below:-
var SubDays = 15;
$.datepicker.formatDate('yy/mm/dd', new Date() - SubDays) ;
Or you can also calculat...
1) Here I will rotate a View around its vertical axis using the rotationY property. we will create an XML resource file in the /res/animator directory named as flip_on_vertical.xml.
<objectAnimator xmlns:android="http://schemas.android.com/...
Hi All,
We in most of our projects in MVC come across creating dropdown list, that can be tricky sometimes. In this blog you all will get a preview of creating a generic function for creating dropdown for any list.
The first thing we need t...
Drupal provide a mean to pass information easily to JavaScript. Many applications want to pass configuration information to JavaScript that runs on a page.
"Hello World!"), 'setting');
//Inline Js
drupal_add_js('alert(Drupal.settings.hellow...