コード例 #1
0
 public function test()
 {
     /*
     $model = new StaticModel(1, 'test');
     $model->update(['name' => 'paolo']);
     $model->update(['age' => '35']);
     $model->update(['like' => ['a','b']]);
     $model->update(['$set' => ['age' => 80]]);
     $model->update(['$inc' => ['age' => 10]]);
     $model->update(['$push' => ['like' => 'c']]);
     $model->update(['$addToSet' => ['like' => 'c']]);
     $model->update(['$pull' => ['like' => 'a']]);
     $model->update(['$pop' => ['like' => -1]]);
     */
     //$model->flush();
     $model2 = new StaticModel(3, 'test2');
     //$model2->findOne();
     //$model2->update([
     //    'name' => ['a'],
     //    'age' => 30,
     //    '$inc' => ['age' => 10]
     //]);
     //$model2->update(['$set' => ['name.0' => 1]]);
     $model2->update(['$unset' => ['name.0' => 1]]);
     //$model2->update(['$unset' => ['age' => 1]]);
     StaticModel::flushAll();
 }
コード例 #2
0
ファイル: static.controller.php プロジェクト: postman0/1chan
 /**
  * Показ статической страницы:
  */
 public function indexAction(Application $application, Template $template)
 {
     if (($page = StaticModel::GetPage($_GET['page'])) != false) {
         if ($page['published'] == true) {
             $template->setParameter('title', $page['title']);
             $this['page'] = $page['name'];
             return true;
         }
     }
     $application->go('errors_error404');
     return false;
 }
コード例 #3
0
ファイル: admin.controller.php プロジェクト: postman0/1chan
 /**
  * Удаление страницы:
  */
 public function staticFilesDeleteAction(Application $application, Template $template)
 {
     StaticModel::RemoveFile($_GET['name']);
     $template->headerSeeOther($_SERVER['HTTP_REFERER']);
     exit;
 }