在phalcon中model字段设置了not null在使用时候自动设置为空字符串或者0. 我们需要写一个监听方法beforeValidation框架底层会自动调用。 <?php /*...
phalcon模型中绑定数组参数类型
<?php $sets = Example::find(< "id IN ({id:array})", "bind" => > >); foreach($sets as $set) { ... ...
phalcon模型字段别名映射
<?php class Robots extends \Phalcon\Mvc\Model { public $code; public $theYear; public $theName; p...
phalcon将路由将驼峰换成分隔符
如原始网址为:http://example.com/admin/products/show-latest-products。 例如,您希望将show-latest-products指定ShowLate...
在phalcon中使用自定义事件
lass Comment { const NAME = 'comment'; const NAME_PUBLISH = 'comment:publish'; } class CommentListen...
phalcon控制器方法返回json
Base控制器实现afterExecuteRoute方法: /** * @param Dispatcher $dispatcher */ public function afterExecuteRou...
phalcon视图中获取常量
使用函数 constant(): {{ constant("DIRECTORY_SEPARATOR") }} {{ constant("Phalcon\Logger::ERROR") }}