Skip to content

Instantly share code, notes, and snippets.

@rccc
rccc / gist:cc6aa026ae0c3d01a487ad2068c35d10
Last active June 5, 2023 12:02
Form responses must redirect to another location
public function search(int $page =1, Request $request, SessionInterface $session, SearchService $searchService)
{
$searchType = null;
$result = null;
$queryList = [];
$tmp = [];
$result = $searchService->handleSearchRequest($request, $page);
https://github.com/vlang/v/issues/17635#issuecomment-1467002494
import os
import encoding.csv
fn main(){
csv_name := 'test.csv'
content := os.read_file(csv_name) or {panic(err)}
mut reader := csv.new_reader(content)
import os
fn main(){
mut handler := os.open_append('test.txt') or { panic(err) }
handler.write_string('Hello World again!\r\n') or { panic(err) }
handler.close()
}
import os
fn main(){
mut handler := os.create('test.txt') or { panic(err) }
handler.write_string('Hello World!') or { panic(err) }
handler.close()
}
@rccc
rccc / model
Created February 7, 2023 10:31
<?php
namespace App\Model;
use Doctrine\DBAL\Connection;
class AbstractModel
{
/**
* @var Connection
<?php
namespace riccardonar\Doctrine\DBAL\Types;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
use Doctrine\DBAL\Types\Type;
use riccardonar\IntRange;
class Int4RangeType extends Type
{
namespace UserBundle\Event;
use Symfony\Component\EventDispatcher\Event;
use UserBundle\Entity\User;
class ExportEvent extends Event
{
const USER_REGISTERED = 'user.registered';
protected $usr;

1. Créer le formulaire

Il faut créer un fichier nommé 'searchform-advanced.php.php' et l'intégrer avec : get_template_part( 'advanced', 'searchform' );.

<form method="get" id="advanced-searchform" role="search" action="<?php echo esc_url( home_url( '/' ) ); ?>">

    <h3><?php _e( 'Advanced Search', 'textdomain' ); ?></h3>

    <!-- PASSING THIS TO TRIGGER THE ADVANCED SEARCH RESULT PAGE FROM functions.php -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/rsvp/3.0.6/rsvp.min.js"></script>
var bvm = bvm || {};
bvm.as = {};
bvm.as.asl = (function(jQuery){
var advert_photos = [];
var advert_photos_thumb = [];
var photos_loaded = 0;