codeigniter-2

Getting the year/month/day as a link in codeigniter calendar class

血红的双手。 提交于 2019-12-08 12:46:44
问题 Im trying to convert the a day to a link if there are any content so the format will be. site/calendar/2012/1/2 so i will be able to retrieve the information that is relevant. in my model in have the template and the other options, Model and Controller can someone please tell me how can i get the dates as year/month/day to the so i can retrieve the values. <div class="content"><a href="year/month/{day}">View</a></div> 回答1: You're setting the month and year in your view method, so you could

how to use this simple acl library into codeigniter

那年仲夏 提交于 2019-12-08 10:42:23
问题 i used cakephp before and now use codeigniter but Unfortunately hasn't any authentication or ACL built-in library ..after more search i have found a good library, but I do not know how to use it..it is no example to use it..any one have create controller and model as sample...thanks for helping <?php (defined('BASEPATH')) OR exit('No direct script access allowed'); class acl { /* Actions:::: * Create 1 * Read 2 * Update 4 * Delete 8 * The allowance is made by a sum of the actions allowed. *

how to pass id in controller from form action using codeigniter

隐身守侯 提交于 2019-12-08 09:37:42
问题 hey guys i am new in codeigniter,i have a form like this <form class="addinvestmentform" action="<?php echo base_url();?>index.php/ctl_dbcont/input_investment/$id" name="application" method="post" > //some code </form> i have a controller methode function input_investment($id) { $this->load->helper('form'); $this->load->helper('html'); $this->load->model('mod_user'); $this->mod_user->insertinvestment($id); } i want to get $id from form action to controller methode how can i do that . . pls

Controlling User Privileges in Codeigniter

前提是你 提交于 2019-12-08 08:59:45
问题 Suppose I am building a web application using Codeigniter. I have two levels of user- 1. Admin and 2. Manager . I want my admin to be able to ADD,EDIT, DELETE, so in my view file I have the following: <a href="somelink">ADD</a> <a href="somelink">EDIT</a> <a href="somelink">DELETE</a> But in some specific pages, I don't want my Manager to be able to delete or edit any record, he will be allowed to add data only . Now my question is since I have multiple types of user and user- privileges do I

CodeIgniter: set_value() or post() - what is faster and what is the best practice to store data into database

本秂侑毒 提交于 2019-12-08 06:40:46
问题 Background Using Codeigniter with form_helper and form_validation to do some form processing. Form has been validated successfully in the controller . Now we need to put this data into the database using the model class. Assumptions Lets assume our form has several input elements (e.g. >20). Question Which of the following code snippets will be more efficient? Both snippets are obviously inside the controller method to which the form submits data. Code Snippet 1 if ($this->form_validation-

How to handle a codeigniter PDF generator

一世执手 提交于 2019-12-08 06:22:45
问题 In the view page "ShowInformation.php" I have the code something like this including the omit css style code and other stuff <?php foreach ($preUser as $value): ?> Citizen ID : <?php echo $value->cid;?></br> First Name : <?php echo $value->name;?></br> ... <?php endforeach; ?> $preUser is a variable passing from the controller and its from database. I need to add the download button in that page and generate the PDF with exact the same PHP/HTML/CSS, supporting UTF-8. Any suggestion ? 回答1: i'm

CodeIgniter ActiveRecord join() method wrapping numbers with backticks

让人想犯罪 __ 提交于 2019-12-08 03:25:37
问题 This is my active record code in CodeIgniter: $this->db->... $this->db->join('post_likes', 'post_likes.user_id="'.$this->db->escape($online_user).'" AND post_likes.post_id=post.id', 'left'); And this is how it is interpreted: LEFT JOIN `post_likes` ON `post_likes`.`user_id`="`3"` AND post_likes.post_id=post.id it gives the error: `user_id`="`3"` How to write a direct number in active record? Update: removing escape to test it on your computer you dont need to have a database. Just trying this

dompdf not rendering images from the server but is rendering from external source

此生再无相见时 提交于 2019-12-08 03:00:06
问题 I'm trying to figure this out for the last few days now and come up with nothing. I have dompdf working on my server and its creating the pdf fine. The only issue is its not rending the images I send to it. I have DOMPDF_ENABLE_REMOTE set to TRUE, tmp folder is writable and get_file_contents is turned on. Now the sample that you get in the dompdf folder renders the remote images fine it just seems to be images file from my server that's causing the issue. I've tried absolute and relative urls

Codeigniter Class Inheritance between modules (wiredesigns) - again

半世苍凉 提交于 2019-12-08 02:16:59
问题 I asked this question previously : Codeigniter Class Inheritance between modules (wiredesigns) I accepted an answer to that question which provided a way of doing what I want by extending a custom controller in application/core. This approach seemed sensible and offered the added benefit of allowing both modules to function independently. However, Having thought about it, I am not sure this is the best approach for this situation because My Products controller will require almost all of the

How to override config's array within a controller in CodeIgniter?

蓝咒 提交于 2019-12-08 01:55:09
问题 I have a file app/config/template.php : $config['head_meta'] = array( 'charset' => 'UTF-8', 'description' => '', 'keywords' => '', 'stylesheets' => array( 'template.css' ), 'scripts' => array( 'plugins/jquery-2.0.3.min.js', 'plugins/bootstrap.min.js' ), 'end_scripts' => array( 'template.js' ) ); I need to override that description inside my controller's function app/controllers/pages.php : function contact($pagename = 'Contact', $slug = 'contact'){ // load dependencies $this->load->library(