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 | |
error_reporting( E_ALL | E_NOTICE | E_STRICT ); | |
/** | |
* SQL for model: | |
CREATE TABLE `temp` ( | |
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY | |
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci; | |
*/ |
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 | |
// -- test1 --------- | |
// throw Phalcon\Tag\Exception: A dependency injector container is required to obtain the "escaper" service | |
Phalcon\Tag::setDefault("name", "test"); | |
echo Phalcon\Tag::getValue("name"); | |
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
<pre><?php | |
$di = new Phalcon\DI\FactoryDefault(); | |
\Phalcon\Tag::getEscaperService(); | |
$string = 'Русский'; | |
Phalcon\Tag::setDefault("name", $string); | |
echo $string; |
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 | |
class Torrent | |
{ | |
public function scrape(array $announce = [ ] , $hash_info = null) | |
{ | |
$r = [ | |
'seeders' => 0 , | |
'leechers' => 0 |
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 | |
class Torrent | |
{ | |
public function scrape(array $announce = [ ] , $hash_info = null) | |
{ | |
$r = [ | |
'seeders' => 0 , | |
'leechers' => 0 |
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 | |
$compiler = new \Phalcon\Mvc\View\Engine\Volt\Compiler(); | |
$compiler->addFunction('not_empty', '!empty'); | |
echo highlight_string($compiler->compileString(' | |
{% if not_empty(userinfo.vk) %} | |
<a id="vk" href="{{ userinfo.vk }}">vk</a> |
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 | |
use Phalcon\DI , Phalcon\Db\Adapter\Pdo\Mysql as Connection , Phalcon\Mvc\Model\Manager as ModelsManager , Phalcon\Mvc\Model\Metadata\Memory as MetaData , Phalcon\Mvc\Model; | |
$di = new DI(); | |
//Setup a connection | |
$di->set( | |
'db' , | |
new Connection(array( |
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 | |
$compiler = new \Phalcon\Mvc\View\Engine\Volt\Compiler(); | |
$compiler->addFunction("test1", function($resolvedArgs, $exprArgs) { | |
$value = $exprArgs[0]['expr']['value']; | |
return str_replace('$', '€', $value); | |
}); |
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
dispatch:beforeDispatchLoop | |
dispatch:beforeDispatch | |
dispatch:beforeNotFoundAction | |
dispatch:beforeExecuteRoute | |
dispatch:afterInitialize | |
dispatch:afterExecuteRoute | |
dispatch:afterDispatch | |
dispatch:afterDispatchLoop | |
dispatch:beforeException |
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 | |
$router = new Phalcon\Mvc\Router(false); | |
$router->notFound(array( | |
'controller' => 'user', | |
'action' => 'show404' | |
)); | |
$router->add('/login/', array( |
OlderNewer