<?php
// in the Controller
// ...
public function selectList($type_list, $ref_id = null){
if($type_list == 'provinces' && $ref_id != null){
$list = $this->Provinces->find('list')
->where(['country_id'=>$ref_id])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Javascript to enable link to tab | |
| var url = document.location.toString(); | |
| if (url.match('#')) { | |
| $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show'); | |
| } | |
| // Change hash for page-reload | |
| $('.nav-tabs a').on('shown.bs.tab', function ( e ) { | |
| window.location.hash = e.target.hash; | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p> | |
| <?php | |
| echo $this->Paginator->counter(array( | |
| 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') | |
| )); | |
| ?> | |
| </p> | |
| <ul class="pagination"> | |
| <?php | |
| echo $this->Paginator->prev('«', array('tag' => 'li', 'escape' => false), '<a href="#">«</a>', array('class' => 'prev disabled', 'tag' => 'li', 'escape' => false)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule ^(.*)$ index.php/$1 [L] | |
| </IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ---------------------------------------------------------------------- | |
| # Expires headers (for better cache control) | |
| # ---------------------------------------------------------------------- | |
| # | |
| # These are pretty far-future expires headers | |
| # They assume you control versioning with cachebusting query params like: | |
| # <script src="application.js?20100608"> | |
| # Additionally, consider that outdated proxies may miscache | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ini_set('display_errors', 'On'); | |
| error_reporting(E_ALL); | |
| // Code... | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var isMobile = { | |
| Android: function() { | |
| return navigator.userAgent.match(/Android/i); | |
| }, | |
| BlackBerry: function() { | |
| return navigator.userAgent.match(/BlackBerry/i); | |
| }, | |
| iOS: function() { | |
| return navigator.userAgent.match(/iPhone|iPad|iPod/i); | |
| }, |
- Website: http://sass-lang.com/
- Docs: http://sass-lang.com/guide
- Tutorial: https://www.codecademy.com/learn/learn-sass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast) | |
| (function poll(){ | |
| $.ajax({ url: "server", success: function(data){ | |
| //Update your dashboard gauge | |
| salesGauge.setValue(data.value); | |
| }, dataType: "json", complete: poll, timeout: 30000 }); | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h2>Stacked Bootstrap Modal Example.</h2> | |
| <a data-toggle="modal" href="#myModal" class="btn btn-primary">Launch modal</a> | |
| <div class="modal fade" id="myModal"> | |
| <div class="modal-dialog"> | |
| <div class="modal-content"> | |
| <div class="modal-header"> | |
| <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
| <h4 class="modal-title">Modal 1</h4> |