Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Phalcon PHP
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Phalcon PHP

Learning Phalcon PHP

By : Rada
close
close
Learning Phalcon PHP

Learning Phalcon PHP

By: Rada

Overview of this book

Phalcon is a full-stack PHP framework implemented as a C extension. Building applications with Phalcon will offer you lower resource consumption and high performance whether your application runs on a Linux machine or a Windows one. Phalcon is loosely coupled, allowing you to use its objects as glue components based on the needs of your application. Phalcon PHP's mission is to give you an advanced tool to develop faster websites and applications. This book covers the most common and useful parts of PhalconPHP, which will guide you to make the right decisions while developing a Phalcon-driven application. You will begin the journey by installing and setting up Phalcon for your environment followed by the development of each module. You will be introduced to Phalcon's ORM and ODM. Furthermore, you will also be able to create the first models and database architecture for your project. You will then cover command-line applications, API module, volt syntax, and hierarchical views. Installing and working with Node and Bower for assets management will also be covered. Finally, you will gain insights into creating the backoffice and frontend module along with best practices and resources for development with Phalcon PHP. By the end of this book, you will be able to confidently develop any kind of application using the Phalcon PHP framework in a short time.
Table of Contents (12 chapters)
close
close
4
4. Database Architecture, Models, and CLI Applications
chevron up
11
Index

The database architecture

The main goal of this book is to learn by example and we are achieving this by developing an online news/magazine website. We will assume the following tables as mandatory:

  • User
  • UserGroup
  • UserProfile
  • Article
  • ArticleCategory
  • ArticleTranslation
  • ArticleCategoryArticle
  • Hashtag
  • ArticleHashtagArticle

These are basic tables, and we will add a few more in the later chapters. I like to use singular terms as part of the naming convention, but it's a matter of choice. To work faster, I recommend tools such as PhpMyAdmin or MySQL Workbench. Let's start with the first table.

The User table

The User table will hold basic information about a user:

CREATE TABLE IF NOT EXISTS `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_first_name` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `user_last_name` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `user_email` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `user_password` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  ...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Phalcon PHP
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon