background preloader

CodeIgniter

Facebook Twitter

CodeIgniter and Doctrine from scratch Day 7 – Fixtures & Forum List | PHP and Stuff. Today we will continue building our Message Board project. First we will start building the Home Page, which will be a Forum List. Then we will learn about Doctrine Data Fixtures. This will help us create some test data to play with. First, Some Styling Before we get started, let’s add some style so that pages look somewhat decent. Edit: css/style.css Ok, now we’re ready to get more coding done! The Home Page We are about to work on the Controller and the View for our Home Page (i.e. Home Controller Edit: system/application/controllers/home.php As mentioned before, variables are passed to a View in an array, and the array indexes become variable names. Doctrine::getTable(‘Category’)->findAll(); gives us all of the Category records, in the form of a Doctrine_Collection object. Home View (I’m going build this page in a few steps) Edit: system/application/views/home.php First we make a blank page, with a container div and a heading: Line 26: We are creating a link to the Forum.

The Result Looks nice. Auto PHP Codeigniter CRUD | Grocery CRUD. Simple Login Form With CodeIgniter | JR Tashjian. One of the most basic but, most important part of a web application is the login form. The login form is the first stage of securing your web application. I will show you how I construct one using the Encryption Class, the Form Validation Class and the Session Class of CodeIgniter. To begin, we will need to create our view and controller files as well as load the libraries we will be using. I will not be using a database for this tutorial but, rather an array containing the username and password of out user. For the views, I created a view for the header, the footer, and the login form: footer.php </body></html> login_form.php <h1>Tutorial: Simple Login Form</h1> Thats it for the views, so far. As you can see in the above code, I have already encrypted a password. Echo $this->encrypt->encode( 'password' ); Building the Form After setting up the files as described above, we now need to create the form so our users can login.

Login_form.php <h1>Tutorial: Simple Login Form</h1><? Like this: How the extension of the core classes works and where exactly’s being done? Docs | Jérôme Jaglale. Pages · EllisLab/CodeIgniter Wiki. Home · sjlu/CodeIgniter-Bootstrap Wiki. HMVC: an Introduction and Application. HMVC: an Introduction and Application. CodeIgniter From Scratch: Day 1. Wiredesignz / codeigniter-modular-extensions-hmvc. HMVC in Codeigniter | Kovloq. HMVC in Codeigniter Filed under Programming Modular HMVC = Multiple MVC triads This is most useful when you need to load a view and its data within a view. Think about adding a shopping cart to a page. The shopping cart needs its own controller which may call a model to get cart data. Then the controller needs to load the data into a view. In CI we can’t call more than 1 controller per request. The differences between using a library and a “Modular HMVC” HMVC class is: 1) No need to get and use the CI instance within an HMVC class 2) HMVC classes are stored in a modules directory as opposed to the libraries directory.The image below illustrates how this works Each triad functions independently from one another.

These advantages will allow you to get M.O.R.E out of your application with less headaches. Modular Extensions installation 1) Start with a clean CI install. 2) Set $config[‘base_url’] correctly for your installation. 3) Download Modular extension here modules/guestbook/controllers 7. Forum. User Guide - Template - A CodeIgniter Library. Looking for documentation covering how to install Template? Head over to Getting Started. Or, learn more about the project in the Introduction. User Guide Topics I. Template uses its own configuration file template.php. Config folder, alongside config.php, database.php, autoload.php, et. al. Open config/template.php in a text editor and you'll notice that, much like CodeIgniter's config files, all configurations for Template are stored in a singly array, except ours is stored in the variable.

Config/database.php , Template lets you define templates in "groups," which allows you to use and switch between multiple templates in your application. Setting the Default Template Template requires that you have at least one active template group set with a master template defined. $template['active_group'] = 'default'; $template['default']['template'] = 'template.php'; For , indicate the filename of your master template in the views folder. Note: Template will error if this file cannot be found in your II.