This file contains 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 | |
require 'site_url.php'; | |
echo site_url(array('blog','como-criar-url')); | |
// output: http://www.jonathanfontes.pt/blog/como-criar-url | |
echo site_url('blog/como-criar-url'); | |
// output: http://www.jonathanfontes.pt/blog/como-criar-url |
This file contains 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
(c) Copyright 2012 Jonathan Fontes. | |
Licensed under the MIT license: | |
http://www.opensource.org/licenses/mit-license.php | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains 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 | |
// Exists functions gmp_gcd ? | |
if(!function_exists('gmp_gcd')){ | |
// No, so create | |
// find greatest common divisor | |
function gmp_gcd($a, $b) { | |
while ($b != 0) | |
$remainder = $a % $b; | |
$a = $b; |
This file contains 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 | |
// Function similar of MVC sistem | |
function view ( $file , $data = null){ | |
// IF data different of null and diferrent than array | |
if($data!= NULL && !is_array($data)){ | |
// Erro, expection. | |
throw new Exception('Data view isn\'t valid!'); | |
return false; | |
} |
NewerOlder