-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
296 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: yidashi | ||
* Date: 2017/2/11 | ||
* Time: 下午9:43 | ||
*/ | ||
|
||
namespace backend\widgets; | ||
|
||
|
||
use yii\helpers\ArrayHelper; | ||
use yii\helpers\Html; | ||
|
||
class ActiveField extends \yii\widgets\ActiveField | ||
{ | ||
public function staticControl($options = []) | ||
{ | ||
$this->adjustLabelFor($options); | ||
$this->parts['{input}'] = Html::activeStaticControl($this->model, $this->attribute, $options); | ||
return $this; | ||
} | ||
|
||
public function suffix($suffix = '', $suffixType = 'addon', $size = 300) | ||
{ | ||
$size = !empty($size) ? "input-group-{$size} " : ''; | ||
$this->template = "{label}\n<div class=\"input-group $size\">{input}\n<div class=\"input-group-" . $suffixType . "\">" . $suffix . "</div></div>\n{hint}\n{error}"; | ||
return $this; | ||
} | ||
|
||
public function prefix($prefix = '', $prefixType = 'addon', $size = 300) | ||
{ | ||
$size = !empty($size) ? "input-group-{$size} " : ''; | ||
$this->template = "{label}\n<div class=\"input-group $size\"><div class=\"input-group-" . $prefixType . "\">" . $prefix . "</div>\n{input}</div>\n{hint}\n{error}"; | ||
return $this; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/** | ||
* Created by PhpStorm. | ||
* User: yidashi | ||
* Date: 2017/2/16 | ||
* Time: 下午9:32 | ||
*/ | ||
|
||
namespace common\modules\book; | ||
|
||
use yii\base\BootstrapInterface; | ||
|
||
class Module extends \yii\base\Module implements BootstrapInterface | ||
{ | ||
public function bootstrap($app) | ||
{ | ||
if ($app->id == 'app-backend') { | ||
$app->urlManager->addRules([ | ||
'book/<action:\S+>' => 'book/admin/<action>', | ||
], false); | ||
} else if ($app->id == 'app-frontend') { | ||
$app->urlManager->addRules([ | ||
'books' => '/book/default/index', | ||
'book/<id:\d+>' => '/book/default/view', | ||
'book/chapter/<id:\d>' => '/book/default/chapter', | ||
'book/<action:\S+>' => 'book/default/<action>', | ||
], false); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
common/models/BookChapter.php → common/modules/book/models/BookChapter.php
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
Oops, something went wrong.