yiiapi/framework/cli/commands/shell/ModuleCommand.php

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * ModuleCommand class file.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.yiiframework.com/
 * @copyright 2008-2013 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 * @version $Id: ModuleCommand.php 433 2008-12-30 22:59:17Z qiang.xue $
 */

/**
 * ModuleCommand generates a controller class.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @version $Id: ModuleCommand.php 433 2008-12-30 22:59:17Z qiang.xue $
 * @package system.cli.commands.shell
 */
class ModuleCommand extends CConsoleCommand
{
	/**
	 * @var string the directory that contains templates for the module command.
	 * Defaults to null, meaning using 'framework/cli/views/shell/module'.
	 * 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
  module <module-ID>

DESCRIPTION
  This command generates an application module.

PARAMETERS
 * module-ID: required, module ID. It is case-sensitive.

EOD;
	}

	/**
	 * Execute the action.
	 * @param array $args command line parameters specific for this command
	 * @return integer|null non zero application exit code for help or null on success
	 */
	public function run($args)
	{
		if(!isset($args[0]))
		{
			echo "Error: module ID is required.\n";
			echo $this->getHelp();
			return 1;
		}

		$moduleID=$args[0];
		$moduleClass=ucfirst($moduleID).'Module';
		$modulePath=Yii::app()->getModulePath().DIRECTORY_SEPARATOR.$moduleID;
后面还有 33 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。