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 | |
| $router = new Phalcon\Mvc\Router(false); | |
| $router->add('/:controller', | |
| array( | |
| 'module' => 'common', | |
| 'controller' => 1 | |
| ) | |
| ); |
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 | |
| $di->set('db', function() use ($config) { | |
| $connection = new \Phalcon\Db\Adapter\Pdo\Mysql(array( | |
| "host" => "localhost", | |
| "username" => "root", | |
| "password" => "secret", | |
| "dbname" => "test", | |
| "options" => array( |
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 | |
| $security = new Phalcon\Security(); | |
| for ($i = 8; $i < 12; $i++) { | |
| $hash = $security->hash('a', $i); | |
| $this->assertTrue($security->checkHash('a', $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
| <?php | |
| $user = new Users(); | |
| $profile = new Profile(); | |
| $user->name = "Mark"; | |
| $user->profile = $profile; |
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 echo $this->dialog->render("dialog", "Basic dialog", "This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.") ?> |
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 echo $this->widgets->create('dialog')->render(array( | |
| "name" => "dialog", | |
| "title" => "Basic dialog", | |
| "content" => "This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon." | |
| )) ?> |
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\Forms\Elements\Text as TextElement; | |
| use Phalcon\Forms\Elements\TextArea as TextAreaElement; | |
| use Phalcon\Validation\StringLength; | |
| use Phalcon\Validation\PresenceOf; | |
| class PostsController extends \Phalcon\Mvc\Controller | |
| { |
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
| RoutePrefix: /posts | |
| Route: Array | |
| ( | |
| [0] => /edit/{id} | |
| [methods] => Array | |
| ( | |
| [0] => GET | |
| [1] => POST | |
| ) |
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 Robots extends Phalcon\Mvc\Model | |
| { | |
| public function initialize() | |
| { | |
| $this->hasMany('id', 'RobotsParts', 'robots_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 | |
| /** | |
| * @RoutePrefix("/robots") | |
| */ | |
| class RobotsController extends Phalcon\Mvc\Controller | |
| { | |
| /** | |
| * @Get("/") |