Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6965083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:00:29+00:00 2026-05-27T16:00:29+00:00

In the views in codeigniter, we can write code for forms using codeigniter. For

  • 0

In the views in codeigniter, we can write code for forms using codeigniter. For example for an url the code in codeigniter is:

<?php
anchor('site/myfunction','Send');
?>

My question is whether is better write this code with html in the views:

<a href="site/myfunction">Send </a>

It’s an example, but the question is with all HTML helpers for views. CodeIgniter’s user guide suggests to use PHP functions rather than code html. The php code requests to the server while html does not. Is better use the CodeIgniter for HTML? I don’t know if when I use CodeIgniter’s helpers, the framework has contemplated these requests.

I apologize for my english. Thanks for your answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:00:29+00:00Added an answer on May 27, 2026 at 4:00 pm

    The reason you want to use CodeIgniters library is for the ability to quickly modify your HTML elements site-wide with very little work. For instance, let’s say you wanted all <a> tags on your site to have a class added called “ajax”. Using the anchor helper, you can accomplish this easily.

    That said, I don’t really foresee many solutions where you will be changing HTML elements site-wide. With semantic HTML, CSS, and Javascript I think you will be perfectly fine without having to use CodeIgniters HTML helpers. Also in my opinion your code will be much more readable. Use HTML.

    Regarding performance

    When you say “code php does requests to the server while html, no” you’re wrong because whenever someone visits your site they are requesting the server. The question here is how much work the PHP engine is doing versus just your normal webserver. In this case, a function call is trivial for PHP and shouldn’t be considered performance wise.

    Regarding urls

    The answer by Pi is focused on the fact that URL resolution in CodeIgniter can be weird, but with proper .htaccess or web.config configurations you should be able to use vanilla hrefs without using CodeIgniter functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two views view1.php and view2.php in CodeIgniter and I have included view2.php
I am trying to use SimpleTest with CodeIgniter, using code supplied by maroonbytes .
I write this from in Codeigniter as a form_view.php . <?php echo form_open('form'); ?>
Currently I tried to remove index.php on codeigniter url. I installed my codeigniter on
I am pretty new to codeigniter. I do know php. How can I accomplish
i wrote some code in codeigniter index controller using model ' navigation ': $this->load->model('navigation');
I have made a site with codeigniter and am using the googlemaps v3 library
In Codeigniter I want to know the best practice for using the same views
The Application In PHP, I will output some initial views so web crawlers can
I want to add some classes to a CodeIgniter project that aren't models, views,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.