Tagged Questions
0
votes
1answer
21 views
Echo Multidimensional array in CodeIgniter?
I have a problem with CI. I am new do CodeIgniter, and I think this is going to be an easy answer, but I don't know that.
I have $results, which is an array, but with CodeIgniter it is this kind of ...
1
vote
3answers
39 views
Code Igniter error?
Can somebody help me, I am new in CI, and I don't know what do I do wrong.
I have this kind of controller
main
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class ...
0
votes
1answer
34 views
CodeIgniter passing parameters to a function in CORE MY_Controller
I hope that this is possible
Can I pass parameters to functions in CORE/MY_Controller?
I am developing a application that has three controllers and most of the functions are the same so I want to ...
2
votes
1answer
35 views
Database driven routing in CodeIgniter 2.x
I am creating a site that will have a lot of routes that will need to be added to the routes file (800+) - obviously I do not want to manually add these one by one into the routes config file.
Can ...
0
votes
0answers
36 views
Code-igniter MVC and HMVC
Thank you guys for reading this post.
I have developed a entire application with code-igniter.
Now clients wants to me to make the future enhancement in MVC.
it is possible to keep my existing MVC ...
0
votes
0answers
21 views
Ion Auth and How to use it in the MVC world
I have been mulling this over for quite a while now, and for some reason it keeps getting jumbled in my head, so hopefully some of you within the community might be able to help me out or set me ...
0
votes
1answer
20 views
add tank_auth validation to several controllers in codeigniter
I have several controllers using Tank Auth like:
class Buscar_animal extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->database();
...
0
votes
2answers
58 views
Critique this MVC approach in Codeigniter [closed]
From a conventional standpoint, I am trying to figure out if what I am doing is considered OK, and if not, what the alternative is.
Here is an example of my set up:
Controller:
function index()
{
...
0
votes
2answers
62 views
Create modules inside a module in CodeIgniter
I am trying to implement HMVC with CodeIgniter. I used this library from bigbucket
CI HMVC Library
It works fine for me when i created admin module. But now i am trying to define module inside a ...
0
votes
0answers
21 views
HMVC architecture - how to load view (strategic decition) - A or B?
I have a strategic decision to make. I am using codeigniter with HMVC and I am not sure which strategy of loading views is better.
Strategy A: Particular controller outputs data and loads the master ...
0
votes
1answer
27 views
CodeIgniter: Instances of CI_Model
I was wondering if CI_Model is more like a database layer, or can i really use it like i would normally use a model.
To me it looks really ugly to do things like:
for($i = 0; $i < 3; $i++){
...
0
votes
1answer
56 views
Correct way to use Model's method in codeIgniter's view?
From my VIEW, let's call it 'index', on a button click I would like to perform a DATABASE QUERY without loading the page again , however I cannot think of a method to so without breaking the MVC ...
0
votes
1answer
54 views
CodeIgniter helper in the view
Is it a good workaround and would it be possible to use helper classes in the view, in CodeIgniter. I have a situation when I have to extract with regulars expression from a text couple of strings and ...
0
votes
0answers
43 views
What is the best approach handling post queries in CodeIgniter using MVC?
My view has a search box (but the question is more general than for this scenario) and when you submit your search query, controller checks your input and displays results with pagination.
Now, to ...
0
votes
2answers
87 views
Include all codeigniter functions to a new static page(php file) which is located in root folder. [closed]
I am developing a website which having many static pages. so i created controller only for dynamic pages(it might be wrong practice). Keeping all other static files in root folder. Now i want to use ...
0
votes
1answer
35 views
Abstraction level for MVC mass versions of a view
I have an MVC that serves a form to a view. I'm pondering the best approach to serving form content, that is form elements such as labels and form inputs such as selects. It is possible that the form ...
0
votes
1answer
17 views
Preventing access to subsequent pages not proceeding current
I have a codeigniter MVC setup where a piece of a form exists on one page.
Each time the user clicks the submit button, the same controller loads the next piece of the form under the same url ...
0
votes
3answers
111 views
CodeIgniter - Shopping Cart on all pages
I have to put a shopping cart on several pages on my ecommerce website (CodeIgniter, MVC Paradigm).
I don't really want to call the model behind this widget in all my controllers.
I know that a ...
0
votes
2answers
36 views
retrieving data in view from controller
So im running a query and trying to return a result set back into my view however when I do <?php foreach ($form_records as $form_record) : ?><?php echo $form_record['fname']; ?> <?php ...
0
votes
0answers
66 views
Is a RESTful service a requirement to using ember.js or other javascript MV* frameworks?
Does using a javascript MV* framework (ember.js) necessitate the use of RESTful services, or can it work just as well by passing json data from a server side MVC framework (CodeIgniter) controller?
1
vote
1answer
96 views
MVC pattern: using functions from model in view [closed]
I've been developing a web application using CodeIgniter.
I've also implemented all the functions following the MVC structure, but I am not sure whether I've confused myself so far...
If I use the ...
0
votes
1answer
63 views
How to build MVC site correctly
I'm building a website using CodeIgnitier.
My problem is how can I use the MVC pattern inside a webpage.
Let's say I have a controller called "Settings", Within this page I want to divide the ...
-2
votes
1answer
680 views
Codeigniter: which is better approach MVC or HMVC [closed]
i want to get start with codeigniter,
i know the difference between MVC and HMVC but i need to know which approach is better,
i need an seperate admin panel like
...
0
votes
1answer
59 views
Is HMVC the solution for a plugin framework? [closed]
I want to create some sort of plugin framework (see: CodeIgniter - how to create a plugin system?). After doing some more research into the problem, I am wondering if HMVC is the solution. Any ...
0
votes
2answers
145 views
How do I display active record in codeigniter with multiple controllers?
I am building my comment module and trying to get the active records to display on view. Seems simple however I have a lot going on and using a separate model and controller then what the view is ...
-2
votes
2answers
129 views
Codeigniter Libraries & Modules - When should I use them? [closed]
I am new to MVC, using Codeigniter as my first framework and venture into MVC. While I understand the concept of MVC, I get confused wondering how this works when it comes to complicated pieces of ...
0
votes
1answer
48 views
Is it OK to call authentication methods from the view in Codeigniter?
I am using TankAuth with Codeigniter, and I was wondering if it is alright to call library specific methods from the view, as opposed to passing them from the controller? For example,
...
0
votes
2answers
58 views
How to save and display values from modal to view by database using codeigniter
I am fairly new to codeigniter and cant seem to get a hold of this problem, in short i am having problem understanding the flow of data among the MVC framework. All i want to display is data taken ...
1
vote
1answer
44 views
To what extent is duplicate code OK in a model with CodeIgniter?
This is a long running question that gets me every time I am developing.
I suppose it is not specific to CodeIgniter, but as I am using it, I will consider it in my example.
Firstly, which is ...
0
votes
0answers
36 views
Where to put model code in ORM ? (Eloquent)
I dont quite understand where my code goes for this orm.
class Brand_model extends MY_Model {
public function add_brand($name, $size)
{
//goal:
// $sql = "insert into brand (name, size_id) ...
0
votes
1answer
63 views
Calling a Helper from a View in Codeigniter. Good Practice? [closed]
I am converting an exisiting project into code igniter and need to keep the exisiting URL's intact. Therefore, i'm looking to create my own url helper.
It seems that the most strait forward way to ...
0
votes
2answers
97 views
Should one library call another or is it a task of controller in Codeigniter and in MVC in general
I have to make some design decision in my application using Codeigniter.
I have a method in controller that calls a library for creating PDF.
Also I have some class that takes a number as an ...
-1
votes
1answer
58 views
Must all MVC Framework libraries be classes? [closed]
I'm working with Codeigniter framework and i see that all libraries are classes. All helpers are simple functions.
I need to know if in every framework all libraries have to be classes.
1
vote
1answer
78 views
What is a good technique to prevent unauthenticated users from accessing controller methods?
I have an event(s) controller:
class Event extends CI_Controller{
public function index(){
}
public function foo(){
}
//Shouldn't be able to use this method unless logged in
...
2
votes
1answer
110 views
fat model and skinny controller design confusion between the controller method and model method
i'm newbie in MVC (using codeIgniter as my example) and i have read MVC fat model and skinny controller for like 3 times, what i got :
model does the hardwork while controller calls the model and ...
0
votes
1answer
51 views
How to display a reminder window on any page of application
In my web application, users will be able to set reminders for upcoming tasks and events. I am developing the application using CodeIgniter (PHP) with model-view-controller base.
I set the database ...
0
votes
1answer
69 views
Doctrine Entity Manager access
I integrated my Codeigniter with Doctrine ORM the way described in this great tutorial
http://www.joelverhagen.com/blog/2011/05/setting-up-codeigniter-2-with-doctrine-2-the-right-way/.
It says that ...
0
votes
1answer
68 views
MVC Structuring Models [closed]
I have a very general question on MVC(I'm working with PHP+CodeIgniter though this question fits all) : while working on my web app (a pretty simple crud application) when writing a new model function ...
0
votes
1answer
149 views
how to combine strategy and mvc pattern
I'm trying to made my project class diagram diagram. In my project, text contents are converted to visuals, i had used strategy and factory pattern for visuals, but currently i'm using php code ...
0
votes
1answer
403 views
Backbone.js and codeIgniter
I'm using the codeigniter Framework to use my servers side logic, and I want to use backbonejs to manage the client side logic.
I read a lot about it and there are many ways to achieve this, I ...
0
votes
1answer
87 views
Load PHP view file from controller with given parameters
I have a simple controller file StudentController.php
<?php
$data = array();
$data["firstName"] = $_GET["firstName"];
loadView("StudentView.php", $data);
?>
I have a even simpler view file ...
0
votes
0answers
82 views
Insert in many tables with My_Model in Codeigniter
I have a site developed in codeigniter.I have done an insert into my database without validation.
Now I want to use My_Model (an extended model to validate my fields used by many developer to ...
-2
votes
1answer
147 views
CodeIgniter: where to put business logic [closed]
I use CodeIgniter. I am a little bit confused. I read on local wikipedia: Model – represents actual problem or application logics. Somewhere else I read that model should be PHP representation of ...
1
vote
2answers
392 views
Code Igniter / Fat Models / Skinny Controllers
Today, I have learned that it is considered good practice to have fat models and skinny controllers. Up to now, I have had it the other way around, so everything that I believed I understood about MVC ...
0
votes
3answers
54 views
what should be in a MVC view [closed]
Is the below considered too much for a view in codeigniter / php? where $springtrail is an array calculated in a model?
<div id="page_name">Website</div>
<?php
$count = ...
3
votes
3answers
287 views
How is MVC supposed to work in CodeIgniter
As a mostly self-taught programmer I'm late to the game when it comes to design patterns and such. I'm writing a labor management webapp using CodeIgniter.
I did a bit of MVC ASP.NET/C# and Java at ...
0
votes
2answers
387 views
Call controller from submit button with CodeIgniter
I'm loading a view and I'm passing 2 arguments from a controller like this:
$this->load->view('confirm_data_v', $data);
In confirm_data_v view I'm receiving $data that is an array. In ...
0
votes
1answer
114 views
Confusing about using angularJS with Codigniter
I'm new to front-end MVC and I decide to create a SPApplication then I found this angularJS. Of course, other MVC as well but I prefer angularJS.
Ok, my questions here.
Before this, I normally store ...
7
votes
3answers
173 views
How to gradually convert a site over to CodeIgniter?
I've been doing a lot of research in regards to OO and MVC for PHP and have nearly made a choice to move to CodeIgniter for an existing large-scale website I manage. I feel that using an OO+MVC ...
0
votes
1answer
98 views
Using selfmade Navigation class with CodeIgniter
I just started using CodeIgniter, now I have included my own classes in the libraries file of CI and I want to use them for my navigation.
the problem is that I don't know where to call this class ...