1. Go to this page and download the library: Download jijihohococo/ichi-template library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jijihohococo / ichi-template example snippets
composer
use JiJiHoHoCoCo\IchiTemplate\Template\View;
// example //
View::setPath(__DIR__.'/../views/');
public function showData(){
//
return view('show_data.php');
}
public function showData(){
return view('show_data.php',[
'data' => 'Hello World'
]);
}
public function showData(){
return view('show_data');
}
namespace App\Components;
use JiJiHoHoCoCo\IchiTemplate\Component\Component;
class TestComponent extends Component{
public function render(){
return view('componet_view.php');
}
}
$templateCommand = new TemplateCommand;
$templateCommand->setPath('new_app/Components');
$templateCommand->run(__DIR__,$argv);
component('App\Components\TestComponent');
namespace App\Components;
use JiJiHoHoCoCo\IchiTemplate\Component\Component;
class TestComponent extends Component{
private $name;
public function __construct(string $name){
$this->name=$name;
}
public function render(){
return view('componet_view.php',[
'name' => $this->name
]);
}
}