Skip to content

Instantly share code, notes, and snippets.

View jaydipsinh's full-sized avatar

jaydipsinh gohil jaydipsinh

  • ahmedabad
View GitHub Profile
@jaydipsinh
jaydipsinh / symfony2cmd
Created April 17, 2015 06:41
Symfony 2 basic command
======================================================================
Symfony 2 basic command
======================================================================
php app/console cache:clear --env=prod --no-debug
generate bundle
php app/console generate:bundle --namespace=Acme/StoreBundle
parameters.yml
php app/console doctrine:database:create
@jaydipsinh
jaydipsinh / namespace
Last active August 29, 2015 14:19
namespace example easy to understand
<?php
use App\Lib1\MyClass1 as MC1;
use App\Lib1\MyClass2 as MC2;
use App\Lib1\MyClass3 as MC3;
//require_once("App\Lib1\MyClass1.php");
//echo \App\Lib1\MYCONST . "\n";
@jaydipsinh
jaydipsinh / bundle_twig
Last active August 29, 2015 14:19
symfony 2 bundle, generating bundle, controller, twig, request, response, Managing session, Configuration files, Configure Doctrine
What is bundle?
• Bundle is a set of files and directories.
• Bundle is a totally separate code that you can easily import or create
your own into your project. It is not like a fully developed plugin or blog,
you need to optimize it.
• Registering a bundle(AppKernel class)
Rules for generating a bundle
• Use only alphanumeric characters and underscores;
• Use a CamelCased name;
@jaydipsinh
jaydipsinh / samplle_flatten.php
Created August 8, 2018 13:59
flatten an array of arbitrarily nested arrays of integers into a flat array of integers
<?php
// [[1,2,[3]],4] -> [1,2,3,4]
$array = array(array(1,2,array(3)),4);
function citrusbyte_test_array($array,$returnVal) {
for($i = 0; $i <= count($array); $i++) {
if(isset($array[$i])&& is_array($array[$i])) {
$returnVal = citrusbyte_test_array($array[$i], $returnVal);