Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View maykonmeier's full-sized avatar

Maykon Ricardo Meier maykonmeier

View GitHub Profile
@maykonmeier
maykonmeier / gist:46f0e27cfe7bf457230b
Last active August 29, 2015 14:04
Operadores aritméticos
<?php
// Soma
$a = 1 + 2;
$total = $a - 1;
// Total is 2
// Negacão
$b = -$a;
<?php
// Define two constants
define('FOO', 2014);
define('FOO_BAR', 'Sea food');
// To print a constant, we have not to use $
echo FOO;
@maykonmeier
maykonmeier / gist:39f87d90dd992e225558
Last active August 29, 2015 14:04
Array and Object type
<?php
// Array
$fruits = array('Apple', 'Orange', 'Pineapple');
// Array key-value
$data = array(
'first_name' => 'Maykon',
@maykonmeier
maykonmeier / gist:71ee012fe944c5bd5307
Last active August 29, 2015 14:04
Variables - Basic types
<?php
// Boolean
$foo = true;
echo $foo;
// Integer
$width = 1024;
$height = 768;
@maykonmeier
maykonmeier / gist:ef2eac469b840080fda6
Last active August 29, 2015 14:04
In block comment
<?php
class Post
{
public function getPost()
{
/*
This code will be ignored because it's commented
$a = 8;
echo $a;
@maykonmeier
maykonmeier / gist:ef7cc6d19be48d706dd2
Last active August 29, 2015 14:04
Inline comment
<?php
class Post
{
public function getPost()
{
// Inline comment
$a = 10;
// This method will return an int 10
@maykonmeier
maykonmeier / gist:0b2dcc6757edcf5d0930
Last active August 29, 2015 14:04
PHP inner HTML
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="short page description, to improve search engines">
<meta name="keywords" content="short keywords, separated by comma">
<title>My blog</title>
</head>
<body>
<h1>
<?php echo 'Meu nome é: '; ?>
@maykonmeier
maykonmeier / index.html
Last active August 29, 2015 14:04
HTML basic
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="short page description, to improve search engines">
<meta name="keywords" content="short keywords, separated by comma">
<title>My blog</title>
</head>
<body>
<h1>My first post</h1>
<h2>Starting HTML</h2>
@maykonmeier
maykonmeier / view.phtml
Created December 3, 2012 16:16
Access another view, setTerminal true set view without layout. You can remove this method.
$htmlViewPart = new ViewModel();
$htmlViewPart->setTerminal(true)
->setTemplate('address/address/edit')
->setVariables(array('form' => $form));
$htmlOutput = $this->getServiceLocator()
->get('viewrenderer')
->render($htmlViewPart);
return $htmlOutput;