Coder Social home page Coder Social logo

documentation's Introduction

phalcon

Phalcon Framework

PDS Skeleton Phalcon CI Quality Gate Status

Implemented

Standard Description
PSR-3 Phalcon\Logger\Logger
PSR-4 Phalcon\Autoloader
PSR-7 Phalcon\Http\Message
PSR-11 Phalcon\Container\Container
PSR-12 Coding Standard
PSR-13 Phalcon\Html\Tag\Link
PSR-16 Phalcon\Cache\Cache

To do

Standard Description
PSR-6 Caching Interface
PSR-14 Event Dispatcher
PSR-15 HTTP Handlers
PSR-17 Phalcon\Http\Message
PSR-18 HTTP Client

Remaining refactoring / alignment with cphalcon (v5)

  • Url
  • Pull requests to cphalcon
  • Convert tests to phpunit.

documentation's People

Contributors

arhell avatar niden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

documentation's Issues

Redirection issue

A google result that points to: https://docs.phalcon.io/4.0/en/request

Redirects to:
https://docs.phalcon.io/4.0/en/latest

Then:
https://docs.phalcon.io/4.0/en/latest/latest

And so on...

This is the HTML code of the response

</html>
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Redirecting...</title>
    <link rel="canonical" href="[introduction/](https://docs.phalcon.io/4.0/en/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/latest/introduction/)">
    <meta name="robots" content="noindex">
    <script type="40f3ffd8f1a388e8749b5a2e-text/javascript">var anchor=window.location.hash.substr(1);location.href="latest/"+(anchor?"#"+anchor:"")</script>
    <meta http-equiv="refresh" content="0; url=latest/">
</head>
<body>
Redirecting...
<script src="[/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js](https://docs.phalcon.io/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js)" data-cf-settings="40f3ffd8f1a388e8749b5a2e-|49" defer></script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v84a3a4012de94ce1a686ba8c167c359c1696973893317" integrity="sha512-euoFGowhlaLqXsPWQ48qSkBSCFs3DPRyiwVu3FjR96cMPx+Fr+gpWRhIafcHwqwCqWS42RZhIudOvEI+Ckf6MA==" data-cf-beacon='{"rayId":"83b620dd3a1cba74","version":"2023.10.0","token":"359d3a5d34364ab7a64449d1a12ed6f4"}' crossorigin="anonymous"></script>
</body>
</html>

RFC: New repository for code examples in Documentation

Most of the documents bring code snippets. Considering that full file examples would take a lot of space in the documents and make them complex, a new repository with running examples per main classes would be a useful complement to them. The documentation could make direct reference to them. The users can clone the repository and run the examples in his/her local environment to have fully running demos of the code cited in the docs.

devtools.md database array is not correct for PDO\Mysql

According to doc https://docs.phalcon.io/4.0/en/devtools:
config.php for phalcon devtools usage should be:

return new \Phalcon\Config([
    'database' => [
        'adapter'     => 'Mysql',
        'host'        => 'localhost',
        'username'    => 'root',
        'password'    => '',
        'dbname'      => 'test',
        'charset'     => 'utf8',
    ],

It seems that the right doc is:

return new \Phalcon\Config([
    'database' => [
        'adapter'     => 'Mysql',
        'options' => [
            'host'        => 'localhost',
            'username'    => 'root',
            'password'    => '',
            'dbname'      => 'test',
            'charset'     => 'utf8',
        ],
    ],

No documented security support

My organization is re-evaluating its usage of Phalcon. One concern which came up is security support for the version which some of our components are currently using, version 3. According to Phalcon 3.0's release announcement, version 3.0 was supported for a "long term" of 3 years (which was possibly until 2019-07-29).

However, there is no such information in the announcements of versions 3.1, 3.2, 3.3 or 4.0 (and there was apparently no announcement of 3.4). I cannot see any indication, in the documentation or elsewhere, that Phalcon has security support, even for version 4. I cannot find any security support policy or explanation of a version lifecycle.

SECTIONS table of contents (left) is hard to discover

I spent at least 20 minutes trying to understand the methods described in the Models page before finally finding a "Creating Models" section, 30 screens down. The frustration from that realization got me to carefully look at the page and notice discreet but strange horizontal grey lines at the left. When I explored them with the mouse, I fortunately realized that Phalcon's documentation already had the page-specific tables of contents (TOC-s) I had been missing since I started reading Phalcon's documentation, about 1 man-hour earlier.

When the mouse cursor slowly goes over the viewport's leftmost centimeter, a TOC showing all sections of the currently displaying page appears, for as long as the cursor stays in the area it occupies. When the cursor leaves the area, the TOC retracts back as if it would hide in the page's left edge. It seems impossible to display this TOC without using the cursor (although deficient keyboard accessibility seems to be a general issue).

This TOC has by far the lowest discoverability to usefulness ratio I have ever seen. One would never expect to find a SECTIONS TOC with such a behavior considering that:

  1. There is enough space to always display it (the area it uses is completely empty (white) when it is retracted).
  2. The site TOC (at the right) is right next to contents. Logically, the SECTIONS TOC, being more specific, should be at least as close to contents as the site TOC.
  3. The site TOC, for which hiding would make a lot more sense, is not even optionally retractable.

redirect bug

QQ20231228-101342@2x click the "Documentation" and you will always be redirected

Documentation inconsistencies

Methods in phalcon 3 look different and are less readable than methods in phalcon 4.

In phalcon 3 methods are a plain 'p' tag:
image

While this is how methods looks in phalcon 4:
image

Phalcon and Devilbox

maybe it would be nice to tell on the Devilbox Environment Page that Phalcon and PSR are not enabled by default and has to be enabled in .env file at PHP_MODULES_ENABLE=psr, phalcon

Error in Views documentation

With
Phalcon\Mvc\View

echo will produce this error:

Object of class Phalcon\Mvc\View could not be converted to string

Only php use Phalcon\Mvc\View\Simple can be used combined with echo.

The following examples also produce an error:

// 'views-dir/index.phtml'
 echo $this->view->render('index');  //returns error: Wrong number of parameters

 // 'views-dir/posts/show.phtml'
 echo $this->view->render('posts/show'); //returns error: Wrong number of parameters. 

//Apparently only works with the format:
$this->view->render("posts", "show")

[...] Haven't checked the ones with the models

// Phalcon\Mvc\View
$view = new View();
echo $view->render('invoices', 'view', $params); //This one works but without `echo`

I've tested with PHP 7.4, Phalcon 4.1, both in Windows 10 and Ubuntu 20.04.

If the errors are validated by dev team, I can make the changes in the docs.

[REQ] Phalcon Release Documentation

Can you guys write a better Release documentation for Phalcon? Most importantly, The Release Cycle and Development Phase. Like how long it takes for example between beta's for a new release? Monthly, Every-3-Months or Yearly etc... This will help everyone involved to at least have some idea on how slow or fast Phlacon development process are going. And please don't say, "When its ready..." this is not helpful. See [1] as a very good example. I don't expect you to strickly stick to this schedule, but at least it will give a better idea of what to expect. Thank you!

[1] Example: https://www.xfce.org/about/releasemodel

Model::setup options are not correct

Currently there are many options documented which just doesn't work - https://docs.phalcon.io/4.0/pl-pl/db-models#disablingenabling-features

https://github.com/phalcon/cphalcon/blob/master/phalcon/Mvc/Model.zep#L2825

Some of them like enableImplicitJoins, escapeSqlIdentifiers are used somewhere else like Phalcon\Db\ AbstractDb::setup()

Some of them like astCache, cacheLevel are not set, astCache is not even used in a whole project.

Docs needs to be updated for this, and code in phalcon changed as well.

[3.4] Pages "Environments - Phalcon Compose (Docker) / Phalcon Box (Vagrant)" redirect to Nanobox instructions

Hello,
in docs for the version 3.4, the pages
Environments - Phalcon Compose (Docker) and
Environments - Phalcon Box (Vagrant)

both redirect to the page
Environments - Nanobox

In docs for the version 4.0, the redirecting pages are not even there, so I presume it is connected to their removal from 3.4.

I suggest either reinstating the pages (preferrable for me as I wanted to install Phalcon via Docker) or removing them from the navigation.

Thank you.

New benchmark page

Due to the fact that current benchmarks is outdated and it was removed from the docs we need new benchmarks. I believe that the URL of benchmark page should be the same as before.

refs phalcon-orphanage/docs#706

[DOCUMENTATION] Phalcon Release Cycle

We need better phalcon release cycle documentation. [1] I know every developer always says "When its ready!" but we need a general understanding of when Alpha is released, or when is Stable version is released. Like 1-3 months or 1-3 years, you get the idea. For example you can explain what Alpha or Stable version process is in Phalcon develpment and how often it is released. No one is expecting to see exact dates. But even saying alpha releases every month will be enought ^_^ Maybe even including some sort of release cycle map that phalcon uses similar to [1] Also a better explanation of "End-of-Life" phalcon versions [2] is apreceated.

Example Releases;

  • 4.x.x -- Development (?)
  • 3.x.x -- Updated (?)
  • 2.x.x -- End-Of-Life (?)

[1] https://en.wikipedia.org/wiki/Software_release_life_cycle
[2] https://en.wikipedia.org/wiki/End-of-life_(product)

Update Videotuturial for Phalcon 4

In documentation on Tutorial ->Basic Page is videotutorial for Phalcon 3.x. Need to record and update videotutorial for Phalcon 4. Since some things was changed

\Phalcon\Db documentation issues

I recently upgraded to 4.0.4 and have noticed a number of errors in the documentation here: https://docs.phalcon.io/4.0/en/db-layer#create-1

Most importantly, the second parameter schema for all db operations is null in the documentation, but that causes a fatal error.

For example:

PHP Fatal error:  Uncaught TypeError: Argument 2 passed to Phalcon\\Db\\Adapter\\AbstractAdapter::modifyColumn() must be of the type string, null given

I was able to fix this by simply passing "" an empty string as the second param.

"Go to repository" link (top right) points to archived repository (phalcon-orphanage/docs)

The top line in the header at the top of all pages on the Phalcon Documentation website contains a link to the documentation's source repository with a Git icon:
Capture d’écran 2023-12-30 à 18 42 17
This link's target is https://github.com/phalcon/docs, which redirects to https://github.com/phalcon-orphanage/docs, an archived repository which does not cover Phalcon versions beyond 5.0.

This link target may be appropriate for old versions, but the repository for the documentation of current versions is this one (https://github.com/phalcon/documentation).

v3 View::render() documentation incorrect/misleading

On this page: https://docs.phalconphp.com/3.4/en/views#simple-rendering, in the 3rd code block that demonstrates how to use render(), it references $this->view from a controller. By default that will be \Phalcon\Mvc\View - whose render() function accepts different arguments.

This is misleading as, when one reads this one assumes that $this->view->render() can accept a string argument, when in fact it can only accept controller & action arguments.

I recommend the code be updated from (for example)

echo $this->view->render('posts/show');

to

$SimpleView = new SimpleView();
echo $SimpleView->render('posts/show');

to be clearer that this code block is referring to the SimpleView functionality.

Installation Guide - Amazon Linux

Very easy to get buried in the installation docs: https://phalcon.io/en-us/download/linux
Amazon Linux does not appear to be covered...
I had to follow: https://stackoverflow.com/questions/56623885/how-to-install-phalcon-php-on-amazon-linux
I'm thinking there should be an official "installer" repo so issues can be opened related to installation, and to smooth out the bumps in the installation process to make it much easier to follow, and less prone to issues during installation.

I'll work on trying to implement this...

The sample code does not know where to run through?

From @dafa168 on August 10, 2014 6:30

Many of the examples listed in the manual, but specifically where to put the code to run it?

Only able to specify where you want the code to run through, and then the specific needs which depend on the ease of reading a written

So please indicate the manual sample code can be run under the location.

Thank you!

Copied from original issue: phalcon/cphalcon#2692

  • Tutorial
    • Basic
    • REST
    • Vokuro
    • Performance
    • Invo

[NFR] Create API / Nuxt+Vue tutorial

For now I'm parking this NFR here. Not sure if it really need to be a docs as well but that's something we can discuss.
The idea is to create a video tutorial that will show how to create a basic api with a good looking datatable frontend builded with Vuetify. It should be easy to follow for non experienced users. The basic flow can look something like this.

Video 1
Step 1
Initialise new basic micro application with a MySql database. The needed services should be easy to setup. Thinking about using docker containers in combination with docker-compose.

Step 2
Create a table + model with some basic columns. Table can be created with phpmyadmin. Devtools can be used to generate the model.

Step 3
Create a controller + route that uses the model to retrieve all the records and return a json string on specified route. It should be a GET request so users can easily test this in the browser.

Step 4
Setup a new Nuxt project and run show basic project in browser.

Step 5
Add datatable to nuxt project and connect it to the api endpoint to retrieve all the records.

End Video 1. Sum what we did tell about are next steps.

Video 2
Step 6
Discuss problem with large dataset and use database seeder to insert a large dataset into the database and show loading / memory issues.

Step 7
Introduce paginator in controller. Add get params like page, number of items etc. Test in browser manually.

Step 8
Implement pagination in datatable and show issue with sorting (client side will only sort the items loaded).

Step 9
Implement sorting in controller and test sorting in browser.

Step 10
Implement server side sorting in datatable.

End video 2.

Video 3
Not part of this scope but will introduce content editing and testing your application.

  • Handle model changes
  • Simulate put request with codeception (1 field first..keep it simple)
  • Connect to Datatable

Video 4
Not part of this scope but will introduce full crud and searching.

Video 5
Not part of this scope but will introduce authentication.

  • Cmd line task to add user
  • Login window in nuxt
  • Setup axios with authentication (JWT)
  • Secure api

Models (ORM): Plural class name "Invoices" used for single invoice

The Models page defines an Invoices class:

<?php

namespace MyApp\Models;

use Phalcon\Mvc\Model;

class Invoices extends Model
{

}
<?php

use MyApp\Models\Invoices;

$invoice = new Invoices();

$invoice->inv_cst_id      = 1;
$invoice->inv_status_flag = 1;
$invoice->inv_title       = 'Invoice for ACME Inc.';
$invoice->inv_total       = 100;
$invoice->inv_created_at  = '2019-12-25 01:02:03';

$result = $invoice->save();

if (false === $result) {
    
    echo 'Error saving Invoice: ';

    $messages = $invoice->getMessages();

    foreach ($messages as $message) {
        echo $message . PHP_EOL;
    }
} else {

    echo 'Record Saved';

}

The class name is plural (Invoices), but the second code fragment shows an instance of the Invoices class represents a single invoice.

I imagine the class was named "Invoices" because it corresponds to a database table named Invoices, but this could confuse readers and does not provide a good example, since class names which represent a single object are singular in object-oriented languages.

I recommend to either:

  1. rename the class Invoice and use setSource() to map it to a differently-named table
  2. or, failing that, add PHPDoc to Invoices indicating what it represents (which would not be a bad thing anyway)

I try to fix links colors but...

Hi,
I want to fix style of tags, but cant find assets/stylesheets for documentation. Is there a way to do that?

It is a --md-primary-fg-color css variable and its used for header too. Maybe to set a new one only for links and make them more visible.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.