This file contains 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 | |
class View_Helper_BaseUrl extends Zend_View_Helper_Abstract | |
{ | |
public function baseUrl() | |
{ | |
return 'http://localhost/myapplication'; | |
} | |
} | |
?> |
This file contains 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
{ | |
"algorithm":"HMAC-SHA256", | |
"expires":1297328400, | |
"issued_at":1297322606, | |
"oauth_token":"OAUTH_TOKEN", | |
"app_data":"any_string_here", | |
"page":{ | |
"id":119132324783475, | |
"liked":true, | |
"admin":true |
This file contains 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 app\controllers; | |
use app\models\Users; | |
class UserController extends \lithium\action\Controller { | |
public function signup() { | |
$user = Users::create(); | |
if(($this->request->data) && $user->save($this->request->data)) { |
This file contains 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 app\models; | |
class Users extends \lithium\data\Model { | |
protected $_schema = array( | |
'_id' => array('type' => 'id'), | |
'username' => array('type' => 'string', 'null' => false), | |
'password' => array('type' => 'string', 'null' => false), | |
'name' => array('type' => 'string', 'null' => false), |
This file contains 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 app\extensions\helper; | |
use lithium\security\Auth; | |
class User extends \lithium\template\helper { | |
public function connected() { | |
return Auth::check('member', $this->_context->_config['request']); | |
} | |
} |
This file contains 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 app\models; | |
use lithium\util\Validator; | |
class Users extends \lithium\data\Model { | |
protected $_schema = array( | |
'_id' => array('type' => 'id'), | |
'username' => array('type' => 'string', 'null' => false), | |
'password' => array('type' => 'string', 'null' => false), |
This file contains 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
public function index() { | |
$users = Users::all(); | |
return compact('users'); | |
} |
This file contains 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 | |
use lithium\storage\Session; | |
use lithium\security\Auth; | |
Session::config(array( | |
'cookie' => array('adapter' => 'Cookie'), | |
'default' => array('adapter' => 'Php') | |
)); | |
Auth::config(array( |
This file contains 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 app\controllers; | |
use app\models\Users; | |
use lithium\security\Auth; | |
use lithium\storage\Session; | |
class UserController extends \lithium\action\Controller { | |
// Action index & signup ... |
This file contains 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 app\controllers; | |
use app\models\Users; | |
use lithium\security\Auth; | |
use lithium\storage\Session; | |
class ExampleController extends \lithium\action\Controller { | |
public function test() { | |