Tutorial by Examples: er

Dependencies can also be injected by setters. interface Logger { public function log($message); } class Component { private $logger; private $databaseConnection; public function __construct(DatabaseConnection $databaseConnection) { $this->databaseConnection = $...
ASP.NET is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. ASP.NET is part of the .NET Framework, and when coding ASP.NET applications you have access to classes in the .NET Framework. You can code you...
PHP 5.x5.4 When you build REST API's, you may need to reduce the information of an object to be passed to the client application. For this purpose, this example illustrates how to use the JsonSerialiazble interface. In this example, the class User actually extends a DB model object of a hypotetica...
[JsonObject("person")] public class Person { [JsonProperty("name")] public string PersonName { get; set; } [JsonProperty("age")] public int PersonAge { get; set; } [JsonIgnore] public string Address { get; set; } } Person person = new...
We can use the Service Container as a Dependency Injection Container by binding the creation process of objects with their dependencies in one point of the application Let's suppose that the creation of a PdfCreator needs two objects as dependencies; every time we need to build an instance of PdfCr...
There are multiple ways to create a sequence. You can use functions from the Seq module: // Create an empty generic sequence let emptySeq = Seq.empty // Create an empty int sequence let emptyIntSeq = Seq.empty<int> // Create a sequence with one element let singletonSeq = Seq.s...
/// <summary> /// Gets displayName from DataAnnotations attribute /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <pa...
/// <summary> /// Creates simple button /// </summary> /// <param name="poHelper"></param> /// <param name="psValue"></param> /// <returns></returns> public static MvcHtmlString SubmitButton(this HtmlHelper poHelper, string ps...
You can select certain items out of a collection by using the where() method. $data = [ ['name' => 'Taylor', 'coffee_drinker' => true], ['name' => 'Matt', 'coffee_drinker' => true] ]; $matt = collect($data)->where('name', 'Matt'); This bit of code will select all it...
AngularJS has digest loop and all your functions in a view and filters are executed every time the digest cycle is run. The digest loop will be executed whenever the model is updated and it can slow down your app (filter can be hit multiple times, before the page is loaded). You should avoid this: ...
Watchers needed for watch some value and detect that this value is changed. After call $watch() or $watchCollection new watcher add to internal watcher collection in current scope. So, what is watcher? Watcher is a simple function, which is called on every digest cycle, and returns some value. An...
You need to having a server running online. To securely associate your iOS app with a server, Apple requires that you make available a configuration file, called apple-app-site-association. This is a JSON file which describes the domain and supported routes. The apple-app-site-association file need...
The setup on the app side requires two things: Configuring the app’s entitlement, and enabling the universal links by turning on the Associated Domains capability in the project. Handling Incoming Links in your AppDelegate. 1. Configuring the app’s entitlement, and enabling universal links. ...
PHP provides an alternative syntax for some control structures: if, while, for, foreach, and switch. When compared to the normal syntax, the difference is, that the opening brace is replaced by a colon (:) and the closing brace is replaced by endif;, endwhile;, endfor;, endforeach;, or endswitch;, ...
You must be very careful when providing a forwarding reference overload as it may match too well: struct A { A() = default; // #1 A(A const& ) = default; // #2 template <class T> A(T&& ); // #3 }; The intent here was that A is c...
Pointers can also be used to point at functions. Let's take a basic function: int my_function(int a, int b) { return 2 * a + 3 * b; } Now, let's define a pointer of that function's type: int (*my_pointer)(int, int); To create one, just use this template: return_type_of_func (*my_fun...
In Index page change the following: error_reporting(E_ALL | E_STRICT); to error_reporting(E_ALL); Set $_SERVER['MAGE_IS_DEVELOPER_MODE'] = true and uncomment this line (remove the #) #ini_set('display_errors', 1); You can also Set Dev Mode using SetEnv in your .htaccess file To make th...
Active patterns are just simple functions. Like functions you can define additional parameters: let (|HasExtension|_|) expected (uri : string) = let result = uri.EndsWith (expected, StringComparison.CurrentCultureIgnoreCase) match result with | true -> Some true | _ -> N...
SP.SOD.executeOrDelayUntilScriptLoaded(showDialog,"sp.js"); function showDialog(){ var options = SP.UI.$create_DialogOptions(); options.url = "/mySite/lists/myList/NewForm.aspx"; options.dialogReturnValueCallback = myCallBackFunction; SP.UI.ModalDialog.show...
Creating List Items SP.SOD.executeOrDelayUntilScriptLoaded(createItem,"sp.js"); function createItem(){ var clientContext = new SP.ClientContext(); var list = clientContext.get_web().get_lists().getByTitle("List Title"); var newItem = list.addItem(); newIte...

Page 94 of 417