Skip to content

Instantly share code, notes, and snippets.

View impronta48's full-sized avatar
🎯
Focusing

iMpronta48 impronta48

🎯
Focusing
View GitHub Profile
@motsmanish
motsmanish / pagination.php
Created October 5, 2020 09:38
Pagination code for Cakephp 4 + Bootstrap 4
<?php
$this->Paginator->setTemplates([
'first' => '<li class="page-item"><a class="page-link" href="{{url}}">{{text}}</a></li>',
'prevActive' => '<li class="page-item"><a class="page-link" href="{{url}}">{{text}}</a></li>',
'prevDisabled' => '<li class="page-item disabled"><a class="page-link" href="{{url}}">{{text}}</a></li>',
'current' => '<li class="page-item"><a class="page-link" href="{{url}}">{{text}}</a></li>',
'number' => '<li class="page-item"><a class="page-link" href="{{url}}">{{text}}</a></li>',
'nextActive' => '<li class="page-item"><a class="page-link" href="{{url}}">{{text}}</a></li>',
'nextDisabled' => '<li class="page-item disabled"><a class="page-link" href="{{url}}">{{text}}</a></li>',
'last' => '<li class="page-item"><a class="page-link" href="{{url}}">{{text}}</a></li>'
@taleeb35
taleeb35 / ChainSelection.php
Created September 20, 2014 03:32
Chain Selection in Cakephp
<?php
App::uses('AppController', 'Controller');
class CountriesController extends AppController {
public $helpers = array('Js');
public $components = array('RequestHandler');
public function select() {
$countries = $this->Country->find('list');
@Xhamps
Xhamps / remove-bom.php
Created June 13, 2014 20:14
Remove Bom
<?php
// Tell me the root folder path.
// You can also try this one
// $HOME = $_SERVER["DOCUMENT_ROOT"];
// Or this
// dirname(__FILE__)
$HOME = dirname(__FILE__);
// Is this a Windows host ? If it is, change this line to $WIN = 1;
$WIN = 0;
@tlongren
tlongren / example.php
Last active December 23, 2020 13:32
PHP Clean URL (SLUG) Generator
<?php
$slug = slugit("thank you for visiting");
echo $slug;
// returns: thank-you-for-visiting
?>
@junichi11
junichi11 / ClearCacheSell.php
Created October 18, 2011 12:21
Clear Cache Shell for CakePHP2.0
<?php
/**
* CakePHP ClearCacheShell for 2.0
* @author junichi11
*/
class ClearCacheShell extends AppShell {
public $uses = array();
public $task = array();