本文整理汇总了PHP中App::flash方法的典型用法代码示例。如果您正苦于以下问题:PHP App::flash方法的具体用法?PHP App::flash怎么用?PHP App::flash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App
的用法示例。
在下文中一共展示了App::flash方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: s003
/**
* POST /uom
*
*/
public function s003()
{
$error;
try {
$req = App::request();
if ($req->isPost()) {
$post = $req->post();
$attributes = array("uom_nama" => $post["uom_nama"], "aktif" => isset($post["aktif"]) ? 1 : 0);
$table = UOM::table();
if (is_null($post["gen_id"]) || $post["gen_id"] == "") {
$table->insert($attributes);
} else {
$where = "uom_nama = '" . $post["gen_id"] . "'";
$table->update($attributes, $where);
}
}
} catch (Exception $e) {
$error = $e->getMessage();
ZiUtil::unique_error($error);
App::flash('error', $post["uom_nama"] . ' ' . ZiUtil::unique_error($error));
App::redirect('unitOM.a001');
}
App::flash('info', 'Data Tersimpan : ' . $post["uom_nama"]);
App::redirect('unitOM.index');
}
示例2: doRegister
/**
* Seed the database with initial value
*
* @return void
*/
public function doRegister()
{
try {
if ($this->_testemail(Input::post('email')) == 0) {
if (strlen(Input::post('password')) >= 8) {
if (Input::post('password') == Input::post('confirm_password')) {
$newUser = Sentry::createUser(array('email' => Input::post('email'), 'password' => Input::post('password'), 'first_name' => Input::post('first_name'), 'last_name' => Input::post('last_name'), 'activated' => true));
$newUser->save();
Response::redirect($this->siteUrl('login'));
} else {
App::flash('message', 'Les mots de passe ne correspondent pas !');
Response::redirect($this->siteUrl('register'));
}
} else {
App::flash('message', 'Votre mot de passe est trop court (plus de 8 charactères)');
Response::redirect($this->siteUrl('register'));
}
} else {
App::flash('message', 'Votre adresse email n\'est pas valide');
Response::redirect($this->siteUrl('register'));
}
} catch (\Exception $e) {
Response::redirect($this->siteUrl('register'));
App::flash('message', $e->getMessage());
}
}
示例3: update
public function update()
{
if (doo_csrf()) {
$top_ad_field = $this->app->advertisement->where('id', 1);
$this->app->advertisement->createOrUpdateById($top_ad_field, 'Top Ads', ['id' => 1, 'top_ad' => \Input::post('top_ad'), 'bottom_ad' => \Input::post('bottom_ad'), 'side_ad' => \Input::post('side_ad'), 'top_ad_logo' => \Input::post('top_ad_logo')]);
\App::flash('ads-updated', 'Ad spaces have been updated!');
\Response::redirect($this->site_url . '/admin-area/ad-boxes');
}
}
示例4: update
/**
* Update item from edit form - post/patch
*/
public function update($id)
{
if (doo_csrf()) {
$content = \Input::post('editor1');
$page_title = \Input::post('pageTitle');
$order = \Input::post('order');
$slug = \Input::post('slug');
$this->app->page->update('id', $id, ['title' => $page_title, 'content' => $content, 'order' => $order, 'slug' => $slug]);
\App::flash('page_updated', $page_title . ' page has been updated!');
\Response::redirect($this->site_url . '/admin-area/pages');
}
}
示例5: index
public function index()
{
$req = App::request();
if ($req->isPost()) {
if ($this->auth->login($req->post('user'), $req->post('passwd'))) {
App::flash('info', "Your login was successful")->redirect('home');
} else {
App::flash('error', 'Your username or password was wrong');
}
}
App::render('auth/login');
}
示例6: update
public function update()
{
//chechk if form $_POST 'token' is true - for csrf prevention
if (doo_csrf()) {
$public_key = \Input::post('public_key');
$private_key = \Input::post('private_key');
$check = $this->app->recaptcha->where('id', 1);
$this->app->recaptcha->createOrUpdateById($check, 'reCAPTCHA keys ', ['id' => 1, 'public_key' => $public_key, 'private_key' => $private_key]);
\App::flash('recaptcha', 'rCAPTCHA Keys updated.');
\Response::redirect($this->site_url . '/admin-area/recaptcha');
}
}
示例7: update
public function update()
{
//chechk if form $_POST 'token' is true - for csrf prevention
if (doo_csrf()) {
$facebook_user = \Input::post('facebook_user');
$twitter_user = \Input::post('twitter_user');
//$gplus_user = Input::post('gplus_user');
$check = $this->app->social_username->where('id', 1);
$this->app->social_username->createOrUpdateById($check, 'Side Media Usernames ', ['id' => 1, 'facebook_user' => $facebook_user, 'twitter_user' => $twitter_user]);
\App::flash('socialUsernames', 'Social Media Usernames updated.');
\Response::redirect($this->site_url . '/admin-area/social-username');
}
}
示例8: update
public function update()
{
//chechk if form $_POST 'token' is true - for csrf prevention
if (doo_csrf()) {
$facebook_app_id = \Input::post('facebook_app_id');
$facebook_secret_key = \Input::post('facebook_secret_key');
$twitter_app_id = \Input::post('twitter_app_id');
$twitter_secret_key = \Input::post('twitter_secret_key');
$check = $this->app->social_key->where('id', 1);
$this->app->social_key->createOrUpdateById($check, 'Social Media Key ', ['id' => 1, 'facebook_public_key' => $facebook_app_id, 'facebook_secret_key' => $facebook_secret_key, 'twitter_public_key' => $twitter_app_id, 'twitter_secret_key' => $twitter_secret_key]);
\App::flash('socialkeys', 'Social Media API Key updated.');
\Response::redirect($this->site_url . '/admin-area/social-keys');
}
}
示例9: update
/**
* Get site details
* @param $data = $_POST
* @return string and int
*/
public function update()
{
if (doo_csrf()) {
try {
$id = \Input::post('id');
$site_title = \Input::post('site_title');
$description = \Input::post('description');
$keywords = \Input::post('keywords');
$this->app->siteMetaForm->validator($_POST);
$check = $this->app->site_meta->where('id', $id);
$this->app->site_meta->createOrUpdateById($check, 'Site Meta Details ', ['id' => $id, 'title' => $site_title, 'description' => $description, 'keywords' => $keywords]);
\App::flash('site-metas', 'Site Metas updated!');
\Response::redirect($this->site_url . '/admin-area/site-details');
} catch (\Doowebdev\Validation\DooFormValidationException $e) {
$this->data['site_title_errors'] = $e->getErrorFor()->first('site_title');
$this->data['description_errors'] = $e->getErrorFor()->first('description');
$this->data['keywords_errors'] = $e->getErrorFor()->first('keywords');
\View::display('admin/setting/site-details.twig', $this->data);
}
}
}
示例10: addSettings
/**
* Add settings to generate site
*/
public function addSettings()
{
if (doo_csrf()) {
$item_priority = \Input::post('item_priority');
$item_frequency = \Input::post('item_frequency');
$page_priority = \Input::post('page_priority');
$page_frequency = \Input::post('page_frequency');
try {
$this->app->siteMapForm->validator($_POST);
$check = $this->app->site_map->where('id', 1);
$this->app->site_map->createOrUpdateById($check, 'Item Sitemap Settings ', ['id' => 1, 'priority' => $item_priority, 'freqency' => $item_frequency]);
$check = $this->app->site_map->where('id', 2);
$this->app->site_map->createOrUpdateById($check, 'Page Sitemap Settings ', ['id' => 2, 'priority' => $page_priority, 'freqency' => $page_frequency]);
\App::flash('sitemap', 'Site Map updated');
\Response::redirect($this->site_url . '/admin-area/sitemap');
} catch (\Doowebdev\Validation\DooFormValidationException $e) {
$this->data['item_priority_errors'] = $e->getErrorFor()->first('item_priority');
$this->data['item_frequency_errors'] = $e->getErrorFor()->first('item_frequency');
$this->data['page_priority_errors'] = $e->getErrorFor()->first('page_priority');
$this->data['page_frequency_errors'] = $e->getErrorFor()->first('page_frequency');
return \View::display('admin/setting/sitemap.twig', $this->data);
}
}
}
示例11: d011
public function d011($id = null)
{
if (!is_null($id)) {
$result = ItemPrice::find($id);
$result->delete();
ZiUtil::to_json(json_encode("{ success: true}"));
return;
}
App::flash('error', 'Terjadi kesalahan pada inputan anda.');
App::redirect('itemprice.index');
}
示例12: export
public function export()
{
try {
$req = App::request();
$params = $req->get();
if (!empty($params['cx'])) {
switch ($params['cx']) {
case 'xls':
$this->excel($params);
break;
case 'pt':
$this->print_harian($params);
break;
case 'pdf':
$this->pdf($params);
break;
default:
# code...
break;
}
}
} catch (Exception $e) {
App::flash('error', $e);
}
}
示例13: testFlash
/**
* @covers \Phix\App::flash
*/
public function testFlash()
{
$app = new App();
$this->assertSame(array(), $app->flash());
$app->flash('foo');
$this->assertSame(array('foo'), $app->flash());
$this->assertSame(array(), $app->flash());
$ret = $app->flash(function () {
return 'bar';
});
$this->assertSame(array('bar'), $app->flash());
$this->assertEquals($ret, $app);
}
示例14: d011
public function d011($id = null)
{
if (!empty($id)) {
$req = App::request();
if ($req->isPost()) {
$post = $req->post();
// url_cancel
$sales = SalesApotik::find($id);
if (!empty($sales)) {
$sales->is_canceled = 1;
$sales->save();
//jika berhasil hapus record
$query = "parent = '" . $id . "'";
$results = SalesApotikDetail::all(array('conditions' => $query));
if (!empty($results)) {
foreach ($results as $row) {
//jika berhasil hapus record
$folio = KlinikFolio::find($row->id);
$folio->delete();
}
}
ZiUtil::to_json(json_encode("{ success: true}"));
return;
}
}
}
App::flash('error', 'Terjadi kesalahan pada inputan anda.');
App::redirect('selling.list_penjualan');
}
示例15: delete
/**
* Delete item
*/
public function delete($id)
{
// find user by id and delete
try {
$clean_id = strip_tags($id);
$user = $this->app->auth->findUserById($clean_id);
$user->delete();
\App::flash('user-deleted', ' User successfully deleted.');
\Response::redirect($this->site_url . '/admin-area/users');
} catch (\Exception $e) {
\App::flash('user-no-delete', 'User could not be deleted.');
\Response::redirect($this->site_url . '/admin-area/users');
}
}