我已经在CodeIgniter中创建了一个控制器和一个视图,但当我在网站URL中给出控制器名称时,它显示404



下面是我在控制器文件夹中创建的控制器代码。我是CI的新手,我在看了这个项目的其他文件后写了这个代码:-

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Projectmanagerinterviewtips extends CI_Controller {
    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     *      http://example.com/welcome
     *  - or -
     *      http://example.com/welcome/index
     *  - or -
     * Since this controller is set as the default controller in
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /welcome/<method_name>
     * @see http://codeigniter.com/user_guide/general/urls.html
     */
    public function index()
    {
        $this->load->model('job_model');
        $this->load->library('session');
        $data['session'] = $this->session;
        $data['countries'] = $this->master_model->getCountry();
        $data['page'] = "Projectmanagerinterviewtips";
        $data['title'] = "Jobsclue";
        $data['metakeywords'] = "Jobsclue";
        $data['metadescription'] = "Jobsclue";
        $data['canonical'] = base_url()."signup";
        $data['canonical'] = base_url()."Projectmanagerinterviewtips";
        $data['displaycontrol'] = $this->load->view('recentjobscontrol', $data, true);
        $data['recentjobs'] = $this->job_model->getRecentJobs();
        $data['jsscripts'] = array(
                                    "<script src="".base_url()."assets/js/signup.js"></script>",
                                    "<script src="".base_url()."assets/js/master.js"></script>",
                                    "<script src="".base_url()."assets/js/select-chosen.js"></script>",
                                    "<script src="".base_url()."assets/js/jquery.scrollbar.min.js"></script>"
                                    // "<link href="".base_url()."assets/plugins/select2/select2.min.css" rel="stylesheet">"
                                ); 
        $this->load->view('templates/header',$data);
        $this->load->view('templates/topbar');  
        $this->load->view('project-manager-interview-tips',$data);
        $this->load->view('templates/footer', $data);
    }
}

以下是我创建的视图代码:-

<section>
    <div class="block no-padding  gray">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="inner2">
                        <div class="inner-title2">
                            <h3>Interview-Tips</h3>
                            <span>Keep up to date with the latest news</span>
                        </div>
                        <div class="page-breacrumbs">
                            <ul class="breadcrumbs">
                                <li><a href="<? echo base_url();?>" title="">Home</a></li>
                                <li><a href="#" title="">Pages</a></li>
                                <li><a href="#" title="">Interview-Tips</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<section>
    <div class="block">
        <div class="container">
            <div class="row">
                <div class="col-lg-8 column">
                    <div class="job-single-sec">                            
                        <div class="job-details">
                            <h3>Interview tips </h3>
                            <p>A day or two before the interview most of us have butterflies in out stomach because we are probably too nervous to even say that we are nervous and feel anxious. If you are able to prepare well for an interview then that's usually half the work done.</p>
                            <h3>Here are some tips that can help you for interview preparation -</h3>
                            <h3>Review your CV</h3>
                            <p>In all likelihood we all remember every word of our curriculum vitae. That is a good thing but when you are faced with an interview by the most experienced people, you might fumble. It's always a good practice to review your curriculum vitae a day before the actual interview.Also ensure that you do not misrepresent any of the factual data including:Period of service , Current remuneration, Current position and Job description , Previous employment data , Family background, Education background , References , Training etc. </p>
                            <h3>Do proper homework</h3>
                            <p>One of the things that might really work in your favor is that if you can take some time to research about the company you are going to give an interview. All the important information can be fetched from the company's web site like- Company's Profile, Corporate culture, Management, products/ services etc. Similarly, gather all the information about the position being interviewed for, Role and Job Description, Salary range as indicated by the client, The name of the interviewer, his designation / panel size, Contact person and telephone number for better preparation. </p>
                            <h3>Prepare for some basic questions</h3>
                            <p>All the preliminary interviews include some common questions. Well preparation for these questions means half battle won!!! Question that are mostly expected are</p>
                            <ul>
                                <li>Reason for leaving the present job </li>
                                <li>Your strengths and weaknesses </li>
                                <li>A valid explanation if there have been too many changes in jobs </li>
                                <li>Questions based on the job / specialization </li>
                                <li>Career plans and where you see yourself in the next 5-7 years </li>
                                <li>Your knowledge about the company you are seeking a job with </li>
                                <li>Your awareness of current affairs related to your industry </li>
                                <li>Personal likes / dislikes / hobbies / willingness to relocate </li>
                                <li>Current salary and expected salary </li>
                                <li>References from ex-employers </li>
                                <li>Family details </li>                                                            
                            </ul>
                            <h3>Prepare interview material</h3>
                            <p>Create a list of your interview material, gather it can place all papers, curriculum vitae, photographs, previous appointment letters and all related documents. Put them in your file and review if every paper is in order. </p>
                            <h3> Pay attention to you dress code and grooming</h3>
                            <p>Who says looks do not matter, well they do and a lot. No one wants a shabbily dressed person working in the office. Your appearance must be of a polished person.</p>
                            <h3>Quality time</h3>
                            <p>The time that you spend with the client at the Interview, needs to be quality time. This is an opportunity to highlight your positive points, your strengths. The client is looking for the right skill set, attitude, aptitude and values that match with the organization.You must make a positive impression on the client.</p>
                            <h3> Pitfalls to avoid during an interview</h3>                             
                            <ul>
                                <li>Do not be late for an interview. If the circumstances are beyond your control ensure the consultant / client is informed well in advance </li>
                                <li>Avoid a limp handshake </li>
                                <li>Be conscious of your body language </li>
                                <li>Avoid any strong regional accents </li>
                                <li>Avoid being either over aggressive or too meek at the interview </li>
                                <li>Avoid usage of words / phrases you are not sure about </li>
                                <li>Do not over emphasize on the remuneration / monetary benefits you are looking for </li>
                                <li>Do not bad-mouth previous employer/s</li>
                                <li>Be honest about the reasons for changing previous jobs </li>
                                <li>Be forthright if you do not have enough knowledge about a particular question asked </li>
                                <li>Do not overstate your past achievements</li>    
                                <li>Ask intelligent / relevant questions when the interviewer gives you a chance to learn more about the company.</li>                                                                  
                            </ul>
                            <h3> Closing the interview</h3>
                            <p>Avoid saying that you need to consult parents / friends to take a decision, rather ask for time to give a response. Don't forget to thank the interviewer for the time and opportunity provided. Be cheerful and positive and show your eagerness to join the organization. </p>
                            <h3> When to take a feedback?</h3>
                            <p>If the interviewer doesn't call back after the interview as promised, don't be surprised -- it happens. It is suggested not to hurry up. If a week goes by after the decision was supposed to have been made, call and ask if the position is still open. If the answer is yes, ask if you're still under consideration. </p>
                            <p>Getting a job is not guaranteed every time but by preparing for it well you are giving yourself the best chance to get a job. Preparation is important to success in any field so if you prepare for an interview well then you are going to get a job.</p>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4 column">                      
                    <? echo $displaycontrol; ?> 
                </div>
            </div>
        </div>
    </div>
</section>

现在,当我把它写在URL中时https://www.sitename.com/Projectmanagerinterviewtips.php它显示404页的

您调用错误。您称之为https://www.sitename.com/Projectmanagerinterviewtips.php

但是您的控制器名称应该是小写字母,并且没有像这样的扩展名".php"。

https://www.sitename.com/projectmanagerinterviewtips

希望这能有所帮助。

相关内容

  • 没有找到相关文章

最新更新