Created
January 15, 2014 22:34
-
-
Save guiled/8446088 to your computer and use it in GitHub Desktop.
Custom Kit example in Sohoa Framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Application\Controller { | |
use Sohoa\Framework\Kit; | |
class Main extends Kit | |
{ | |
public function indexAction() | |
{ | |
$this->customKit->print(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Lib\Kit { | |
class Test extends \Sohoa\Framework\Kit\Kitable { | |
public function print() { | |
echo 'OK'; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace { | |
use Sohoa\Framework\Framework; | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
\Sohoa\Framework\Kit::add('customKit', new \Application\Lib\Kit\Test()); | |
$framework = new Framework(); | |
$framework->run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment