So here's the deal,
I am building out a site right now and want to plan for the future, in terms of performance and such. One performance trick that I've been reading about lately talks about placing images, javascript, and css (all static) files on a separate subdomain/s so that the client will experience a faster download experience w...
Hello everyone,
There are a ton of PHP frameworks out there (i.e. Zend, Seagull, Symfony, CodeIgniter, CakePHP, Yii, Prado) that do a great job of implementing important pieces of a scalable/maintainable website, and I almost always pick one to start building client websites.
As of recently, I've started getting tired of providing cons...
What is the best way to use controllers/views in CodeIgniter?
Is the following a bad way to go about making my pages?
function index()
{
$this->load->library('carabiner');
$this->load->view('include/head');
$this->load->view('include/home');
$this->load->view('top');
$this->load->view('featured');
$this->l...
I use codeigniter, and I need to get data from 2 different table. for now it returns data only from works_image table. how can I get data from both 2 table ?
thanks a lot!!
$this->db->select('works_image.*', 'works.*');
$this->db->from('works_image', 'works');
$this->db->join('works', 'works.id = works_image.id_work');
$result = $thi...
I'm having trouble getting Carabiner to work...
There aren't any errors--my files just aren't working.
I haven't changed the config.
In my function I have:
$this->load->library('carabiner');
$this->carabiner->display();
This should output all the css and js in my asstes folder, right?
I've tried moving the assets folder around t...
I am developing a website in PHP and I would like to use a mvc framework to do this as I want to gain experience with PHP frameworks.
I have looked at Zend, CakePHP, and CodeIgniter and I have not been able to find an intuitive way to accomplish this.
What I need to do is create a layout that will be for example:
<html>
<head>
<!--scr...
I just started using CI today.. I normally use CakePHP but a whole lot of smaller projects needed something less "bulky".
What is the easiest way to implement sticky forms (retain user input after reload) in CI?
I currently have a whole lot of radio buttons for multiple choice quiz and some other text fields and when validation fails...
Ok so here's the deal,
I'm trying to display a tooltip (instead of the ginfowindow) over some Yelp Map Markers that I am pulling onto a Google Map.
I would like to have the exact same effects as Yelp. i.e. The tooltip seems to be set such that it's z-index is always above all other elements nearby, it moves the tooltip once it appears...
I am trying to use Kcaptcha with codeigniter. I created a function in the controller to output the image but the session var is not being set afterwards:
controller:
function captcha(){
$this->load->library(array('session', 'kcaptcha/kcaptcha'));
$this->session->set_userdata('captcha_keystring', $this->kcaptcha->getKeyString())...
This is a quick syntax question...
I need to block out an HTML element if two SQL statements are true w/ php.
If the status = 'closed', and if the current user is logged in. I can figure out the calls, I just need to see an example of the syntax. :)
So, If SQL status=closed, and if current_user=is_logged_in()...something like that.
...
My setup is as follows:
Table 'data': 'title','body',...,'user_id',...
Table 'users': 'user_id','some_val'...
Basically I want to somehow join the tables 'data' and 'users' on the user_id field so that I can pull 'some_val' from the 'users' table. My problem is that not every user_id in the 'data' table has a corresponding entry in...
I am using php/codeigniter, and typically to loop over query results I would do something like this:
<?php foreach($data as $row):?>
//html goes here
<?php endforeach;?>
But, say I have another object array, $data2, with the same number of objects as $data: is there any valid php syntax that would allow me to simultaneously access "ro...
I normally name my db specific fields in my forms like this "objectname[columnname]", I tseems CI cant access these values using $this->input->post('objectname[columnname]'), what do I do? there is not a chance in hell im renaming 100+ form fields.. I am actually disliking CI, it really is getting in the way of progress by changing the d...
I have the following code:
$data['x'] = $this->x->getResults();
$data['y'] = $data['x'];
//some code here to modify $data['y']
//this causes (undesirably) $data['x] to be modified as well
I guess since all the elements of $data are themselves references, modifying $data['y'] also modifies $data['x']..which is NOT what I want. I w...
I have a controller for my front end, and I'm using the DX Auth lib.
I want to use DX Auth's registration, but include it in my front page controller...I can simply copy-paste the function, but is there a better way to do this?
...
Very possibly very related:
What PHP framework would you choose for a new application and why?
Zend or CakePHP?
Which one is better?
Some people say CakePHP is better for php 4, what do you think?
In my case, I would like the following:
Lesser code to write, have really strong library and plugin base. Always have new library ...
What are the best practices for CodeIgniter?
...
I have a login system requiring a username and a password. I want to display a captcha after a certain amount of failed login attempts. What is the proper way to implement this? I've read around on this site and some solutions suggest having a 'failed-attempts-count' added to the users table. However, I need the failed attempts to no...
I'm trying to determine the best practice for calling multiple views from the same method in a controller.
Is it preferable in the controller to make one view call, then have that view call all the views it needs, or call all the views you need in sequence in the controller?
Example:
function index(){
//set all data variables
...
I have created a quiz app which emails the user the results. I want to include a link in the url that the user can click on and view a breakdown of their results I want the url to look something like this:
http://www.mysite.com/quiz/view/32k4k2u4vxcv88xcv8cv0x98c9v7c7v8887cv
obviously a can't just hash the id cos that is easy to revers...