├── .gitignore ├── .htaccess ├── .htrouter.php ├── .phalcon └── .gitkeep ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bin └── import_db.sh ├── composer.json ├── composer.lock ├── docker-compose.yml ├── public ├── .htaccess └── index.php ├── resources ├── docker │ ├── 8.0 │ │ ├── Dockerfile │ │ └── config │ │ │ ├── .bashrc │ │ │ └── extra.ini │ ├── 8.1 │ │ ├── Dockerfile │ │ └── config │ │ │ ├── .bashrc │ │ │ └── extra.ini │ ├── 8.2 │ │ ├── Dockerfile │ │ └── config │ │ │ ├── .bashrc │ │ │ └── extra.ini │ └── 8.3 │ │ ├── Dockerfile │ │ └── config │ │ ├── .bashrc │ │ └── extra.ini └── schemas │ └── tutorial.sql └── src ├── controllers ├── IndexController.php └── SignupController.php ├── models └── Users.php └── views ├── index.phtml ├── index └── index.phtml └── signup ├── index.phtml └── register.phtml /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | public/.DS_Store 4 | vendor/ 5 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine on 3 | RewriteRule ^$ public/ [L] 4 | RewriteRule ((?s).*) public/$1 [L] 5 | 6 | -------------------------------------------------------------------------------- /.htrouter.php: -------------------------------------------------------------------------------- 1 | 9 | Phalcon Team 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-present The Phalcon PHP Framework 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Phalcon Tutorial 2 | 3 | Phalcon is a web framework for PHP delivered as a C extension providing high 4 | performance and lower resource consumption. 5 | 6 | This is a very simple tutorial to understand the basis of work with Phalcon. 7 | 8 | Check out an [explanation article][1]. 9 | 10 | ## Get Started 11 | 12 | ### Requirements 13 | 14 | To run this application on your machine, you need at least: 15 | 16 | * PHP >= 8.0+ 17 | * Server Any of the following 18 | * [Apache][2] Web Server with [mod_rewrite][3] enabled 19 | * [Nginx][4] Web Server 20 | * Latest stable [Phalcon Framework release][5] extension enabled 21 | 22 | ## Running the application locally 23 | 24 | * Clone the repository to a folder on your machine 25 | * Navigate to that folder 26 | * Run `docker compose up -d` 27 | * After the build process is completed, you will have the following: 28 | * PHP 8.0 (`tutorial-8.0`) 29 | * PHP 8.1 (`tutorial-8.1`) 30 | * PHP 8.2 (`tutorial-8.2`) 31 | * PHP 8.3 (`tutorial-8.3`) 32 | * You can check the application on your local browser by finding the IP address of the chosen environment and launching it. For example, if you wish to check the PHP 8.3 environment, type the following in your terminal: 33 | 34 | ```shell 35 | docker inspect tutorial-8.3 36 | ``` 37 | This will output a JSON file, where you can find the IP address of the container on your local machine. 38 | 39 | ```shell 40 | ... 41 | "EndpointID": "563ba90563ffb7ad5c30689f1216ec4c2e1625d170eb0279e78c001973464691", 42 | "Gateway": "172.29.0.1", 43 | "IPAddress": "172.29.0.5", 44 | "IPPrefixLen": 16, 45 | ... 46 | ``` 47 | 48 | Launch a browser and visit the site using that IP address (`http://172.29.0.5`) 49 | 50 | To enter an environment and run different commands, such as populating the database: 51 | 52 | ```shell 53 | docker exec -it tutorial-8.3 /bin/bash 54 | ``` 55 | 56 | ## License 57 | 58 | Phalcon Tutorial is open-sourced software licensed under the [MIT][6]. © Phalcon Framework Team and 59 | contributors 60 | 61 | [1]: https://docs.phalcon.io/latest/tutorial-basic 62 | [2]: http://httpd.apache.org/ 63 | [3]: http://httpd.apache.org/docs/current/mod/mod_rewrite.html 64 | [4]: http://nginx.org/ 65 | [5]: https://github.com/phalcon/cphalcon/releases 66 | [6]: https://github.com/phalcon/tutorial/blob/master/docs/LICENSE 67 | [7]: https://github.com/phalcon/phalcon-devtools 68 | [8]: https://docker.com 69 | -------------------------------------------------------------------------------- /bin/import_db.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mysql --user=$DATA_MYSQL_USER \ 4 | --password=$DATA_MYSQL_PASS \ 5 | --host=$DATA_MYSQL_HOST \ 6 | phalcon_tutorial < /code/resources/schemas/tutorial.sql 7 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phalcon/tutorial", 3 | "type": "library", 4 | "description": "This is a sample application for the Phalcon PHP Framework", 5 | "keywords": [ 6 | "phalcon", 7 | "framework", 8 | "sample app", 9 | "tytiruak" 10 | ], 11 | "homepage": "https://phalcon.io", 12 | "license": "MIT", 13 | "authors": [ 14 | { 15 | "name": "Phalcon Team", 16 | "homepage": "https://github.com/phalcon" 17 | }, 18 | { 19 | "name": "Contributors", 20 | "homepage": "https://github.com/phalcon/tutorial/graphs/contributors" 21 | } 22 | ], 23 | "require": { 24 | "php": ">=8.0", 25 | "ext-openssl": "*", 26 | "ext-phalcon": "^5.0.0", 27 | "pds/skeleton": "^1.0" 28 | }, 29 | "require-dev": { 30 | "phalcon/ide-stubs": "^v5.0.1" 31 | }, 32 | "autoload": { 33 | "psr-4": { 34 | "Tutorial\\": "src/" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "536b46f412f983bc807f32f6289a6a12", 8 | "packages": [ 9 | { 10 | "name": "pds/skeleton", 11 | "version": "1.0.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/php-pds/skeleton.git", 15 | "reference": "95e476e5d629eadacbd721c5a9553e537514a231" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/php-pds/skeleton/zipball/95e476e5d629eadacbd721c5a9553e537514a231", 20 | "reference": "95e476e5d629eadacbd721c5a9553e537514a231", 21 | "shasum": "" 22 | }, 23 | "bin": [ 24 | "bin/pds-skeleton" 25 | ], 26 | "type": "standard", 27 | "autoload": { 28 | "psr-4": { 29 | "Pds\\Skeleton\\": "src/" 30 | } 31 | }, 32 | "notification-url": "https://packagist.org/downloads/", 33 | "license": [ 34 | "CC-BY-SA-4.0" 35 | ], 36 | "description": "Standard for PHP package skeletons.", 37 | "homepage": "https://github.com/php-pds/skeleton", 38 | "support": { 39 | "issues": "https://github.com/php-pds/skeleton/issues", 40 | "source": "https://github.com/php-pds/skeleton/tree/1.x" 41 | }, 42 | "time": "2017-01-25T23:30:41+00:00" 43 | } 44 | ], 45 | "packages-dev": [ 46 | { 47 | "name": "phalcon/ide-stubs", 48 | "version": "v5.6.0", 49 | "source": { 50 | "type": "git", 51 | "url": "https://github.com/phalcon/ide-stubs.git", 52 | "reference": "0593372dcf90d311f5f861a67b0438cc44d29a23" 53 | }, 54 | "dist": { 55 | "type": "zip", 56 | "url": "https://api.github.com/repos/phalcon/ide-stubs/zipball/0593372dcf90d311f5f861a67b0438cc44d29a23", 57 | "reference": "0593372dcf90d311f5f861a67b0438cc44d29a23", 58 | "shasum": "" 59 | }, 60 | "require": { 61 | "php": ">=7.4" 62 | }, 63 | "require-dev": { 64 | "squizlabs/php_codesniffer": "3.*", 65 | "vimeo/psalm": "^3.4" 66 | }, 67 | "type": "library", 68 | "notification-url": "https://packagist.org/downloads/", 69 | "license": [ 70 | "BSD-3-Clause" 71 | ], 72 | "authors": [ 73 | { 74 | "name": "Phalcon Team", 75 | "email": "team@phalcon.io", 76 | "homepage": "https://phalcon.io/en-us/team" 77 | }, 78 | { 79 | "name": "Contributors", 80 | "homepage": "https://github.com/phalcon/ide-stubs/graphs/contributors" 81 | } 82 | ], 83 | "description": "The most complete Phalcon Framework IDE stubs library which enables autocompletion in modern IDEs.", 84 | "homepage": "https://phalcon.io", 85 | "keywords": [ 86 | "Devtools", 87 | "Eclipse", 88 | "autocomplete", 89 | "ide", 90 | "netbeans", 91 | "phalcon", 92 | "phpstorm", 93 | "stub", 94 | "stubs" 95 | ], 96 | "support": { 97 | "forum": "https://forum.phalcon.io/", 98 | "issues": "https://github.com/phalcon/ide-stubs/issues", 99 | "source": "https://github.com/phalcon/ide-stubs" 100 | }, 101 | "funding": [ 102 | { 103 | "url": "https://github.com/phalcon", 104 | "type": "github" 105 | }, 106 | { 107 | "url": "https://opencollective.com/phalcon", 108 | "type": "open_collective" 109 | } 110 | ], 111 | "time": "2024-01-09T23:54:03+00:00" 112 | } 113 | ], 114 | "aliases": [], 115 | "minimum-stability": "stable", 116 | "stability-flags": [], 117 | "prefer-stable": false, 118 | "prefer-lowest": false, 119 | "platform": { 120 | "php": ">=8.0", 121 | "ext-openssl": "*", 122 | "ext-phalcon": "^5.0.0" 123 | }, 124 | "platform-dev": [], 125 | "plugin-api-version": "2.6.0" 126 | } 127 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | 4 | # Application - Vökuró 5 | tutorial-8.0: 6 | build: resources/docker/8.0 7 | container_name: tutorial-8.0 8 | tty: true 9 | working_dir: /code 10 | depends_on: 11 | - tutorial-mysql 12 | volumes: 13 | - ./:/code 14 | networks: 15 | - tutorial-network 16 | 17 | tutorial-8.1: 18 | build: resources/docker/8.1 19 | container_name: tutorial-8.1 20 | tty: true 21 | working_dir: /code 22 | depends_on: 23 | - tutorial-mysql 24 | volumes: 25 | - ./:/code 26 | networks: 27 | - tutorial-network 28 | 29 | tutorial-8.2: 30 | build: resources/docker/8.2 31 | container_name: tutorial-8.2 32 | tty: true 33 | working_dir: /code 34 | depends_on: 35 | - tutorial-mysql 36 | volumes: 37 | - ./:/code 38 | networks: 39 | - tutorial-network 40 | 41 | tutorial-8.3: 42 | build: resources/docker/8.3 43 | container_name: tutorial-8.3 44 | tty: true 45 | working_dir: /code 46 | depends_on: 47 | - tutorial-mysql 48 | volumes: 49 | - ./:/code 50 | networks: 51 | - tutorial-network 52 | 53 | # Database - Mysql 54 | tutorial-mysql: 55 | image: mysql:5.7 56 | container_name: tutorial-mysql 57 | tty: true 58 | environment: 59 | - MYSQL_ROOT_PASSWORD=secret 60 | - MYSQL_USER=phalcon 61 | - MYSQL_DATABASE=phalcon_tutorial 62 | - MYSQL_PASSWORD=secret 63 | volumes: 64 | - tutorial-volume:/var/lib/mysql/ 65 | networks: 66 | - tutorial-network 67 | 68 | # Network 69 | networks: 70 | tutorial-network: 71 | driver: bridge 72 | 73 | # Volumes 74 | volumes: 75 | tutorial-volume: 76 | driver: local 77 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | AddDefaultCharset UTF-8 2 | 3 | RewriteEngine On 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L] 7 | 8 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | setDirectories( 17 | [ 18 | APP_PATH . '/controllers/', 19 | APP_PATH . '/models/', 20 | ] 21 | ) 22 | ->register() 23 | ; 24 | 25 | // Create a DI 26 | $container = new FactoryDefault(); 27 | 28 | // Setting up the view component 29 | $container['view'] = function () { 30 | $view = new View(); 31 | $view->setViewsDir(APP_PATH . '/views/'); 32 | return $view; 33 | }; 34 | 35 | // Setup a base URI so that all generated URIs include the "tutorial" folder 36 | $container['url'] = function () { 37 | $url = new UrlProvider(); 38 | $url->setBaseUri('/'); 39 | return $url; 40 | }; 41 | 42 | // Set the database service 43 | $container['db'] = function () { 44 | return new DbAdapter( 45 | [ 46 | "host" => 'tutorial-mysql', 47 | "username" => 'phalcon', 48 | "password" => 'secret', 49 | "dbname" => 'phalcon_tutorial', 50 | ] 51 | ); 52 | }; 53 | 54 | // Handle the request 55 | try { 56 | $application = new Application($container); 57 | $response = $application->handle($_SERVER["REQUEST_URI"]); 58 | $response->send(); 59 | } catch (Exception $e) { 60 | echo "Exception: ", $e->getMessage(); 61 | } 62 | -------------------------------------------------------------------------------- /resources/docker/8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM composer:latest as composer 2 | FROM php:8.0-fpm 3 | 4 | COPY ./config/extra.ini /usr/local/etc/php/conf.d/ 5 | 6 | # Set working directory 7 | WORKDIR /code 8 | 9 | LABEL vendor="Phalcon" \ 10 | maintainer="Phalcon Team " \ 11 | description="The PHP image to test the tutorial application" 12 | 13 | ENV PHALCON_VERSION="5.6.0" 14 | 15 | # Update 16 | RUN apt update -y && \ 17 | apt install -y \ 18 | apt-utils \ 19 | gettext \ 20 | git \ 21 | libzip-dev \ 22 | nano \ 23 | sudo \ 24 | wget \ 25 | zip 26 | 27 | # PECL Packages 28 | RUN pecl install phalcon-${PHALCON_VERSION} \ 29 | xdebug 30 | 31 | # Install PHP extensions 32 | RUN docker-php-ext-install \ 33 | gettext \ 34 | pdo_mysql \ 35 | zip 36 | 37 | # Install PHP extensions 38 | RUN docker-php-ext-enable \ 39 | opcache \ 40 | phalcon \ 41 | xdebug 42 | 43 | # Clear cache 44 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* 45 | 46 | # Add user 47 | RUN groupadd -g 1000 phalcon 48 | RUN useradd -u 1000 -ms /bin/bash -g phalcon phalcon 49 | 50 | # Composer 51 | COPY --from=composer /usr/bin/composer /usr/local/bin/composer 52 | 53 | # Copy existing application directory contents 54 | COPY . /code 55 | 56 | # Bash script with helper aliases 57 | COPY ./config/.bashrc /root/.bashrc 58 | COPY ./config/.bashrc /home/phalcon/.bashrc 59 | 60 | # Copy existing application directory permissions 61 | COPY --chown=phalcon:phalcon . /code 62 | 63 | # Change current user to phalcon 64 | USER phalcon 65 | 66 | EXPOSE 80 67 | 68 | CMD ["php", "-S", "0.0.0.0:80", "-t", "public/", ".htrouter.php"] 69 | -------------------------------------------------------------------------------- /resources/docker/8.0/config/.bashrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Easier navigation: .., ..., ...., ....., ~ and - 4 | alias ..="cd .." 5 | alias ...="cd ../.." 6 | alias ....="cd ../../.." 7 | alias .....="cd ../../../.." 8 | alias ~="cd ~" # `cd` is probably faster to type though 9 | alias -- -="cd -" 10 | 11 | # Shortcuts 12 | alias g="git" 13 | alias h="history" 14 | 15 | # Detect which `ls` flavor is in use 16 | if ls --color > /dev/null 2>&1; then # GNU `ls` 17 | colorflag="--color" 18 | else # OS X `ls` 19 | colorflag="-G" 20 | fi 21 | 22 | # List all files colorized in long format 23 | # shellcheck disable=SC2139 24 | alias l="ls -lF ${colorflag}" 25 | 26 | # List all files colorized in long format, including dot files 27 | # shellcheck disable=SC2139 28 | alias la="ls -laF ${colorflag}" 29 | 30 | # List only directories 31 | # shellcheck disable=SC2139 32 | alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" 33 | 34 | # See: https://superuser.com/a/656746/280737 35 | alias ll='LC_ALL="C.UTF-8" ls -alF' 36 | 37 | # Always use color output for `ls` 38 | # shellcheck disable=SC2139 39 | alias ls="command ls ${colorflag}" 40 | export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' 41 | 42 | # Always enable colored `grep` output 43 | alias grep='grep --color=auto ' 44 | 45 | # Enable aliases to be sudo’ed 46 | alias sudo='sudo ' 47 | 48 | # Get week number 49 | alias week='date +%V' 50 | 51 | # Stopwatch 52 | alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' 53 | 54 | # Canonical hex dump; some systems have this symlinked 55 | command -v hd > /dev/null || alias hd="hexdump -C" 56 | 57 | # vhosts 58 | alias hosts='sudo nano /etc/hosts' 59 | 60 | # copy working directory 61 | alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard' 62 | 63 | # copy file interactive 64 | alias cp='cp -i' 65 | 66 | # move file interactive 67 | alias mv='mv -i' 68 | 69 | # untar 70 | alias untar='tar xvf' 71 | 72 | # Zephir related 73 | alias untar='tar xvf' 74 | 75 | PATH=$PATH:./vendor/bin 76 | -------------------------------------------------------------------------------- /resources/docker/8.0/config/extra.ini: -------------------------------------------------------------------------------- 1 | error_reporting = E_ALL 2 | display_errors = "On" 3 | display_startup_errors = "On" 4 | log_errors = "On" 5 | error_log = /code/php_errors.log 6 | memory_limit = 512M 7 | apc.enable_cli = "On" 8 | session.save_path = "/tmp" 9 | 10 | ;xdebug 11 | xdebug.client_host = "localhost" 12 | xdebug.client_port = 9090 13 | xdebug.discover_client_host = 1 14 | xdebug.force_display_errors = 0 15 | xdebug.force_error_reporting = 0 16 | xdebug.max_nesting_level = 256 17 | xdebug.mode = coverage, debug, develop 18 | xdebug.output_dir = "/tmp" 19 | xdebug.remote_cookie_expire_time = 3600 20 | xdebug.remote_mode = "req" 21 | xdebug.show_error_trace = 1 22 | xdebug.show_exception_trace = 1 23 | xdebug.show_local_vars = 1 24 | xdebug.start_with_request = yes 25 | xdebug.var_display_max_children = 128 26 | xdebug.var_display_max_data = 512 27 | xdebug.var_display_max_depth = 3 28 | -------------------------------------------------------------------------------- /resources/docker/8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM composer:latest as composer 2 | FROM php:8.1-fpm 3 | 4 | COPY ./config/extra.ini /usr/local/etc/php/conf.d/ 5 | 6 | # Set working directory 7 | WORKDIR /code 8 | 9 | LABEL vendor="Phalcon" \ 10 | maintainer="Phalcon Team " \ 11 | description="The PHP image to test the tutorial application" 12 | 13 | ENV PHALCON_VERSION="5.6.0" 14 | 15 | # Update 16 | RUN apt update -y && \ 17 | apt install -y \ 18 | apt-utils \ 19 | gettext \ 20 | git \ 21 | libzip-dev \ 22 | nano \ 23 | sudo \ 24 | wget \ 25 | zip 26 | 27 | # PECL Packages 28 | RUN pecl install phalcon-${PHALCON_VERSION} \ 29 | xdebug 30 | 31 | # Install PHP extensions 32 | RUN docker-php-ext-install \ 33 | gettext \ 34 | pdo_mysql \ 35 | zip 36 | 37 | # Install PHP extensions 38 | RUN docker-php-ext-enable \ 39 | opcache \ 40 | phalcon \ 41 | xdebug 42 | 43 | # Clear cache 44 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* 45 | 46 | # Add user 47 | RUN groupadd -g 1000 phalcon 48 | RUN useradd -u 1000 -ms /bin/bash -g phalcon phalcon 49 | 50 | # Composer 51 | COPY --from=composer /usr/bin/composer /usr/local/bin/composer 52 | 53 | # Copy existing application directory contents 54 | COPY . /code 55 | 56 | # Bash script with helper aliases 57 | COPY config/.bashrc /root/.bashrc 58 | COPY config/.bashrc /home/phalcon/.bashrc 59 | 60 | # Copy existing application directory permissions 61 | COPY --chown=phalcon:phalcon . /code 62 | 63 | # Change current user to phalcon 64 | USER phalcon 65 | 66 | EXPOSE 80 67 | 68 | CMD ["php", "-S", "0.0.0.0:80", "-t", "public/", ".htrouter.php"] 69 | -------------------------------------------------------------------------------- /resources/docker/8.1/config/.bashrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Easier navigation: .., ..., ...., ....., ~ and - 4 | alias ..="cd .." 5 | alias ...="cd ../.." 6 | alias ....="cd ../../.." 7 | alias .....="cd ../../../.." 8 | alias ~="cd ~" # `cd` is probably faster to type though 9 | alias -- -="cd -" 10 | 11 | # Shortcuts 12 | alias g="git" 13 | alias h="history" 14 | 15 | # Detect which `ls` flavor is in use 16 | if ls --color > /dev/null 2>&1; then # GNU `ls` 17 | colorflag="--color" 18 | else # OS X `ls` 19 | colorflag="-G" 20 | fi 21 | 22 | # List all files colorized in long format 23 | # shellcheck disable=SC2139 24 | alias l="ls -lF ${colorflag}" 25 | 26 | # List all files colorized in long format, including dot files 27 | # shellcheck disable=SC2139 28 | alias la="ls -laF ${colorflag}" 29 | 30 | # List only directories 31 | # shellcheck disable=SC2139 32 | alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" 33 | 34 | # See: https://superuser.com/a/656746/280737 35 | alias ll='LC_ALL="C.UTF-8" ls -alF' 36 | 37 | # Always use color output for `ls` 38 | # shellcheck disable=SC2139 39 | alias ls="command ls ${colorflag}" 40 | export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' 41 | 42 | # Always enable colored `grep` output 43 | alias grep='grep --color=auto ' 44 | 45 | # Enable aliases to be sudo’ed 46 | alias sudo='sudo ' 47 | 48 | # Get week number 49 | alias week='date +%V' 50 | 51 | # Stopwatch 52 | alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' 53 | 54 | # Canonical hex dump; some systems have this symlinked 55 | command -v hd > /dev/null || alias hd="hexdump -C" 56 | 57 | # vhosts 58 | alias hosts='sudo nano /etc/hosts' 59 | 60 | # copy working directory 61 | alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard' 62 | 63 | # copy file interactive 64 | alias cp='cp -i' 65 | 66 | # move file interactive 67 | alias mv='mv -i' 68 | 69 | # untar 70 | alias untar='tar xvf' 71 | 72 | # Zephir related 73 | alias untar='tar xvf' 74 | 75 | PATH=$PATH:./vendor/bin 76 | -------------------------------------------------------------------------------- /resources/docker/8.1/config/extra.ini: -------------------------------------------------------------------------------- 1 | error_reporting = E_ALL 2 | display_errors = "On" 3 | display_startup_errors = "On" 4 | log_errors = "On" 5 | error_log = /code/php_errors.log 6 | memory_limit = 512M 7 | apc.enable_cli = "On" 8 | session.save_path = "/tmp" 9 | 10 | ;xdebug 11 | xdebug.client_host = "localhost" 12 | xdebug.client_port = 9090 13 | xdebug.discover_client_host = 1 14 | xdebug.force_display_errors = 0 15 | xdebug.force_error_reporting = 0 16 | xdebug.max_nesting_level = 256 17 | xdebug.mode = coverage, debug, develop 18 | xdebug.output_dir = "/tmp" 19 | xdebug.remote_cookie_expire_time = 3600 20 | xdebug.remote_mode = "req" 21 | xdebug.show_error_trace = 1 22 | xdebug.show_exception_trace = 1 23 | xdebug.show_local_vars = 1 24 | xdebug.start_with_request = yes 25 | xdebug.var_display_max_children = 128 26 | xdebug.var_display_max_data = 512 27 | xdebug.var_display_max_depth = 3 28 | -------------------------------------------------------------------------------- /resources/docker/8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM composer:latest as composer 2 | FROM php:8.2-fpm 3 | 4 | COPY ./config/extra.ini /usr/local/etc/php/conf.d/ 5 | 6 | # Set working directory 7 | WORKDIR /code 8 | 9 | LABEL vendor="Phalcon" \ 10 | maintainer="Phalcon Team " \ 11 | description="The PHP image to test the tutorial application" 12 | 13 | ENV PHALCON_VERSION="5.6.0" 14 | 15 | # Update 16 | RUN apt update -y && \ 17 | apt install -y \ 18 | apt-utils \ 19 | gettext \ 20 | git \ 21 | libzip-dev \ 22 | nano \ 23 | sudo \ 24 | wget \ 25 | zip 26 | 27 | # PECL Packages 28 | RUN pecl install phalcon-${PHALCON_VERSION} \ 29 | xdebug 30 | 31 | # Install PHP extensions 32 | RUN docker-php-ext-install \ 33 | gettext \ 34 | pdo_mysql \ 35 | zip 36 | 37 | # Install PHP extensions 38 | RUN docker-php-ext-enable \ 39 | opcache \ 40 | phalcon \ 41 | xdebug 42 | 43 | # Clear cache 44 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* 45 | 46 | # Add user 47 | RUN groupadd -g 1000 phalcon 48 | RUN useradd -u 1000 -ms /bin/bash -g phalcon phalcon 49 | 50 | # Composer 51 | COPY --from=composer /usr/bin/composer /usr/local/bin/composer 52 | 53 | # Copy existing application directory contents 54 | COPY . /code 55 | 56 | # Bash script with helper aliases 57 | COPY config/.bashrc /root/.bashrc 58 | COPY config/.bashrc /home/phalcon/.bashrc 59 | 60 | # Copy existing application directory permissions 61 | COPY --chown=phalcon:phalcon . /code 62 | 63 | # Change current user to phalcon 64 | USER phalcon 65 | 66 | EXPOSE 80 67 | 68 | CMD ["php", "-S", "0.0.0.0:80", "-t", "public/", ".htrouter.php"] 69 | -------------------------------------------------------------------------------- /resources/docker/8.2/config/.bashrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Easier navigation: .., ..., ...., ....., ~ and - 4 | alias ..="cd .." 5 | alias ...="cd ../.." 6 | alias ....="cd ../../.." 7 | alias .....="cd ../../../.." 8 | alias ~="cd ~" # `cd` is probably faster to type though 9 | alias -- -="cd -" 10 | 11 | # Shortcuts 12 | alias g="git" 13 | alias h="history" 14 | 15 | # Detect which `ls` flavor is in use 16 | if ls --color > /dev/null 2>&1; then # GNU `ls` 17 | colorflag="--color" 18 | else # OS X `ls` 19 | colorflag="-G" 20 | fi 21 | 22 | # List all files colorized in long format 23 | # shellcheck disable=SC2139 24 | alias l="ls -lF ${colorflag}" 25 | 26 | # List all files colorized in long format, including dot files 27 | # shellcheck disable=SC2139 28 | alias la="ls -laF ${colorflag}" 29 | 30 | # List only directories 31 | # shellcheck disable=SC2139 32 | alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" 33 | 34 | # See: https://superuser.com/a/656746/280737 35 | alias ll='LC_ALL="C.UTF-8" ls -alF' 36 | 37 | # Always use color output for `ls` 38 | # shellcheck disable=SC2139 39 | alias ls="command ls ${colorflag}" 40 | export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' 41 | 42 | # Always enable colored `grep` output 43 | alias grep='grep --color=auto ' 44 | 45 | # Enable aliases to be sudo’ed 46 | alias sudo='sudo ' 47 | 48 | # Get week number 49 | alias week='date +%V' 50 | 51 | # Stopwatch 52 | alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' 53 | 54 | # Canonical hex dump; some systems have this symlinked 55 | command -v hd > /dev/null || alias hd="hexdump -C" 56 | 57 | # vhosts 58 | alias hosts='sudo nano /etc/hosts' 59 | 60 | # copy working directory 61 | alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard' 62 | 63 | # copy file interactive 64 | alias cp='cp -i' 65 | 66 | # move file interactive 67 | alias mv='mv -i' 68 | 69 | # untar 70 | alias untar='tar xvf' 71 | 72 | # Zephir related 73 | alias untar='tar xvf' 74 | 75 | PATH=$PATH:./vendor/bin 76 | -------------------------------------------------------------------------------- /resources/docker/8.2/config/extra.ini: -------------------------------------------------------------------------------- 1 | error_reporting = E_ALL 2 | display_errors = "On" 3 | display_startup_errors = "On" 4 | log_errors = "On" 5 | error_log = /code/php_errors.log 6 | memory_limit = 512M 7 | apc.enable_cli = "On" 8 | session.save_path = "/tmp" 9 | 10 | ;xdebug 11 | xdebug.client_host = "localhost" 12 | xdebug.client_port = 9090 13 | xdebug.discover_client_host = 1 14 | xdebug.force_display_errors = 0 15 | xdebug.force_error_reporting = 0 16 | xdebug.max_nesting_level = 256 17 | xdebug.mode = coverage, debug, develop 18 | xdebug.output_dir = "/tmp" 19 | xdebug.remote_cookie_expire_time = 3600 20 | xdebug.remote_mode = "req" 21 | xdebug.show_error_trace = 1 22 | xdebug.show_exception_trace = 1 23 | xdebug.show_local_vars = 1 24 | xdebug.start_with_request = yes 25 | xdebug.var_display_max_children = 128 26 | xdebug.var_display_max_data = 512 27 | xdebug.var_display_max_depth = 3 28 | -------------------------------------------------------------------------------- /resources/docker/8.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM composer:latest as composer 2 | FROM php:8.3-fpm 3 | 4 | COPY ./config/extra.ini /usr/local/etc/php/conf.d/ 5 | 6 | # Set working directory 7 | WORKDIR /code 8 | 9 | LABEL vendor="Phalcon" \ 10 | maintainer="Phalcon Team " \ 11 | description="The PHP image to test the tutorial application" 12 | 13 | ENV PHALCON_VERSION="5.6.0" 14 | 15 | # Update 16 | RUN apt update -y && \ 17 | apt install -y \ 18 | apt-utils \ 19 | gettext \ 20 | git \ 21 | libzip-dev \ 22 | nano \ 23 | sudo \ 24 | wget \ 25 | zip 26 | 27 | # PECL Packages 28 | RUN pecl install phalcon-${PHALCON_VERSION} \ 29 | xdebug 30 | 31 | # Install PHP extensions 32 | RUN docker-php-ext-install \ 33 | gettext \ 34 | pdo_mysql \ 35 | zip 36 | 37 | # Install PHP extensions 38 | RUN docker-php-ext-enable \ 39 | opcache \ 40 | phalcon \ 41 | xdebug 42 | 43 | # Clear cache 44 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* 45 | 46 | # Add user 47 | RUN groupadd -g 1000 phalcon 48 | RUN useradd -u 1000 -ms /bin/bash -g phalcon phalcon 49 | 50 | # Composer 51 | COPY --from=composer /usr/bin/composer /usr/local/bin/composer 52 | 53 | # Copy existing application directory contents 54 | COPY . /code 55 | 56 | # Bash script with helper aliases 57 | COPY config/.bashrc /root/.bashrc 58 | COPY config/.bashrc /home/phalcon/.bashrc 59 | 60 | # Copy existing application directory permissions 61 | COPY --chown=phalcon:phalcon . /code 62 | 63 | # Change current user to phalcon 64 | USER phalcon 65 | 66 | EXPOSE 80 67 | 68 | CMD ["php", "-S", "0.0.0.0:80", "-t", "public/", ".htrouter.php"] 69 | -------------------------------------------------------------------------------- /resources/docker/8.3/config/.bashrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Easier navigation: .., ..., ...., ....., ~ and - 4 | alias ..="cd .." 5 | alias ...="cd ../.." 6 | alias ....="cd ../../.." 7 | alias .....="cd ../../../.." 8 | alias ~="cd ~" # `cd` is probably faster to type though 9 | alias -- -="cd -" 10 | 11 | # Shortcuts 12 | alias g="git" 13 | alias h="history" 14 | 15 | # Detect which `ls` flavor is in use 16 | if ls --color > /dev/null 2>&1; then # GNU `ls` 17 | colorflag="--color" 18 | else # OS X `ls` 19 | colorflag="-G" 20 | fi 21 | 22 | # List all files colorized in long format 23 | # shellcheck disable=SC2139 24 | alias l="ls -lF ${colorflag}" 25 | 26 | # List all files colorized in long format, including dot files 27 | # shellcheck disable=SC2139 28 | alias la="ls -laF ${colorflag}" 29 | 30 | # List only directories 31 | # shellcheck disable=SC2139 32 | alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" 33 | 34 | # See: https://superuser.com/a/656746/280737 35 | alias ll='LC_ALL="C.UTF-8" ls -alF' 36 | 37 | # Always use color output for `ls` 38 | # shellcheck disable=SC2139 39 | alias ls="command ls ${colorflag}" 40 | export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' 41 | 42 | # Always enable colored `grep` output 43 | alias grep='grep --color=auto ' 44 | 45 | # Enable aliases to be sudo’ed 46 | alias sudo='sudo ' 47 | 48 | # Get week number 49 | alias week='date +%V' 50 | 51 | # Stopwatch 52 | alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' 53 | 54 | # Canonical hex dump; some systems have this symlinked 55 | command -v hd > /dev/null || alias hd="hexdump -C" 56 | 57 | # vhosts 58 | alias hosts='sudo nano /etc/hosts' 59 | 60 | # copy working directory 61 | alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard' 62 | 63 | # copy file interactive 64 | alias cp='cp -i' 65 | 66 | # move file interactive 67 | alias mv='mv -i' 68 | 69 | # untar 70 | alias untar='tar xvf' 71 | 72 | # Zephir related 73 | alias untar='tar xvf' 74 | 75 | PATH=$PATH:./vendor/bin 76 | -------------------------------------------------------------------------------- /resources/docker/8.3/config/extra.ini: -------------------------------------------------------------------------------- 1 | error_reporting = E_ALL 2 | display_errors = "On" 3 | display_startup_errors = "On" 4 | log_errors = "On" 5 | error_log = /code/php_errors.log 6 | memory_limit = 512M 7 | apc.enable_cli = "On" 8 | session.save_path = "/tmp" 9 | 10 | ;xdebug 11 | xdebug.client_host = "localhost" 12 | xdebug.client_port = 9090 13 | xdebug.discover_client_host = 1 14 | xdebug.force_display_errors = 0 15 | xdebug.force_error_reporting = 0 16 | xdebug.max_nesting_level = 256 17 | xdebug.mode = coverage, debug, develop 18 | xdebug.output_dir = "/tmp" 19 | xdebug.remote_cookie_expire_time = 3600 20 | xdebug.remote_mode = "req" 21 | xdebug.show_error_trace = 1 22 | xdebug.show_exception_trace = 1 23 | xdebug.show_local_vars = 1 24 | xdebug.start_with_request = yes 25 | xdebug.var_display_max_children = 128 26 | xdebug.var_display_max_data = 512 27 | xdebug.var_display_max_depth = 3 28 | -------------------------------------------------------------------------------- /resources/schemas/tutorial.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS `tutorial` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */; 2 | USE `tutorial`; 3 | 4 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 5 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 6 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 7 | /*!40101 SET NAMES utf8mb4 */; 8 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 9 | /*!40103 SET TIME_ZONE='+00:00' */; 10 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 11 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 12 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 13 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 14 | 15 | -- 16 | -- Table structure for table `users` 17 | -- 18 | 19 | /*!40101 SET @saved_cs_client = @@character_set_client */; 20 | /*!40101 SET character_set_client = utf8mb4 */; 21 | CREATE TABLE `users` 22 | ( 23 | `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Record ID', 24 | `name` varchar(255) NOT NULL COMMENT 'User Name', 25 | `email` varchar(255) NOT NULL COMMENT 'User Email Address', 26 | PRIMARY KEY (`id`) 27 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 28 | 29 | /*!40101 SET character_set_client = @saved_cs_client */; 30 | 31 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 32 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 33 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 34 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 35 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 36 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 37 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 38 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 39 | 40 | INSERT INTO `users` (`name`, `email`) 41 | VALUES ('Phalcon Team', 'team@phalcon.io'); 42 | -------------------------------------------------------------------------------- /src/controllers/IndexController.php: -------------------------------------------------------------------------------- 1 | view->users = Users::find(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/controllers/SignupController.php: -------------------------------------------------------------------------------- 1 | request->getPost(); 20 | 21 | // Store and check for errors 22 | $user = new Users(); 23 | $user->name = $post['name']; 24 | $user->email = $post['email']; 25 | // Store and check for errors 26 | $success = $user->save(); 27 | 28 | // passing the result to the view 29 | $this->view->success = $success; 30 | 31 | if ($success) { 32 | $message = "Thanks for registering!"; 33 | } else { 34 | $message = "Sorry, the following problems were generated:
" 35 | . implode('
', $user->getMessages()); 36 | } 37 | 38 | // passing a message to the view 39 | $this->view->message = $message; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/models/Users.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Phalcon Tutorial 6 | 8 | 9 | 10 |
11 | getContent(); ?> 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /src/views/index/index.phtml: -------------------------------------------------------------------------------- 1 | Hello!"; 4 | 5 | echo $this->tag->a('signup', 'Sign Up Here!', ['class' => 'btn btn-primary']); 6 | 7 | if ($users->count() > 0) { 8 | ?> 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
#NameEmail
Users quantity: count(); ?>
id; ?>name; ?>email; ?>
32 | Sign using this form 2 | 3 | tag->form(['action' => '/signup/register']); ?> 4 | 5 |

6 | 7 | tag->inputText('name'); ?> 8 |

9 | 10 |

11 | 12 | tag->inputText('email'); ?> 13 |

14 | 15 |

16 | tag->inputSubmit('Register', null, ['class' => 'btn btn-primary']); ?> 17 |

18 | 19 | tag->close('form'); ?> 20 | -------------------------------------------------------------------------------- /src/views/signup/register.phtml: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | tag->a('/', 'Go back', ['class' => 'btn btn-primary']); ?> 6 | --------------------------------------------------------------------------------