PHP exposes a number of so-called global variables which contain information about the HTTP request, such as $_POST, $_GET, $_FILES, $_SESSION, etc. The Request class contains a static createFromGlobals() method in order to instantiate a request object based on these variables:
use Symfony\Componen...
Installation or Setup Slim framework
Install Composer
Open cmd
Go to Root directory of your Project Folder and Run Following Command.
composer require slim/slim "^3.0"
Now you will have vendor directory in your project
Next Create Index.php in root folder and add following co...
Launch screen is a screen which appears while launching app and lasts till first screen of app appears.
Learn more about Launch Screen and guidelines here.
Similar to AppIcons we have to mention in project settings about using image assets for launch screen image.
By default project settings are ...
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require 'vendor/autoload.php';
$app = new \Slim\App;
$app->get('/employee/view', function ($req, $res) {
$con = new mysqli('localhost','USERNAME','PASSWORD','DATABASE');
...
Sympy is made for symbolic math, so let's have a look at some basic integration and differentiation.
from sympy import symbols, sqrt, exp, diff, integrate, pprint
x, y = symbols(...
There are various types of inheritance and code reuse in Twig:
Include
The main goal is code reuse. Consider using header.html.twig & footer.html.twig inside base.html.twig as an example.
header.html.twig
<nav>
<div>Homepage</div>
<div>About</div>
</...
Using the command git tag lists out all available tags:
$ git tag
<output follows>
v0.1
v1.3
Note: the tags are output in an alphabetical order.
One may also search for available tags:
$ git tag -l "v1.8.5*"
<output follows>
v1.8.5
v1.8.5-rc0
v1.8.5-rc1
v1.8.5...
The ternary operator (?:)
Support for the extended ternary operator was added in Twig 1.12.0.
{{ foo ? 'yes' : 'no' }}
Evaluates:
if foo echo yes else echo no
{{ foo ?: 'no' }}
or
{{ foo ? foo : 'no' }}
Evaluates:
if foo echo it, else echo no
{{ foo ? 'yes' }}
or
{{ f...
In Kotlin, variable declarations look a bit different than Java's:
val i : Int = 42
They start with either val or var, making the declaration final ("value") or variable.
The type is noted after the name, separated by a :
Thanks to Kotlin's type inference the explicit typ...
Kotlin does not need ; to end statements
Kotlin is null-safe
Kotlin is 100% Java interoperable
Kotlin has no primitives (but optimizes their object counterparts for the JVM, if possible)
Kotlin classes have properties, not fields
Kotlin offers data classes with auto-generated equals/hashCode ...
Kotlin uses == for equality (that is, calls equals internally) and === for referential identity.
JavaKotlina.equals(b);a == ba == b;a === ba != b;a !== b
See: https://kotlinlang.org/docs/reference/equality.html
You can use django rest framework permission classes to check request headers and authenticate user requests
Define your secret_key on project settings
API_KEY_SECRET = 'secret_value'
note: a good practice is to use environment variables to store this secret value.
Define a permission ...
Prior to iOS 7 when you want to scan a QR code, we might need to rely on third party frameworks or libraries like zBar or zXing. But Apple introduced AVCaptureMetaDataOutput from iOS 7 for reading barcodes.
To read QR code using AVFoundation we need to setup/create AVCaptureSession and use captureO...
in Startup.cs
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
var controllerActivator = new CompositionRoot();
services...
One of the features in SugarCRM 7.x is being able to easily add and extend custom endpoints to accomplish what you require.
In this example, we'll create a couple of custom endpoints to return some data about the request.
This custom file is being placed in custom/clients/base/api/DescriptionAPI.p...