Giter Site home page Giter Site logo

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  avatar

mini3's Issues

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

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

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?

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.

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

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.

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 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?

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 ......

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?

[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

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

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

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....

[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

URLs with dash

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

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

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

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

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 !

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 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 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.

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

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!

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

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?

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

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.

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.