Giter Site home page Giter Site logo

Rendering Partial Views about mini HOT 4 CLOSED

panique avatar panique commented on May 17, 2024
Rendering Partial Views

from mini.

Comments (4)

 avatar commented on May 17, 2024

It's not clear what you are asking. You call multiple views from inside the controller. It's the controller methods that loads this information.

Taken from the example:

public function index()
    {
        // debug message to show where you are, just for the demo
        echo 'Message from Controller: You are in the controller home, using the method index()';
        // load views. within the views we can echo out $songs and $amount_of_songs easily
        require 'application/views/_templates/header.php';
        require 'application/views/home/index.php';
        require 'application/views/_templates/footer.php';
    }

This is actually loading Partial Views from the application/views/ directory.

If your are referring to the logic however, as in the code that grabs/saves information to/from a database then this is found in the models folder. If you wanted multiple models to be able to speak to each other i.e. songs model to be able to access stats model methods then you would just extend that class based on the other.

from mini.

panique avatar panique commented on May 17, 2024

@mituriu This project is as simple as possible, for there's no partial rendering yet, as this would make things more complicated. Keep it supersimple!

from mini.

panique avatar panique commented on May 17, 2024

If you really need this: This feature is implemtend in the php-mvc-advanced version :) via Twig:
https://github.com/panique/php-mvc-advanced/blob/master/application/views/songs/index.twig

from mini.

mituriu avatar mituriu commented on May 17, 2024

Thank you @panique, I figured out a way of implementing what i needed. Very good framework btw!

from mini.

Related Issues (20)

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.