- Seme Framework
- version 4.0.3
- Requirements
- Download & Install
- Configuration
- Tutorials
- URI Routing
- Constants
- Global Variables
- Model
- View
- Controller
- cdn_url
- config
- constructor
- getAdditional
- getAdditionalBefore
- getAdditionalAfter
- getAuthor
- getCanonical
- getContentLanguage
- getDescription
- getIcon
- getJsContent
- getJsFooter
- getJsReady
- getKey
- getKeyword
- getLang
- getRobots
- getShortcutIcon
- getThemeElement
- getTitle
- input
- lib
- load
- loadCss
- loadLayout
- putThemeContent
- putJsContent
- putJsFooter
- putJsReady
- render
- resetThemeContent
- session
- setAuthor
- setCanonical
- setContentLanguage
- setDescription
- setIcon
- setKey
- setKeyword
- setLang
- setShortcutIcon
- setTheme
- setTitle
- Library
- CLI (command line interface)
- Core
- Issue
- Deployment
Hello From Model
On this tutorial we will learn, how to interacted with model from controller.
First, open files located at app/model/hello_model.php
.
If the file doesnt exists, create one.
And then, put this code on it.
<?php
class Hello_Model extends SENE_Model
{
public function __construct()
{
parent::__construct();
}
public function get()
{
return 'Hello World, from model';
}
}
And then, open and edit the app/controller/home.php
again.
Put model loader on constructor.
<?php
class Home extends SENE_Controller
{
public function __construct()
{
parent::__construct();
$this->load("hello_model", "h");
}
public function index()
{
echo $this->h->get();
}
}
And then open localhost/seme_framework
, it should show Hello World from model.