A MVC Framework designed to build complex websites and web applications based on WordPress.
PHP
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ActionResult
Admin
Annotations
Config
Controller
Exception
Router
Subscriber
Tests/Router
Traits
View
docs
.gitignore
.sensiolabs.yml
.travis.yml
AbstractPlugin.php
Kernel.php
PluginManager.php
README.md
composer.json
helpers.php
phpunit.xml

README.md

Sense Framework

SensioLabsInsight

Build Status

Sense is a MVC Framework designed to build complex websites and web applications based on WordPress.

Code your WordPress plugins and themes using best practices

YOUR CONTROLLER

class TestController extends AbstractController{
        
   /**
     * @Route("/profile/{name_slug}", name="profile_detail")
     */
    function demoAction($name_slug, \WP_Query $wp_query, \Request $request) {
             
        $repository = $this->get("repository.user");
        $user = $repository->findBy("username", $name_slug);
             
        return $this->resultTemplate('User/profile.php', array(
            "user" => $user
        ));
    }
}

YOUR VIEW

<?php
//your-plugin-path/View/User/profile.php     

    get_header();
        
    $user = sense_view()->get("user");
?>
     
<h1><?php echo $user->getName() ?></h1>
     
<?php
    
    get_footer();

(Yes, you can use Twig if you want too ;)

Read the documentation