Nano - PHP7, MVC, PDO

Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    Apprentice Geo is offline
    MemberRank
    May 2016 Join Date
    United KingdomLocation
    16Posts

    Re: Nano - PHP7, MVC, PDO

    Quote Originally Posted by 3M1L View Post
    Do you mind posting your event manager class? :)
    PHP Code:
    <?php
    declare(strict_types=1);


    namespace 
    Library\Components\Storage;


    class 
    Event {


        protected 
    $callbacks = [];


            public function 
    __construct(){}


        
    /**
         * [register is a function to register callback events]
         *  [MENTION=2000183830]para[/MENTION]m  string $callback [The callback to register]
         */
            
    public function register(string $callback){


                
    $this->callbacks[] = $callback;


            }


        
    /**
         * [fire is a function to fire a single or all callback events]
         *  [MENTION=2000183830]para[/MENTION]m  string $call [The callback to fire] [Optional]
         *  [MENTION=850422]return[/MENTION] mixed        [The respective fired callback event]
         */
            
    public function fire(callable $call null){


                if(!
    $call){


                    foreach(
    $this->callbacks as $callback){
                        
    call_user_func([$this$callback]);
                    }


                }else{
                    
    call_user_func([$this$call]);
                }


            }
    }


    ?>
    Also some updates on the housekeeping, I worked a little more on the article management:
    Last edited by Geo; 15-07-16 at 03:17 AM.

  2. #17
    Nano - PHP7, MVC, PDONano - PHP7, MVC, PDO pel is offline
    MemberRank
    Jan 2012 Join Date
    Munich, GermanyLocation
    384Posts

    Re: Nano - PHP7, MVC, PDO

    Im interested in how the progress of this cms is going on.

  3. #18
    Banned rafa95123 is offline
    BannedRank
    May 2009 Join Date
    /home/RaphaLocation
    564Posts

    Re: Nano - PHP7, MVC, PDO

    Quote Originally Posted by Geo View Post
    [PHP]
    Also some updates on the housekeeping, I worked a little more on the article management:
    Good updates, but i don't recommend to use "hosted" images in cms, leave author decide url of image... (Of corse if hosted in own cms will make a faster site, but also heavier)

  4. #19
    Member Japaojp is offline
    MemberRank
    Nov 2011 Join Date
    BrazilLocation
    95Posts

    Re: Nano - PHP7, MVC, PDO

    Quote Originally Posted by rafa95123 View Post
    Good updates, but i don't recommend to use "hosted" images in cms, leave author decide url of image... (Of corse if hosted in own cms will make a faster site, but also heavier)
    Also, it would be good just if you could prevew what image you are picking. Choosing by name sucks.
    Would prefer the size of the news in the home page being just like old school habbo. Already has a lot of images ready to be used in that square format.
    Last edited by Japaojp; 02-08-16 at 07:40 PM.

  5. #20
    Apprentice Geo is offline
    MemberRank
    May 2016 Join Date
    United KingdomLocation
    16Posts

    Re: Nano - PHP7, MVC, PDO

    Quote Originally Posted by rafa95123 View Post
    Good updates, but i don't recommend to use "hosted" images in cms, leave author decide url of image... (Of corse if hosted in own cms will make a faster site, but also heavier)
    Do you mean article content images or the actual image of each article? Article images are stored in the CMS folder, but you are able to link any image URL for the content images e.g. the elphpant image above.

    Quote Originally Posted by Japaojp View Post
    Also, it would be good just if you could prevew what image you are picking. Choosing by name sucks.
    Would prefer the size of the news in the home page being just like old school habbo. Already has a lot of images ready to be used in that square format.
    You can preview the image, you select a name from the dropdown list and then select the blue "preview" text seen next to the "Image" label; this opens up a modal showing you details of the image such as it's name and the actual image preview.

  6. #21
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Nano - PHP7, MVC, PDO

    The preview is to complicated like @Japaojp was saying. The link and modal is nice but not user friendly.

  7. #22
    Banned rafa95123 is offline
    BannedRank
    May 2009 Join Date
    /home/RaphaLocation
    564Posts

    Re: Nano - PHP7, MVC, PDO

    Quote Originally Posted by Geo View Post
    Do you mean article content images or the actual image of each article? Article images are stored in the CMS folder, but you are able to link any image URL for the content images e.g. the elphpant image above.
    The actual image of each article, cause if stay with CMS will make her heavier. I prefer leave author decides with a external link...

  8. #23
    ◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜ Taiga is offline
    DeveloperRank
    May 2007 Join Date
    InternetLocation
    2,464Posts

    Re: Nano - PHP7, MVC, PDO

    I noticed an inconsistency, it seems that you use array() in your first example and in your others you use []; I Think you should fix that inconsistency issue. Since it's 7 you should stick with [];

  9. #24
    Apprentice Geo is offline
    MemberRank
    May 2016 Join Date
    United KingdomLocation
    16Posts

    Re: Nano - PHP7, MVC, PDO

    Quote Originally Posted by rafa95123 View Post
    The actual image of each article, cause if stay with CMS will make her heavier. I prefer leave author decides with a external link...
    Yes that may make the author feel like they have more accessibility but it would also affect performance and security, it may also affect the appearance of the site as they may link an URL of an image which for example has different sizes to the standard articles images or even a dead/blocked image link.

    Quote Originally Posted by CodeDragon View Post
    I noticed an inconsistency, it seems that you use array() in your first example and in your others you use []; I Think you should fix that inconsistency issue. Since it's 7 you should stick with [];
    I use a mixture of both syntax styles, mainly the short syntax for shorter logic such as returning data alongside a view whilst I mainly use the standard syntax style for larger arrays, sometimes even both syntax styles are used for things like hash tables.

    Doesn't make much of a difference which is used on the current version as both are compatible, just more of a personal preference really.



Page 2 of 2 FirstFirst 12

Advertisement