- FEATURES
- Autoload
- Class Reflection
- Magic Methods
- Exceptions
- Late Static Binding
- Type Hinting
- SPL
- PHPUNIT
- PHAR
- COMPOSER
- Carbon
- Guzzle
- Faker
- Math
- Requests
- DESIGN PATTERNS
- Singleton Pattern
- Observer Pattern
- Strategy Pattern
- Dependency Injection
- Middleware
- Registry
- SYMFONY
- Routes
- Annotations
- Flex
- Controllers
- Doctrine
- Templating
- VERSIONS
- Php7.4
- Php8.0
- SECURITY
- Filter Input
- Remote Code Injection
- Sql Injection
- Session Fixation
- File Uploads
- Cross Site Scripting
- Spoofed Forms
- CSRF
- Session Hijacking
- MODERN PHP
- Composer
- Autoloader
- Package
- Releases
- Generators
- Dependency Injection
- Middleware
- CUSTOM FRAMEWORK
- App
- Http Foundation
- Front Controller
- Routing
- Render Controller
- Resolver
- SoC
- FRAMEWORKS
- Slim
- Symfony V5
- Laravel V8
-
Laminas V3
- Codeigniter V4
Laminas
MVC Skeleton Version: Laminas MVC 3.2 Create new laminas MVC project
cd /var/www/tests.local/php/laminas/
composer create-project -sdev laminas/laminas-mvc-skeleton myproject \
--ignore-platform-reqs
http://tests.local/php/laminas/myproject/public/
# Welcome page
http://tests.local/php/laminas/myproject/public/application/index
# Welcome page
Add new action helloAction
// module/Application/src/Controller/IndexController.php
// ...
public function helloAction()
{
$message = $this->params()->fromRoute('message');
return new ViewModel(['message' => $message]);
}
Add new route hello-world
// module/Application/config/module.config.php
// ...
'hello-world' => [
'type' => Segment::class,
'options' => [
'route' => '/hello[/:message]',
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'hello',
'message' => 'World',
],
],
],
Add new view hello.phtml
// module/Application/view/application/index/hello.phtml
<div class="jumbotron">
<p>
Hello <?php echo $this->escapeHtml($message) ?>
</p>
</div>
It works!
http://tests.local/php/laminas/myproject/public/hello
# Hello World
http://tests.local/php/laminas/myproject/public/hello/Laminas
# Hello Laminas
Last update: 570 days ago