libs/Yii/cli/commands/shell/FormCommand.php
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* FormCommand class file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright © 2008-2011 Yii Software LLC
* @license http://www.yiiframework.com/license/
* @version $Id$
*/
/**
* FormCommand generates a form view based on a specified model.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id$
* @package system.cli.commands.shell
* @since 1.0
*/
class FormCommand extends CConsoleCommand
{
/**
* @var string the directory that contains templates for the form command.
* Defaults to null, meaning using 'framework/cli/views/shell/form'.
* If you set this path and some views are missing in the directory,
* the default views will be used.
*/
public $templatePath;
public function getHelp()
{
return <<<EOD
USAGE
form <model-class> <view-name> [scenario]
DESCRIPTION
This command generates a form view that can be used to collect inputs
for the specified model.
PARAMETERS
* model-class: required, model class. This can be either the name of
the model class (e.g. 'ContactForm') or the path alias of the model
class file (e.g. 'application.models.ContactForm'). The former can
be used only if the class can be autoloaded.
* view-name: required, the name of the view to be generated. This should
be the path alias of the view script (e.g. 'application.views.site.contact').
* scenario: optional, the name of the scenario in which the model is used
(e.g. 'update', 'login'). This determines which model attributes the
generated form view will be used to collect user inputs for. If this
is not provided, the scenario will be assumed to be '' (empty string).
EXAMPLES
* Generates the view script for the 'ContactForm' model:
form ContactForm application.views.site.contact
EOD;
}
后面还有 64 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
