SourceForge.jp

PHP framework 'Cheetan'

  Cheetan is MVC framework which is lightest in the world(?) for PHP.

  By the way, I usually use CakePHP. But I want framework that I able to use when the project isn't so large-scale but is a little tired... So I developed such a framework.

  By the way, 'Cheetan' is a nickname of developer's wife.

  Cheetan is licensed under the MIT license.

Information

This site once disappeared because domain expired. This is just a revived (2020) memorial site.

Cheetan repository

https://github.com/dala00/cheetan

PHP7

Someone upgraded for PHP7
https://github.com/symfoware/cheetan

The blog article about it.
軽量PHPフレームワーク「ちいたん」 PHP 7系対応 - Symfoware

He created a manual site. Thanks.
ちいたん ユーザガイド

Source code of this site

Source code of this site is available on GitHub. (I'm sorry it's so dirty because even no PSR in 2006)
https://github.com/dala00/cheetan-web

Feel free to contribute.

News

  Version0.8.1.0 released. Buf fix of query function of model.php

  Action method controller project is released. Try.

  Version0.8.0.8 released. Fixed bug of MySQL port specify. Extended validation.

  Version0.7.9.9 released. Fixed bug of PgSQL. Extended some methods.

  Project registration system is released. There is no server space like sourceforge, but you can release your project here. Use if you have any projects like components or sample program. You need to user regist to regist projects.



This site

  This site is made with Cheetan ( which is not my wife ). Sum of capacity of framework is 42KByte( In non-compression ).

Characteristic

・The shortest source is as follows.

It takes time to make customer installed Smarty. I hate to perse!

Case of one file Case of php code and template file
<?php
    require_once( "cheetan.php" );

function action( &$c )
{
    $c->set( "msg", "Hello, World!" );
}
?>
<html>
<body>
<h1><?php print $data["msg"]; ?></h1>
</body>
</html>
----hello.php----
<?php
    require_once( "cheetan.php" );

function action( &$c )
{
    $c->set( "msg", "Hello, World!" );
}
?>


----hello.html----
<html>
<body>
<h1><?php print $data["msg"]; ?></h1>
</body>
</html>

・You can use common template.

Case of use common template at all pages.

Case of one file Case of php code and template file
----temp.html----
<html>
<body>
<?php contents( $data ); ?>
</body>
</html>


----hello.php----

<?php
    require_once( "cheetan.php" );

function action( &$c )
{
    $c->SetTemplateFile( "temp.html" );
    $c->set( "msg", "Hello, World!" );
}

function contents( $data )
{
?>
<h1><?php print $data["msg"] ); ?></h1>
<?php
}
?>
----temp.html----
<html>
<body>
<?php $this->content(); ?>
</body>
</html>


----hello.php----
<?php
    require_once( "cheetan.php" );

function action( &$c )
{
    $c->SetTemplateFile( "temp.html" );
    $c->set( "msg", "Hello, World!" );
}
?>


----hello.html----
<h1><?php print $data["msg"]; ?></h1>

・You can use Model.

It's only this source code that to save to database.

----config.php----
function config_database( &$db )
{
    $db->add( "", "localhost", "user", "password", "db" );
}

function config_models( &$controller )
{
    $controller->AddModel( "user.php" );
}


----user.php----
class CUser extends CModel
{

}


----test.php----
<?php
    require_once( "config.php" );
    require_once( "cheetan.php" );

function action( &$c )
{
    if( count( $_POST ) )
    {
        $c->user->insert( $c->data["user"] );
    }
}
?>
<form method="post" action="test.php">
name<br>
<input type="text" name="user/name"><br>
email<br>
<input type="text" name="user/email">
</form>