Code Monkey home page Code Monkey logo

mini3's Introduction

MINI3 - A naked barebone PHP application

MINI3

MINI3 is an extremely simple and easy to understand skeleton PHP application, reduced to the max. MINI3 is NOT a professional framework and does not come with all the stuff real frameworks have. If you just want to show some pages, do a few database calls and a little-bit of AJAX here and there, without reading in massive documentations of highly complex professional frameworks, then MINI3 might be very useful for you. MINI3 is easy to install, runs nearly everywhere and doesn't make things more complicated than necessary.

MINI (original version) and MINI2 (used Slim router) were built by me (panique), MINI3 is an excellent and improved version of the original MINI, made by JaoNoctus. Big thanks, man! :)

Features

  • extremely simple, easy to understand
  • simple but clean structure
  • makes "beautiful" clean URLs
  • demo CRUD actions: Create, Read, Update and Delete database entries easily
  • demo AJAX call
  • tries to follow PSR coding guidelines
  • uses PDO for any database requests, comes with an additional PDO debug tool to emulate your SQL statements
  • commented code
  • uses only native PHP code, so people don't have to learn a framework
  • uses PSR-4 autoloader

Requirements (but it's auto-installed)

  • PHP 8
  • MySQL
  • basic knowledge of Composer for sure
  • for auto-installation: VirtualBox, Vagrant

Forks

There are some nice upgraded versions of this mini framework, check it out at https://github.com/ribafs/php-router

Installation (in Vagrant, 100% automatic)

To keep things super-simple, we are using Vagrant here, a simple technology to run virtual machines for development. It's outdated, but does the job, and is much easier to understand than Docker. Just install VirtualBox, Vagrant, then copy this repo's code to a folder, go to that folder and type:

vagrant up

This will create a virtual machine with the configs given in Vagrantfile: It will create an Ubuntu 2022.04 Jammy64 VM with 1024MB RAM, sync the current folder to /var/www/html inside the VM, make the VM available on the IP 192.168.56.77 and start the bash script bootstrap.sh, which is just a set of commands that will install all necessary software.

If the auto-installer is finished, go to http://192.168.56.77 in your browser and click around a bit ;)

OLD INSTALLATION TUTORIALS FROM 2016

Below you'll find installation tutorial for the old version of MINI3 from 2016.

Installation (in Vagrant, 100% automatic)

If you are using Vagrant for your development, then you can install MINI3 with one click (or one command on the command line) [Vagrant doc]. MINI3 comes with a demo Vagrant-file (defines your Vagrant box) and a demo bootstrap.sh which automatically installs Apache, PHP, MySQL, PHPMyAdmin, git and Composer, sets a chosen password in MySQL and PHPMyadmin and even inside the application code, downloads the Composer-dependencies, activates mod_rewrite and edits the Apache settings, downloads the code from GitHub and runs the demo SQL statements (for demo data). This is 100% automatic, you'll end up after +/- 5 minutes with a fully running installation of MINI3 inside an Ubuntu 14.04 LTS Vagrant box.

To do so, put Vagrantfile and bootstrap.sh from _vagrant inside a folder (and nothing else). Do vagrant box add ubuntu/trusty64 to add Ubuntu 14.04 LTS ("Trusty Thar") 64bit to Vagrant (unless you already have it), then do vagrant up to run the box. When installation is finished you can directly use the fully installed demo app on 192.168.33.66. As this just a quick demo environment the MySQL root password and the PHPMyAdmin root password are set to 12345678, the project is installed in /var/www/html/myproject. You can change this for sure inside bootstrap.sh.

Auto-Installation on Ubuntu 14.04 LTS (in 30 seconds)

You can install MINI3 including Apache, MySQL, PHP and PHPMyAdmin, mod_rewrite, Composer, all necessary settings and even the passwords inside the configs file by simply downloading one file and executing it, the entire installation will run 100% automatically. If you are stuck somehow, also have a look into this tutorial for the original MINI1, it's basically the same installation process: Install MINI in 30 seconds inside Ubuntu 14.04 LTS

Manual Installation

  1. Edit the database credentials in application/config/config.php
  2. Execute the .sql statements in the _install/-folder (with PHPMyAdmin for example).
  3. Make sure you have mod_rewrite activated on your server / in your environment. Some guidelines: Ubuntu 14.04 LTS, Ubuntu 12.04 LTS, EasyPHP on Windows, AMPPS on Windows/Mac OS, XAMPP for Windows, MAMP on Mac OS
  4. Install composer and run composer install in the project's folder to create the PSR-4 autoloading stuff from Composer automatically. If you have no idea what this means: Remember the "good" old times when we were using "include file.php" all over our projects to include and use something ? PSR-0/4 is the modern, clean and automatic version of that. Please have a google research if that's important for you.

Feel free to commit your guideline for Ubuntu 16.04 LTS or other linuxes to the list!

MINI3 runs without any further configuration. You can also put it inside a sub-folder, it will work without any further configuration. Maybe useful: A simple tutorial on How to install LAMPP (Linux, Apache, MySQL, PHP, PHPMyAdmin) on Ubuntu 14.04 LTS and the same for Ubuntu 12.04 LTS.

Server configs for

nginx

server {
    server_name default_server _;   # Listen to any servername
    listen      [::]:80;
    listen      80;

    root /var/www/html/myproject/public;

    location / {
        index index.php;
        try_files /$uri /$uri/ /index.php?url=$uri;
    }

    location ~ \.(php)$ {
        fastcgi_pass   unix:/var/run/php5-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

A deeper discussion on nginx setups can be found here.

Security

The script makes use of mod_rewrite and blocks all access to everything outside the /public folder. Your .git folder/files, operating system temp files, the application-folder and everything else is not accessible (when set up correctly). For database requests PDO is used, so no need to think about SQL injection (unless you are using extremely outdated MySQL versions).

How to include stuff / use PSR-4

As this project uses proper PSR-4 namespaces, make sure you load/use your stuff correctly: Instead of including classes with old-school code like include xxx.php, simply do something like use Mini\Model\Song; on top of your file (modern IDEs even do that automatically). This would automatically include the file Song.php from the folder Mini/Model (it's case-sensitive!).

But wait, there's no Mini/Model/Song.php in the project, but a application/Model/Song.php, right ? To keep things cleaner, the composer.json sets a namespace (see code below), which is basically a name or an alias, for a certain folder / area of your application, in this case the folder application is now reachable via Mini when including stuff.

{
    "psr-4":
    {
        "Mini\\" : "application/"
    }
}

This might look stupid at first, but comes in handy later. To sum it up:

To load the file application/Model/Song.php, write a use Mini\Model\Song; on top of your controller file. Have a look into the SongController to get an idea how everything works!

FYI: As decribed in the install tutorial, you'll need do perform a "composer install" when setting up your application for the first time, which will create a set of files (= the autoloader) inside /vendor folder. This is the normal way Composer handle this stuff. If you delete your vendor folder the autoloading will not work anymore. If you change something in the composer.json, always make sure to run composer install/update again!

Goodies

MINI3 comes with a little customized PDO debugger tool (find the code in application/libs/helper.php), trying to emulate your PDO-SQL statements. It's extremely easy to use:

$sql = "SELECT id, artist, track, link FROM song WHERE id = :song_id LIMIT 1";
$query = $this->db->prepare($sql);
$parameters = array(':song_id' => $song_id);

echo Helper::debugPDO($sql, $parameters);

$query->execute($parameters);

License

This project is licensed under the MIT License. This means you can use and modify it for free in private or commercial projects.

Quick-Start

The structure in general

The application's URL-path translates directly to the controllers (=files) and their methods inside application/controllers.

example.com/home/exampleOne will do what the exampleOne() method in application/Controller/HomeController.php says.

example.com/home will do what the index() method in application/Controller/HomeController.php says.

example.com will do what the index() method in application/Controller/HomeController.php says (default fallback).

example.com/songs will do what the index() method in application/Controller/SongsController.php says.

example.com/songs/editsong/17 will do what the editsong() method in application/Controller/SongsController.php says and will pass 17 as a parameter to it.

Self-explaining, right ?

Showing a view

Let's look at the exampleOne()-method in the home-controller (application/Controller/HomeController.php): This simply shows the header, footer and the example_one.php page (in views/home/). By intention as simple and native as possible.

public function exampleOne()
{
    // load view
    require APP . 'views/_templates/header.php';
    require APP . 'views/home/example_one.php';
    require APP . 'views/_templates/footer.php';
}

Working with data

Let's look into the index()-method in the songs-controller (application/Controller/SongsController.php): Similar to exampleOne, but here we also request data. Again, everything is extremely reduced and simple: $Song->getAllSongs() simply calls the getAllSongs()-method in application/Model/Song.php (when $Song = new Song()).

namespace Mini\Controller

use Mini\Model\Song;

class SongsController
{
    public function index()
    {
        // Instance new Model (Song)
        $Song = new Song();
        // getting all songs and amount of songs
        $songs = $Song->getAllSongs();
        $amount_of_songs = $Song->getAmountOfSongs();

        // load view. within the view files we can echo out $songs and $amount_of_songs easily
        require APP . 'views/_templates/header.php';
        require APP . 'views/songs/index.php';
        require APP . 'views/_templates/footer.php';
    }
}

For extreme simplicity, data-handling methods are in application/model/ClassName.php. Have a look how getAllSongs() in model.php looks like: Pure and super-simple PDO.

namespace Mini\Model

use Mini\Core\Model;

class Song extends Model
{
    public function getAllSongs()
    {
        $sql = "SELECT id, artist, track, link FROM song";
        $query = $this->db->prepare($sql);
        $query->execute();

        return $query->fetchAll();
    }
}

The result, here $songs, can then easily be used directly inside the view files (in this case application/views/songs/index.php, in a simplified example):

<tbody>
<?php foreach ($songs as $song) { ?>
    <tr>
        <td><?php if (isset($song->artist)) echo htmlspecialchars($song->artist, ENT_QUOTES, 'UTF-8'); ?></td>
        <td><?php if (isset($song->track)) echo htmlspecialchars($song->track, ENT_QUOTES, 'UTF-8'); ?></td>
    </tr>
<?php } ?>
</tbody>

Contribute

Please commit into the develop branch (which holds the in-development version), not into master branch (which holds the tested and stable version).

Changelog

August 2016

  • [panique] fix for weird lowercase/uppercase path problem (also big thanks to @snickbit & @ugurozturk for the fix!)
  • [panique] forking joanoctus's excellent PSR4 ersion of MINI to MINI3

January 2016

  • [joanoctus] implementing PSR-4 autoloader

February 2015

  • [jeroenseegers] nginx setup configuration

December 2014

  • [panique] css fixes
  • [panique] renamed controller / view to singular
  • [panique] added charset to PDO creation (increased security)

November 2014

  • [panique] auto-install script for Vagrant
  • [panique] basic documentation
  • [panique] PDO-debugger is now a static helper-method, not a global function anymore
  • [panique] folder renaming
  • [reg4in] JS AJAX calls runs now properly even when using script in sub-folder
  • [panique] removed all "models", using one model file now
  • [panique] full project renaming, re-branding

October 2014

  • [tarcnux/panique] PDO debugging
  • [panique] demo ajax call
  • [panique] better output escaping
  • [panique] renamed /libs to /core
  • [tarcnux] basic CRUD (create/read/update/delete) examples have now an U (update)
  • [panique] URL is now config-free, application detects URL and sub-folder
  • [elysdir] htaccess has some good explanation-comments now
  • [bst27] fallback for non-existing controller / method
  • [panique] fallback will show error-page now
  • [digitaltoast] URL split fix to make php-mvc work flawlessly on nginx
  • [AD7six] security improvement: moved index.php to /public, route ALL request to /public

September 2014

  • [panique] added link to support forum
  • [panique] added link to Facebook page

August 2014

  • [panique] several changes in the README, donate-button changes

June 2014

  • [digitaltoast] removed X-UA-Compatible meta tag from header (as it's not needed anymore these days)
  • [digitaltoast] removed protocol in jQuery URL (modern way to load external files, making it independent to protocol change)
  • [digitaltoast] downgraded jQuery from 2.1 to 1.11 to avoid problems when working with IE7/8 (jQuery 2 dropped IE7/8 support)
  • [panique] moved jQuery loading to footer (to avoid page render blocking)

April 2014

  • [panique] updated jQuery link to 2.1
  • [panique] more than 3 parameters (arguments to be concrete) are possible
  • [panique] cleaner way of parameter handling
  • [panique] smaller cleanings and improvements
  • [panique] Apache 2.4 install information

January 2014

  • [panique] fixed .htaccess issue when there's a controller named "index" and a base index.php (which collide)

Other stuff

And by the way, I'm also blogging at Dev Metal :)

Support the project

Buy Me A Coffee

mini3's People

Contributors

ad7six avatar adamholte avatar alexgarrettsmith avatar antonisgr avatar bitdeli-chef avatar bst27 avatar diggy avatar grahamcampbell avatar grrnikos avatar jaonoctus avatar jeroenseegers avatar marcosmazz avatar panique avatar scrutinizer-auto-fixer avatar tarcnux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mini3's Issues

URLs with dash

Hi, is it possible, to create urls like /home/edit-song?

How to integrate a login system?

What is the best way to integrate a login system in MINI3?
Implementing login check and permission check on a Base Controller class that execute db querys using a User model?

Using multiple parameters

If someone has multiple parameters:

eg: http://example.com/controller/method/param1/param2/param3/

Then call_user_func_array only allows one parameter to be passed to the method ("param1") as a string.
Replacing 'call_user_func_array' with 'call_user_func' on line 44 of Application.php will enable the user to have multiple parameters sent as an array.

Given the line in the splitUrl function:

$this->url_params = array_values($url);

One can only assume that passing parameters as an array was always the intention? Or am I mistaken (My php is intermediate at best...so I might be missing something here..)

How to load an inner html included into a php file

Hi everyone,

When HomeController is called, is executed three "require" statements:

require APP . 'view/_templates/header.php';
        require APP . 'view/index.php';
        require APP . 'view/_templates/footer.php';

Inside the 'view/index.php' file, there is this statement:
<div w3-include-html="http:<?php echo URL; ?>Mini/view/landpage/formSuscripcion.html"></div>

The 'w3-include-html' tag works -> more reference at: https://www.w3schools.com/howto/howto_html_include.asp

When MIni3 loads this line, shows an error. How could I load that 'formSuscripcion.html' file?

Let me know if you have encountered my issue.

Any help would be welcome.

Best regards.

SQL Exceptions not being thrown/caught

screenshot_11

in the above code, the exception is never thrown and allows the program to proceed smoothly.
In the base model, an exception is thrown with a failed DB connection, however, in the extended models, no exception is being thrown with a failed SQL query.

Any idea why?

German umlauts (ä, ö, ü, and possibly other special characters) removed in parameters of action functions

I found a rather interesting error. I'm from Germany and we have often umlauts in our words. In one case I was working on a backend system and was trying to call a page like this:

header('Location: ' . URL . 'controller/action/' . urlencode('somethingWithAnUmlaut'));

And it worked very well, with one exception: the umlaut was removed in the URL and the parameter in the action function. After some digging I found the responsible code for it:

$url = filter_var($url, FILTER_SANITIZE_URL);

MINI seems to decode the URL after catching it (didn't looked up where this happens), so the URL isn't coded in HTTP at that line anymore. Unfortunately the filter used in that line removes all umlauts and some other German special characters (e.c. ß). In my case I just commented the line out. But that's of course not a long term solution. Any ideas here?

P.S.: I really love this 'framework'. Great work to all, who toke the effort making this project this awesome.

undefine lastInsertId()

i've got error when
$query = $this->db->prepare($sales);
$query->execute();
$salesid = $query->lastInsertId();

Fatal error: Uncaught Error: Call to undefined method PDOStatement::lastInsertId() in ......

Generating PDFs with PHP mini

I want to use dompdf, I installed it via composer.
I did

use Dompdf\Dompdf;

in top of the Controller and used it like the example says:

    $dompdf = new Dompdf();
    $dompdf->loadHtml('hello world');
    $dompdf->setPaper('A4', 'landscape');
    $dompdf->render();
    $dompdf->stream();

The browser cannot open the pdf, the error occurs only in PHP Mini framework, I tried it in a separate project and it worked without problems. Do you have any ideas?

[TODO] Helper lib doesn't work as folder/file needs to be uppercase name

I changed the name of the folder libs to Libs to make it load. I have the correct namespace is my helper.php : namespace Mini\Libs and I call it like this : \Mini\Libs\Helper::debugPDO() (I know I need the params but that's not the problem).
Error : Fatal error: Uncaught Error: Class 'Mini\Libs\Helper' not found in

I Cant Upload Files To Public File

Hi, Why i cant upload files images
Warning: move_uploaded_file(): Unable to move 'E:\xampp\tmp\php5FB5.tmp' to '//localhost/mini3/public/uploads/deering.jpg' in E:\xampp\htdocs\mini3\application\view\home\index.php on line 51

Apache Rewrite Failure

The apache rewrite would fail with a 403 error without Options +SymLinksIfOwnerMatch in the .htaccess file.

Ubuntu 16.04.3 LTS
Apache 2.4.18

PDO Debug d'ont work

In application/Model/Song.php

it's missing

use Mvc\Libs\Helper;

Correct it this:

<?php
/**
 * Class Songs
 * This is a demo Model class.
 *
 * Please note:
 * Don't use the same name for class and method, as this might trigger an (unintended) __construct of the class.
 * This is really weird behaviour, but documented here: http://php.net/manual/en/language.oop5.decon.php
 *
 */
namespace Mini\Model;

use Mini\Core\Model;
use Mvc\Libs\Helper;

class Song extends Model

Suggestion: do not redirect to /error, but just show a nice 404 error page on the current URL

You don't want to redirect to another URL if you expect a 404. There is no 404 response code and it's not very common to redirect.

Normal behavior: just show a 404 page on the current URL.

My suggestion:

Change https://github.com/panique/mini3/blob/master/application/Core/Application.php#L55 and https://github.com/panique/mini3/blob/master/application/Core/Application.php#L59 to:

$this->url_controller = new \Mini\Controller\ErrorController();
$this->url_controller->notFound();

And change https://github.com/panique/mini3/blob/master/application/Controller/ErrorController.php#L20 to notFound.

Then I will be able to set a customised error page for a 404. Direct access to /error should be blocked.

[TODO] Change "libs" folder name to "Libs"

Hi, i having problem like class finding error. I had everything worked on my local server but the remote server is failing.

"Fatal error: Class 'Mini\Core\Application' not found in /home/askothersn/public_html/public/index.php on line 37"

Am i have to run composer at remote server also ?

Both php version is 5.6

How to share function across all views

I'm just getting into using Mini3 MVC framework but am struggling with the concept of where to code a function that is to be used by ALL views. Can anyone help me? Thanks in advance

I've this issue

namespace Mini\Controller;

use Mini\Libs\Tools\Guard;
use Twilio\Rest\Client;

class HomeController
{
    public function __construct()
    {
        Guard::guard();
    }

    public function index()
    {

        $twilio = new Client(TWILIO_SID, TWILIO_TOKEN);

        $message = $twilio->messages
            ->create("whatsapp:+55650000", // to
                [
                    "from" => "whatsapp:+14155238886",
                    "body" => "Twilio Sandbox: ✅ Hello customer Naelson!",
                ]
            );

        print($message->sid);

        require APP . 'view/_templates/header.php';
        require APP . 'view/index.php';
        require APP . 'view/_templates/footer.php';
    }
}

Warning: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' (this will throw an Error in a future version of PHP) in /var/www/html/crm-2wins/vendor/twilio/sdk/src/Twilio/Http/CurlClient.php on line 115

If i put it in public index.php will disappear errors

Class 'Mini\Core\Application not found

Dear friends,

Thank you very much for Mini, it helps a lot for the beginners.
I was going to try Mini3, but have got only errors :(

On php 5.6:
Fatal error: Class 'Mini\Core\Application' not found in .../.../mini3-master/public/index.php on line 37

On php 7.0:
Uncaught Error: Stack trace: #0 {main} thrown in .../.../mini3-master/public/index.php on line 37

Helper::debug is given error

Hi,

I'm getting error below, please check out... and teach me

Fatal error: Uncaught Error: Class 'master\Model\Helper' not found in C:\xampp\htdocs\master\application\Model\User.php:17 Stack trace: #0 C:\xampp\htdocs\master\application\Controller\UserController.php(17): master\Model\User->register('anurag', 'Sinha', 'dev.sinha14@gma...', 's', '1231231231', '9891289891', '9891289891 9891...', 'anurag', 'female', '9891289891', '110092') #1 C:\xampp\htdocs\master\application\Core\Application.php(47): master\Controller\UserController->register() #2 C:\xampp\htdocs\master\public\index.php(37): master\Core\Application->__construct() #3 {main} thrown in C:\xampp\htdocs\master\application\Model\User.php on line 17

When i want to print debug

// useful for debugging: you can see the SQL behind above construction by using:
echo '[ PDO DEBUG ]: ' . Helper::debugPDO($sql, $parameters); exit();

Regards
Anurag

Ability to have subfolders controller

Hello,

I tried to create a subfolder on the Controller folder but I do not think it's possible for now to do this?
I declared the namespace with the subfolder, but could not call my controller from a url, or I do not know how.

Thank you

can't save the data coming from the database

where to load data from database to access it from all controllers without reloading it every time ?

I am loading the data from the home controller construct and using other functions to load other views, I don't want to fetch the data every time from database, I want a class where am sure it's gonna run one time only and I can access the data from home controller !

What is the best way to include a PDO database class?

Like the title says, I've got a database class with a lot of database functions in it like connecting, updating, inserting, get last inserted id etc.

Right now in mini3 the PDO database connection is made inside the core Model.php but because I need those database class for more applications I want to include a external database class.

So I was wondering what the best method is for this 'framework' how to include a Database.php class according to the mini3 namespaces?

Related to issue #17: 404 when try to load Application

Hi everyone,

I am having the same issue that was mentioned at issue #17
Fatal error: Uncaught Error: Class 'Mini\Core\Application' not found in /lab/mini3/public/index.php:37 Stack trace: #0 {main} thrown in lab/mini3/public/index.php on line 37

I didn't modify any file.

Let me know how it was solved.

Could be a matter related to mod_rewrite directive?

From now, thanks!

Pull 61 wasn't applied to the develop branch.

#61

This pull was applied to the MASTER branch, but not the DEVELOP branch.

The pull is a fantastic feature, and it makes sense that the DEVELOP branch should have it as well.

If there's something I'm missing, please let me know as I can't figure out why it wasn't applied to both....

Post a form in Ajax

Hello community,

I have only recently started working with Mini and cannot send and then process the data transmitted via a form.
Can someone help me set up this script?

thank you in advance.

Bug

Bug?
I send Post Http javascript to controller/model and i get content of index

Edit: long time, disable cache of browser and solve

view folder inside folder access like Laravel

hello ,

i am using your framework for small website project but i want folder structure like

view(folder) -> contact(folder) -> services(folder) -> our-services.php (file)

when i am trying to using folder inside folder structure i am not able to return view file i am getting error page

in laravel you can create folder inside folder and so on , its really helpful for manage purpose and seo purpose

please resove that or add that access to views also , otherwise framework is really great for small scale project

Post request as API is not working

Hi,
I'm hitting below URL i can view the below data
https://localhost/rest-api/songs/loginStats/Administrator/Anurag/yug

[{"first_name":"Yug","last_name":"Sinha","token":"3242746237678236578346","roll":"Administrator","last_login":"2020-04-02 00:34:41","user_type":"Administrator"}]

When i'm requesting using Angular 8 I'm getting error only

const headers = new HttpHeaders()
.append('Content-Type', 'application/json')
.append('Access-Control-Allow-Headers', 'Content-Type')
.append('Access-Control-Allow-Methods', 'GET')
.append('Access-Control-Allow-Origin', '*');
return this.http.post(${environment.apiUrl}/songs/loginStats, { usertype,username, password },{headers: headers})
.pipe(map(user => {

payload parameter not coming in function

Regards
Anurag

Really a good example, Do you have any version with routers

Hi

First of all thanks for creating beautiful app. Really a good example to kick start for a basic core php application. I always like to code in core due to small size and keep only required code pieces.

You have user namespaces in a very good manner I always stuck with them.

Can you please use some router library like klein https://github.com/klein/klein.php . I have used it and is a good library.

I have a problem with the app I have started php server in the root directory. App is working fine but routing is not working. urls are updating in the address bar but content remains the same.

Please try to use any router that will be very good practice. Also Klein router has built in template renderer to use partials layouts and yield content etc.

I know we always love our child. Its really great, but there is always the scope of improvements.

Thank you in advance.
Rana

can't deploy on heroku !

either it's so easy to do or no body have deployed a mini3 on heroku yet , can't find an issue open no stackpverflow solutions or questions kinda weird but however I'm trying to deploy to heroku and am getting an issue with the routing and finding the index page in public file and getting some other errors as well but it looks like if can get a sample for a Procfile that needed with heroku cause that seems to be the issue and why heroku can't find where to route !

Thanks again for Mini3 it's amazing
Ali Bayati

Using Helpers-Lib

Do I have to require the lib/helpers.php file in index.php or is is autoloaded?
If autoloaded how can I call a helper function?

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.