Jump to content


Member Since 03 May 2013
Offline Last Active May 13 2013 12:52 PM

Topics I've Started

Show custom error message while insert/edit

11 May 2013 - 06:18 AM

Hi All,


I want to show a custom error message while inserting a record.





When user try to insert leaving every field empty, It shows a list of error messages and the input fields become red.


The Projectname Feild is required.

The projectPriorityFeild is required.

The projectCostFeild is required.



.and so on.


Now, I want it show a single message that  fields marked red  are mandatory.
How to do this.?

Fetch id from url

09 May 2013 - 01:48 PM

Hi All


I want to fetch id from the url.


URL:- http://localhost/pro...ts/index/edit/3

I have tried:-

        $update_url = $_SERVER['REQUEST_URI'];
        $path = parse_url($update_url, PHP_URL_PATH);
        $pathComponents = explode("/", trim($path, "/"));
        $ID = $pathComponents[7];


It is working fine but when i upload my project on live site, i have  to change the component number everytime and in every controller as there is difference in no. of components.

So, I want to know if there is any other method to fetch to do so..?



Thanks in advance.

Displaying Record name while editing

09 May 2013 - 10:53 AM

Hi All


I want to display the name of the record in breadcrumb when i am editing a record.

Or we can also say i want to pass the name of record to view.



Ex:-  My  Breadcrumb looks like Home>>Projects>>EditProjects

But i want when i edit a particular record it should display Edit"ProjectName".


This is how i am creating the breadcrumbs

 <div id="breadcrumb">
        <a href="<?php echo ADMIN_SITE_URL.'projects'; ?>">Dashboard</a>
        <span class="pipe"> <?php echo '&rsaquo;&rsaquo;';  ?></span>
        <a href="<?php echo ADMIN_SITE_URL.str_replace(' ','',strtolower($subject));?>"><?php if(strtolower($subject) != 'record'): echo $subject; else: echo '&nbsp;'; endif; ?> </a>
        <span class="pipe"> <?php echo '&rsaquo;&rsaquo;';  ?></span>Edit <?php echo $subject;?>


Pass extra data to view

09 May 2013 - 07:54 AM

Hi ,

I have listing of projects ,


In that i have used set_subject method.




and my Add button shows Add New Projects.

but i want the add button to display Add Project rather than Add Projects.



I even tried to use the code given in the link below but coudnt work out.


set a value of dropdown

06 May 2013 - 12:19 PM

I am geting an id from the url and that id is value of an option in dropdown.


Ex:-<option value="37">xxx</option>


Now i want when the value is set , the dropdown value should be set to XXX.



Is there any way to pass value in set relation or any other way to do so..??