当前位置: 首页>>代码示例>>PHP>>正文


PHP Folder::model方法代码示例

本文整理汇总了PHP中Folder::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::model方法的具体用法?PHP Folder::model怎么用?PHP Folder::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Folder的用法示例。


在下文中一共展示了Folder::model方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionDelete

 public function actionDelete()
 {
     $page = Folder::model()->findByPk(Yii::app()->request->getParam('id'));
     if ($page !== null) {
         $page->delete();
     }
     $this->redirect(Yii::app()->createUrl('//documents/admin'));
 }
开发者ID:nilBora,项目名称:MVC_documents_Yii,代码行数:8,代码来源:AdminController.php

示例2: beforeSave

 protected function beforeSave()
 {
     $folderModel = Folder::model()->findByPk($this->folder_id);
     $existingBookmarkModel = Bookmark::model()->findSingleByAttributes(array('user_id' => \GO::user()->id, 'folder_id' => $folderModel->id));
     if (!empty($existingBookmarkModel)) {
         throw new \Exception(str_replace('%fn', $folderModel->name, \GO::t('bookmarkAlreadyExists', 'files')));
     }
     return parent::beforeSave();
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:9,代码来源:Bookmark.php

示例3: NameUnique

 public function NameUnique()
 {
     $m = Folder::model()->findByAttributes(array('name' => $this->name));
     echo "<pre>";
     // print_r($m);
     if (isset($m)) {
         $this->addError("Name", "User with this name already exist and is active.");
     }
 }
开发者ID:nilBora,项目名称:MVC_documents_Yii,代码行数:9,代码来源:Folder.php

示例4: run

 public function run()
 {
     $folder = array();
     $command = Yii::app()->db->createCommand("SELECT DISTINCT document.folder_id as id  FROM `content` LEFT JOIN document ON content.object_id = document.id WHERE content.`object_model`='Document' AND content.space_id=" . Yii::app()->controller->space->id)->queryAll();
     if (sizeof($command) > 0) {
         $id = array();
         foreach ($command as $one) {
             $id[] = $one['id'];
         }
         $folder = Folder::model()->findAllByPk($id);
         $this->render('folderPanel', array('folder' => $folder));
     }
 }
开发者ID:nilBora,项目名称:MVC_documents_Yii,代码行数:13,代码来源:DocumentsDashboardWidget.php

示例5: testQuoting

 public function testQuoting()
 {
     $this->assertEmpty(Folder::model()->findByPk("'"));
     $this->assertEmpty(Folder::model()->ancestorsOf("'")->findAll());
     $this->assertEmpty(Folder::model()->childrenOf("'")->findAll());
     $this->assertEmpty(Folder::model()->parentOf("'")->findAll());
     $this->assertEmpty(Folder::model()->deleteNode("'"));
     $this->assertEmpty(Folder::model()->descendantsOf("'")->findAll());
     $this->assertEmpty(Folder::model()->fullPathOf("'")->findAll());
     $this->assertEmpty(Folder::model()->pathOf("'")->findAll());
     $this->assertEmpty(Folder::model()->unorderedPathOf("'")->findAll());
     /** @var Folder $folder5 */
     $folder5 = Folder::model()->findByPk(5);
     try {
         $folder5->moveTo("'");
         $this->fail();
     } catch (CDbException $e) {
         $this->assertEquals(201, $e->getCode());
     }
     $newFolder = new Folder();
     $newFolder->name = 'Folder';
     $this->assertTrue($newFolder->save());
     $this->assertEquals(1, $newFolder->appendTo("'"));
     try {
         Folder::model()->markAsRoot("'");
         $this->fail();
     } catch (CDbException $e) {
         // http://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html
         $this->assertEquals('1452', $e->errorInfo[1]);
     }
 }
开发者ID:aidask,项目名称:yii-closure-table-behavior,代码行数:31,代码来源:ClosureTableBehaviorTest.php

示例6: array

<?php

echo CHtml::textArea("name", "", array('id' => 'contentForm_question', 'class' => 'form-control autosize contentForm', 'rows' => '1', "tabindex" => "1", "placeholder" => Yii::t('DocumentsModule.widgets_views_pollForm', "Ask something...")));
?>

<div class="contentForm_options">
    <?php 
echo CHtml::textArea("body", "", array('id' => "contentForm_answersText", 'rows' => '5', 'style' => 'height: auto !important;', "class" => "form-control contentForm", "tabindex" => "2", "placeholder" => Yii::t('DocumentsModule.widgets_views_pollForm', "Possible answers (one per line)")));
?>
</div>

<div class="contentForm_options">
    <?php 
$models = Folder::model()->findAll();
?>

    <?php 
echo CHtml::dropDownList('selectFolder', 'name', CHtml::listData($models, 'id', 'name'), array('empty' => Yii::t('DocumentsModule.widgets_views_pollForm', "Select a folder"), 'class' => 'form-control contentForm'));
?>
</div>
开发者ID:nilBora,项目名称:MVC_documents_Yii,代码行数:20,代码来源:pollForm.php


注:本文中的Folder::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。