Skip to content

Instantly share code, notes, and snippets.

View ertankayalar's full-sized avatar
🏠
Working from home

Ertan Kayalar ertankayalar

🏠
Working from home
View GitHub Profile
<?php
$this->render('//site/error', array('message' => 'hata mesajı', 'code' => '123'));
@ertankayalar
ertankayalar / yii-get-user-ip-address.php
Created June 22, 2013 14:09
yii get user ip address
<?php
$newOrder->ip = Yii::app()->request->userHostAddress;
<?php
/**
* Ban/Limit Email Domains for Gravity Form Email Fields
* http://gravitywiz.com/2012/11/11/banlimit-email-domains-for-gravity-form-email-fields/
*/
class GWEmailDomainControl {
private $_args;
function __construct($args) {
<?php
/*
INSTRUCTIONS:
Use at your own risk. Backup your database before continuing.
1. Copy code to a file in the root of your website.
2. Change YOUR_SITE_ROOT to a value that makes sense.
3. Execute by visiting the page. Verify before/after results.
4. Change MAKE_CHANGES_TO_SITE to true and execute it again.
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; //this line only needed for pagination
$args = array(
'cat' => 7,
'paged' => $paged //this line only needed for pagination
);
// The Query
$the_query = new WP_Query( $args );
// The Loop
div.post-content { display:none; } a.continue-button { color: white; }
@ertankayalar
ertankayalar / .bash_aliases
Last active October 13, 2021 09:42
Bash Aliases for Symfony
#symfony aliases
alias sf="php bin/console"
alias sfp="php bin/console --env=prod"
alias sft="php bin/console --env=test"
alias sfcc="php bin/console cache:clear"
alias sfcw="php bin/console cache:warmup"
# symfony router
@ertankayalar
ertankayalar / index.html.twig
Created May 7, 2018 09:48
Simple Twig Example
// templates/category/index.html.twig
{% extends 'main.html.twig' %}
{% block body %}
<div class="container">
<div class="row">
<h1>Yeni Kategori Ekleme</h1>
</div>
<div class="row">
{{ include('category/_form.html.twig',
{ form: form, button_label: 'kaydet', include_back_to_home_link: true, },
@ertankayalar
ertankayalar / BlogController.php
Created May 7, 2018 09:49
Simple Symfony Blog Controller
// src/Controller/BlogController.php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Annotation\Route;
class BlogController extends Controller
{
/**
@ertankayalar
ertankayalar / Symfony Direcotry Structure.txt
Created May 7, 2018 09:55
Symfony Directory Structure
├── bin
├── config
│ ├── packages
│ └── routes
├── public
├── src
│ ├── Controller
│ ├── Entity