AngularJS Controllers

AngularJS controllers control the data of AngularJS applications. AngularJS controllers are regular JavaScript Objects. AngularJS applications are controlled by controllers. The ng-controller directive defines the application controller. A controller is a JavaScript Object, created by a standard JavaScript object constructor. Example <div ng-app=”myApp” ng-controller=”myCtrl”> First Name: <input type=”text” ng-model=”firstName”> Last Name: <input type=”text” ng-model=”lastName”> Full… Read More »

AngularJS Expressions

AngularJS expressions are written inside double braces: {{ expression }}. AngularJS expressions binds data to HTML the same way as the ng-bind directive. AngularJS will “output” data exactly where the expression is written. AngularJS expressions are much like JavaScript expressions: They can contain literals, operators, and variables. Example {{ 5 + 5 }} or {{… Read More »

AngularJS – Directives

AngularJS directives are used to extend HTML. These are special attributes starting with ng- prefix. We’re going to discuss following directives − ng-app − This directive starts an AngularJS Application. ng-init − This directive initializes application data. ng-model − This directive defines the model that is variable to be used in AngularJS. ng-repeat − This… Read More »

Start learning AngularJS

In this chapter we will discuss about how to set up AngularJS library to be used in web application development. We will also briefly study the directory structure and its contents. AngularJS is a JavaScript framework. It is a library written in JavaScript. AngularJS is distributed as a JavaScript file, and can be added to… Read More »

Using variables in CSS style sheets

One advantage of CSS is that your styles can be kept in a separate file from the pages that use them. This is simply a text file that ends with the .css suffix such as style.css. The suffix tells the server to treat the contents of the file as CSS. Unfortunately, the CSS standard doesn’t… Read More »

Category: PHP

Interfaces Abstract Classes and the Adapter Pattern

PHP 5 made significant improvements on the Object Orientated programming model of PHP 4 bringing it more in line with languages such as Visual Basic .NET and Java. The improved object model in PHP 5 makes developing applications using OOP much easier and gives you the programmer, greater flexibility. The first features new to PHP… Read More »

Category: PHP

Remove a Query String Key=>Value using PHP

I needed to find a PHP function that would allow me to remove keys (and their values) easily and reliably. /* the function */ function remove_querystring_var($url, $key) {   $url = preg_replace(‘/(.*)(?|&)’ . $key . ‘=[^&]+?(&)(.*)/i’, ‘$1$2$4’, $url . ‘&’);   $url = substr($url, 0, -1);   return $url; }

Category: PHP

The PHP Class with Dynamic Functions

class Record {     /* record information will be held in here */   private $info;     /* constructor */   function Record($record_array) {     $this->info = $record_array;   }     /* dynamic function server */   function __call($method,$arguments) {     $meth = $this->from_camel_case(substr($method,3,strlen($method)-3));     return array_key_exists($meth,$this->info) ? $this->info[$meth] : false;  … Read More »

Category: PHP

Php Writing to csv file

In this code am taking in a variable from a dynamic form($search). The variable is 10 random unique numbers. It was put into the form from a text/csv file. In this I need to write each line of the text/csv file into an array except the $search number, delete the contents of the file &… Read More »

Category: PHP

PHP Class Tutorial: Working with Methods

Class properties allow your objects to store data and class methods allow your objects to perform tasks. What are Class Methods Methods are special functions declared within a class. As you might expect, a method declaration resembles a function declaration. The function keyword precedes a method name, followed by an optional list of argument variables… Read More »

Category: PHP