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 | |
| use Phalcon\DI, | |
| Phalcon\Events\Manager as EventsManager, | |
| Phalcon\Db\Adapter\Pdo\Sqlite as Connection, | |
| Phalcon\Mvc\Model\Manager as ModelsManager, | |
| Phalcon\Mvc\Model\Metadata\Memory as ModelsMetaData; | |
| $eventsManager = new EventsManager(); |
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 | |
| use Phalcon\DI, | |
| Phalcon\Events\Manager as EventsManager, | |
| Phalcon\Db\Adapter\Pdo\Sqlite as Connection, | |
| Phalcon\Mvc\Model\Manager as ModelsManager, | |
| Phalcon\Mvc\Model\Metadata\Memory as ModelsMetaData; | |
| $eventsManager = new EventsManager(); |
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 | |
| /** | |
| * @RoutePrefix("/users") | |
| */ | |
| class UsersController | |
| { | |
| /** | |
| * @Get('/') | |
| */ |
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 | |
| class XSession extends Phalcon\Session\Adapter implements | |
| Phalcon\Session\AdapterInterface, | |
| Phalcon\DI\InjectionAwareInterface | |
| { | |
| protected $_dependencyInjector; | |
| public function setDI($di) |
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 | |
| $acl = new \Phalcon\Acl\Adapter\Memory(); | |
| $acl->setDefaultAction(\Phalcon\Acl::DENY); | |
| //Register roles | |
| $roles = array( | |
| 'users' => new \Phalcon\Acl\Role('Users'), | |
| 'guests' => new \Phalcon\Acl\Role('Guests') |
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 | |
| $c = new Phalcon\Mvc\View\Engine\Volt\Compiler(); | |
| echo htmlentities($c->compileString('{{ a._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
| <?php | |
| class Foo | |
| { | |
| protected $_myProp = 0; | |
| protected function x() | |
| { | |
| $this->y(); | |
| } |
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
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script> | |
| <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script> | |
| <script src="https://raw.github.com/twitter/bootstrap/master/js/bootstrap-tab.js" type="text/javascript"></script> | |
| <script src="http://static.ffff.niden.net/_www/highlight.pack.js" type="text/javascript"></script> | |
| <script src="http://static.ffff.niden.net/_www/helper.js" type="text/javascript"></script |
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 | |
| namespace Phalcon; | |
| error_reporting(E_ALL & E_NOTICE); | |
| try { | |
| $unavailable_database = array('username' => 'non', 'password' => 'hea'); | |
| $db = new Db\Adapter\Pdo\Mysql($unavailable_database); | |
| } catch(\PDOException $e) { |
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 | |
| $eventsManager = new \Phalcon\Events\Manager(); | |
| $di = new \Phalcon\DI(); | |
| $connection = new \Phalcon\Db\Adapter\Pdo\Sqlite([ | |
| "dbname" => "sample.db" | |
| ]); |