Skip to content

Instantly share code, notes, and snippets.

@Raistlfiren
Raistlfiren / openMap.js
Created November 10, 2014 14:27
Plot points on map in Openlayers with USGS and Google Maps Support
/*
* @var lat = latitude
* @var lng = Longitude
* @var id = plotting multiple maps on a map
* If you are just using one map, you can remove the ID from here
* Logical function to plot points on openlayers map with support of USGS and Google Maps
*/
function openMap(lat, lng, id) {
var layer;
{# Navigation Template - Output Template you created as menu #}
{{ knp_menu_render('CoreBundle:Builder:mainMenu',
{
'template': 'CoreBundle:partials:knp_menu.html.twig',
'currentClass': 'nav-active'
})
}}
{# knp_menu.html.twig #}
@Raistlfiren
Raistlfiren / deploy.rb
Created November 10, 2015 19:43
app/config/deploy.rb
set :application, "Test Application"
set :domain, "domain.com"
set :deploy_to, "/home/user/www/directory"
set :app_path, "app"
set :repository, "git@github.com/..."
set :scm, :git
set :scm_verbose, :true
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`
@Raistlfiren
Raistlfiren / collection.php
Created November 19, 2015 15:28
Form with Form Collection....
<?php
namespace Test\VehicleBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class LicensesFormType extends AbstractType
{
<?php
if (isset($taxonomy['listing_records'])) {
$amount = $taxonomy['listing_records'];
} else {
$amount = $app['config']->get('general/listing_records');
}
if (isset($taxonomy['listing_sort'])) {
$amount = $taxonomy['listing_sort'];
@Raistlfiren
Raistlfiren / cartHandler.php
Created December 8, 2015 23:36
Cart Handler
<?php
public function storeInSession()
{
if (! $this->session->isStarted()) {
$this->session->start();
$this->initializeCart($this->session);
} else {
if (! $this->session->has('cart')) {
$this->initializeCart($this->session);
@Raistlfiren
Raistlfiren / CartExample.php
Created December 8, 2015 23:57
Cart Instance
<?php
namespace FrontEnd\CartBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* CartItem
*
* @ORM\Table()
@Raistlfiren
Raistlfiren / service.php
Created December 15, 2015 22:20
Simple Example
<?php
use Doctrine\Common\Persistence\ObjectManager;
class Lead
{
protected $POST_Data;
protected $_em;
@Raistlfiren
Raistlfiren / Passwords.php
Created December 21, 2015 17:20
Password
<?php
//UserAdmin Form
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', 'email', array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle'))
->add('username', null, array('label' => 'form.username', 'translation_domain' => 'FOSUserBundle'))
@Raistlfiren
Raistlfiren / form.php
Created December 21, 2015 17:31
form
<?php
public function buildForm(FormBuilderInterface $builder, array $options)
{
if ($options['required']) {
$placeholder = 'test';
} else {
$placeholder = 'nope';
}