kalicr/magento2-helloworld

A simple Hello World module for Magento 2 - Demo for Packagist

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Language:Shell

Type:magento2-module

pkg:composer/kalicr/magento2-helloworld

1.0.1 2025-12-07 17:25 UTC

This package is auto-updated.

Last update: 2026-01-07 17:41:42 UTC


README

Magento 2 PHP License

A simple and elegant Hello World module for Magento 2, created to demonstrate best practices for module development and Packagist publication.

🚀 Features

  • ✅ Clean and modern UI with gradient design
  • ✅ Frontend route: /helloworld
  • ✅ Custom block with helper methods
  • ✅ Fully styled template with responsive CSS
  • ✅ Complete Magento 2 module structure
  • ✅ PSR-4 autoloading
  • ✅ Ready for Packagist.org publication

📋 Requirements

  • Magento 2.4.x
  • PHP 7.4, 8.1, or 8.2
  • Composer

📦 Installation

Method 1: Via Composer (Recommended)

composer require kalicr/magento2-helloworld
php bin/magento module:enable Kalicr_HelloWorld
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

Method 2: Manual Installation

  1. Create directory: app/code/Kalicr/HelloWorld
  2. Download and extract the module files into this directory
  3. Run the following commands:
php bin/magento module:enable Kalicr_HelloWorld
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

🎯 Usage

After installation, visit:

https://your-magento-site.com/helloworld

You'll see a beautiful Hello World page with:

  • Module information
  • Current date and time
  • Feature list
  • Installation instructions

📁 Module Structure

kalicr-magento2-helloworld/
├── Block/
│   └── HelloWorld.php              # Block class with helper methods
├── Controller/
│   └── Index/
│       └── Index.php               # Frontend controller
├── etc/
│   ├── module.xml                  # Module declaration
│   └── frontend/
│       └── routes.xml              # Route configuration
├── view/
│   └── frontend/
│       ├── layout/
│       │   └── helloworld_index_index.xml  # Layout XML
│       ├── templates/
│       │   └── helloworld.phtml    # Template file
│       └── web/
│           └── css/
│               └── helloworld.css  # Styles
├── composer.json                    # Composer configuration
├── registration.php                 # Module registration
├── README.md                        # This file
└── LICENSE                          # MIT License

🎨 Customization

Change the Welcome Message

Edit Block/HelloWorld.php:

public function getWelcomeMessage()
{
    return __('Your Custom Message!');
}

Modify Styles

Edit view/frontend/web/css/helloworld.css to customize colors, fonts, and layout.

Add New Features

  1. Add methods to Block/HelloWorld.php
  2. Use them in view/frontend/templates/helloworld.phtml
  3. Style with view/frontend/web/css/helloworld.css

🔧 Development

Running Tests

php bin/magento dev:tests:run unit

Code Standards

This module follows Magento coding standards. To check:

vendor/bin/phpcs --standard=Magento2 app/code/Kalicr/HelloWorld

📝 Changelog

Version 1.0.0 (2025-12-07)

  • Initial release
  • Frontend route implementation
  • Custom block and template
  • Responsive CSS design
  • Complete documentation

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

David Gamboa

🙏 Acknowledgments

  • Magento 2 Documentation
  • Magento Community
  • Packagist.org

📞 Support

If you encounter any issues or have questions, please:

  1. Check the documentation
  2. Search for existing issues
  3. Create a new issue if needed

🔗 Links

Made with ❤️ by David Gamboa - Kalicr © 2025