-
database connection, in /protected/config/console.php
-
for connection establish /protected/config/main.php File open select All or paste in console.php file
-
then /protected/commands/SiteCommand.php
-
below code paste in SiteCommand.php File
<?php
class SiteCommand extends CConsoleCommand
{
public function run($args)
{
echo 'hello yii friends';
}
}
?>
-
then open cmd
-
\path\protected>yiic then press Enter Key
-
then cmd show your commend name
-
\path\protected>yiic site then press Enter Key
-
show your output "hello yii friends".