FAQ Database Discussion Community


How do I add more functionality to child method?

php,class,inheritance,methods,extend
parent_says() method says something, now I want to add more functonality to parent_says() method but from inside child class. How do I do it? class Parent_class{ function parent_says(){ echo "HI. I'm parent!"; } } class Child_class extends Parent_class{ function parent_says(){ //I want it to also says "HI. I'm parent!", that's...

Extending form validation rule in codeigniter

codeigniter,extend
I have a form with two fields <input type="text" name="total_plots" value="" placeholder="Enter Total plots" /> <input type="text" name="available_plots" value="" placeholder="Enter Available Plots " /> Available plot "available_plots" field value should be less than total plots "total_plots" field value I don't want to write callbacks. I want to extend the form...

Swift. Extending a delegate from a base class

ios,objective-c,swift,delegates,extend
I have an objc base class: @protocol BaseClassDelegate; @interface BaseClass : NSObject @property (nonatomic, weak) id <BaseClassDelegate> delegate; @end @protocol BaseClassDelegate <NSObject> -(void)baseDelegateMethod; @end I am creating a swift sub-class in which I want to extend my delegate... protocol SubClassDelegate : BaseClassDelegate { func additionalSubClassDelegateMethod(); } class SubClass: BaseClass {...

Javascript insert a method call inside another external function

javascript,function,methods,extend
Consider this var obj = { process: function run(param) { return; } } and runSomething(param); The situation is that the run function is built elsewhere in the application and contains some additional processing that need to be done to the runSomething response. is it possible to somehow run obj.run and...

Array.extend(string) adds every character instead of just the string

python,string,extend
I am trying to extend an element to a list in Python, however, instead of extending the string in the index 'i' it extends every character of the string in the index 'i'. For example I have a list called 'strings' with just a string 'string1' and an empty list...

underscorejs - what is the difference between extendOwn vs extend?

underscore.js,extend
While going through underscorejs's list of methods, I couldn't help but notice a method which I don't remember being there before: extendOwn The documentation for this method says the following: extendOwn _.extendOwn(destination, *sources) Alias: assign Like extend, but only copies own properties over to the destination object. I understand how...

Django: CSS not extended for some pages?

python,css,django,extend
I'm trying to learn Django using the online version of the "Test-Driven Development with Python" book. I have a base.html file and home.html and list.html file. Now, CSS works fine for home.html, but not at all for list.html! They both extend their CSS from the base.html file, so why is...

Best practice to extend objects in underscore.js

javascript,underscore.js,extend,relation
I know that extending objects is done via the _.extend(parent, child); method. I've seen different places in the web where people are extending objects in a special way in underscore.js _.extend({}, this, child); Why do they do that?...

How to pass additional arguments to a Constructor when extending a LinearLayout in Android?

android,class,constructor,android-linearlayout,extend
I have the following question, if I have a class extending a LinearLayout like: public class ExtendedSeekbarLayout extends LinearLayout { ..} and I would like to pass additional Arguments to my Layout, how do I do this? I know that I could have the following constructors like: public ExtendedSeekbarLayout (Context...

jQuery extend with key in variable

jquery,extend
I have this function to add key in a data with k="Toto" $Root = $("#" + n); $Root.data("TFO", $.extend({ k: v }, $Root.data("TFO"))); But when I see $Root.data("TFO") I get k instead of the value in k How can I do it?...

Extend Onepage Billing block in Magento

magento,override,extend,billing,onepage
I hope someone already knows how solve this as I've been trying for a couple of days, followed countless tutorials and sadly not got far. I am attempting to override the block file : /app/code/core/Mage/Checkout/Block/Onepage/Billing.php in a custom module (for Magento 1.7) in my module config.xml file, I have added...

Extending prototypes in Javascript - good way?

javascript,oop,inheritance,prototype,extend
I want to validate that the approach I'm using is correct when it comes to extend a prototype - supposing "extend" is the right word. This topic gets a lot of clones. I'm still trying to properly understand this topic... The purpose is: - to write clean and good code....

jqGrid onDelete event handler

events,jqgrid,delete,handler,extend
I'm using a jqGrid with datatype: 'local'. The data of the grid is being set dynamically via addRowData. I don't use the asynchronous ajax stuff such as url + datatype: json because the grid has to display only client state. Now I want to use the jqGrid delete row functionality...

qooxdoo : Extend class

class,extend,qooxdoo
I'm trying to extend a class "qx.ui.splitpane.Pane()" : qx.Class.define("myProject.Pages.Management",{ extend : qx.ui.splitpane.Pane(), construct : function(){ this.base(arguments); }, members : { } }); However, when I create an object based on this new class and add it to my main contenair, I obtain a javascript error : "Uncaught TypeError: undefined is...

Defining selectors to apply to the other styles

css,css3,css-selectors,less,extend
I am fairly new to Less. There is some dynamic content coming from external source which is part of #left(id selector) tag. Here is my Less file: //can i define anything like this in `less` @not-empty: #left:not(:empty); #left { background-color: red; &:not(:empty) { font-size: 20px; background-color: green; } } #right...

C# Windows Phone Using same value in different pages

c#,windows,oop,extend
namespace Challenge { class Constss { public int score= 0; } } I have a class which has public int type. And I am using it in MainPage.xml.cs class. Constss c = new Constss(); c.score = 100; When I want to use it in Step2 class, score value is again...